How to Get the list of current Rooms in photon 2 ?
In photon 2 PhotonNetwork.GetRoomList() is not available instead GeCustomRoomList() is Available so how to we use it?
0
Answers
-
Hi may i ask? where did you use the function?0
-
inside OnReceivedRoomListUpdate ?0
-
Yes bcoz onReceivedRoomList is getting called Everytime someone enters or exit from room with no information weather it is called in response to someone entered or leaved the room bcoz I am displaying rooms in a UI so it is important to know if someone leaved or entered to update the UI.0
-
Hi @SaadAli2019,
Thank you for choosing Photon!
GetRoomList() != GeCustomRoomList()
GeCustomRoomList() is available in PUN1.
Read about GeCustomRoomList.
To replace GetRoomList in PUN2, you can find help from various discussions on the forum:
https://forum.photonengine.com/discussion/13546/get-the-list-of-available-rooms
https://forum.photonengine.com/discussion/13424/how-to-get-available-room-list-in-pun2-v2
https://forum.photonengine.com/discussion/12999/photonnetwork-getroomlist-disappeared-pun-2
https://forum.photonengine.com/discussion/12725/getting-room-list-in-pun-2
https://forum.photonengine.com/discussion/12668/photonnetwork-getroomlist-gone-in-pun2-how-can-i-modify-this-to-work-again0 -
onReceivedRoomList is getting called Everytime someone enters or exit from room with no information weather it is called in response to someone entered or leaved the room ?0
-
Hi @SaadAli2019,
I can't find a method namedonReceivedRoomList
in PUN2.
PUN2 callbackILobbyCallbacks.OnRoomListUpdate
is triggered only when joined to a lobby.1 -
sorry it was typo .. you are right the method is OnRoomListUpdate(List roomList) this method gets called every time someone join or leave the room with no information wheather the received romlist contains the list of removed rooms or new room created...
lets say i have 5 rooms and i am displaying them in a UI by name and then ILobbyCallbacks.OnRoomListUpdate() gets called becoz someone either created or removed the room so how do i update the room list UI bcoz i dont know if the roomlist i received is newly created room or removed room0 -
Searching the forum will help you.
For example, this discussion has an implementation.
PUN2's CockPit demo has this implemented.0