Player leaving and joining room back again even after room closed
Options
Hi, I have created a random room and after 2 players joining I close the room.
What I want to do now is that when either player leaves the game and want to join back after some time they should be able to join back. Only those players should be able to join who were registered in the room before it got close.
Is there any way I can achieve this thing? Any help would be appreciated.
What I want to do now is that when either player leaves the game and want to join back after some time they should be able to join back. Only those players should be able to join who were registered in the room before it got close.
Is there any way I can achieve this thing? Any help would be appreciated.
0
Comments
-
@JohnTube Hi, I have tried using the RejoinRoom but it is not working as the player creates another room upon join failed.
I have saved the room name in a file upon leaving and tried signed in back into that room after it was mark closed but it didn't worked.
The player-ttl value is set to 15 minutes
Is there any example code or demo for this?0 -
@JohnTube I don't get errors in the log so I don't know what it is wrong but the player creates/joins the random room as I have coded in the room failed function.
What do you mean by userID? I don't have any userID, I just pass the room name that I want to rejoin in the PhotonNetwork.RejoinRoom(roomName)0 -
@JohnTuberoshaan said:
@JohnTube I don't get errors in the log so I don't know what it is wrong but the player creates/joins the random room as I have coded in the room failed function.
What do you mean by userID? I don't have any userID, I just pass the room name that I want to rejoin in the PhotonNetwork.RejoinRoom(roomName)0 -
Hi @roshaan,
What PUN version are you using?
You need to implement join room failure callback.the room failed functionMaybe this is the one or maybe you are referring to the Join Random failure callback which is different.
PUN1:
-void OnPhotonRandomJoinFailed(object[] codeAndMsg)
-void OnPhotonJoinRoomFailed(object[] codeAndMsg)
PUN2:
-void OnJoinRandomFailed(short returnCode, string message)
-void OnJoinRoomFailed(short returnCode, string message)
In order to rejoin a room, you need to keep the same UserId.
Read about how to set UserIDs here.0