Problem Creating Room
Options
hi
i am using PUN2
when i create a room its automaticly joined the room
how can i prevent that and just wait for OnCreatedRoom to use for creating another room ...
with this problem i used PhotonNetwork.LeaveRoom() to go to next step for creating the next room . but i am lossing all created room .and i dont think that this method is right !!!!! .
Any help Please .
i am using PUN2
when i create a room its automaticly joined the room
how can i prevent that and just wait for OnCreatedRoom to use for creating another room ...
with this problem i used PhotonNetwork.LeaveRoom() to go to next step for creating the next room . but i am lossing all created room .and i dont think that this method is right !!!!! .
Any help Please .
0
Comments
-
Hi @Tamim_Zoabi,
All the answers you are looking for are in this post.
You need to understand how Photon works and do things the way are supposed to be done using Photon and not force a use case that is not compatible with Photon.when i create a room its automaticly joined the roomYou can't.
how can i prevent that
Why do you need to create multiple rooms at once?
Maybe you do not have to do that.0 -
let say if i need to create multiple rooms how can i ?0
-
in my code i created 3 rooms and got in the code here :
foreach (RoomInfo rm in roomList) { Debug.Log("Rooms Count is: " + roomList.Count); Debug.Log("Room Name is: " + rm.Name); myroom = rm.Name; if (rm.Name == "My_Room_A") PhotonNetwork.JoinRoom(rm.Name);
so it doesn't joined the room cause didn't find that room .. but it was already found in the roomlist.
then i tried to remark the last line "if(rm.Name....." and try to join the room By button click .. also didn't find the room !!!!!!!!!!!0 -
let say if i need to create multiple rooms how can i ?Why do you want to create multiple rooms? we do not recommend this but if you MUST, use JoinOrCreateRoom, to increase the lifetime of empty rooms to the maximum set EmptyRoomTTL to 300000 and PlayerTTL to -1 (or a value > 0, like EmptyRoomTTL=300000 or int.MaxValue).so it doesn't joined the room cause didn't find that room .. but it was already found in the roomlist.If you already know the room name use
JoinRoom
orJoinOrCreateRoom
! Rooms listing is useless and not recommended for most cases and can make your game clients slower if you have too many of those and too many games.
On the other hand, I don't know how you get theroomList
. Besides, you may be trying to join a room just when it became full or got removed, the rooms list update did not arrive to the client before he sends the join request.0