Get the rooms list
Options
I'm trying to fetch the rooms list. What I did:
// When player A create a room: TypedLobby type = new TypedLobby("lob1", LobbyType.Default); m_LoadBalancingClient.OpCreateRoom(new EnterRoomParams { RoomName = gameData.Name, RoomOptions = roomOptions, Lobby = type }) [...] // When player B join a lobby: TypedLobby type = new TypedLobby("lob1",LobbyType.Default);//TypedLobby.Default; m_LoadBalancingClient.OpJoinLobby(type)When player B joined the lobby, he never gets OnRoomListUpdate triggered, What am I doing wrong ?
0
Comments
-
0
-
I've already read on this link, It's all about several players (why we can't see the room, different UserId...). But the OnRoomListUpdate, isn't it supposed to trigger when local player join a lobby, even if there is no room ? I set a debug log in this OnRoomListUpdate and It never shows up!
UP:
Anyway, i set a refresh button calling:OpGetGameList
and it returns me false !! You have an idea ? I'm currently digging...
UP2: Ok i didnt set a sqlLobbyFilter, just "" because i don't need to filter the rooms but i wanted to try this as this works in the cockpit demo and can't figure out how to make trigger this OnRoomListUpdate just with default lobby... So the opGetGameList returns now true but still no event triggered
UP3: Well sorry for this third up x) I found that i get the game list in the response. But when OnRoomListUpdate is used then ?! oO And has it to be a sql lobby type to get this game list ? I just want to fetch rooms list from default lobby0 -
Hi @antigode,
Did you make sure both players are on the same region (same servers), same AppId, same AppVersion (PUN version and GameVersion), same lobby (type + name)?
Also, did you wait until the player is joined to the lobby and the callbackIMatchmakingCallbacks.OnJoinedLobby
is triggered?
Did the room finish creation successfully and is visible to the lobby?I set a debug log in this OnRoomListUpdate and It never shows up!Could you share the code? maybe you forgot to register the class implementing the callbacks if you are not extendingMonoBehaviourPunCallbacks
or if you do, you forgot to callbase.OnEnable
when overridingOnEnable
or implementing a new replacedOnEnable
which hides the base one.1 -
I'm not using PUN, just realtime SDK. The issue was that i didn't set the AddCallbackTarget.
Now it's working, just when a room close, the roomListUpdate is triggered but still the room closed in it (ttl = 0). Is it triggered before the change ?0 -
Hum, ok it has to be roomoption.RemovedFromList ?! Thanks for the help0
-
Hi, I'm struggling with the same thing. When you say "The issue was that i didn't set the AddCallbackTarget" do you mean the LobbyCallbacksContainer?
If so... Isn't that marked internal?
The only callback containers I see that are public (and thus usable) are ConnectionCallbacksContainer and MatchMakingCallbacksContainer.0 -
Hi @Rasc,
Thank you for choosing Photon!
Read about callbacks in PUN 2 here or in Photon Realtime's C# SDKs here.LobbyCallbacksContainer
,ConnectionCallbacksContainer
andMatchMakingCallbacksContainer
are internal Photon Realtime classes.
There is no need to modify those, in fact, we do not recommend that.
If there is a bug of something that needs to change in PUN's code just let us know.0