【PUN2】 Can not ReconnectAndRejoin()
Options
I am making a network game for Android using Photon. I would like to be able to reconnect to a room when I force close the app during a game and start it again. To do this, I wrote this simple code first.
Why can't I reconnect? To quit the app, press the button to the left of the home button on Android and swipe up on the app.
void Start() { PhotonNetwork.ReconnectAndRejoin() }Also, when creating a room, I set the "RoomOption" to determine how long the player's data will be stored on the server.
public void CreateRoomWity() { PhotonNetwork.CreateRoom( null, new RoomOptions() { MaxPlayers = (byte)RoomPlayerCapacity, PlayerTtl = 90000, EmptyRoomTtl = 90000, } ); }However, I get the following error and cannot reconnect. 「ReconnectAndRejoin() failed. it seems the client wasn't connected to a game server befor (no address)」
Why can't I reconnect? To quit the app, press the button to the left of the home button on Android and swipe up on the app.
0
Best Answer
-
The reason for this was that although we had prepared a variable with room options, we had not included those options in the CreateRoom argument.
After assigning the options to the arguments, I was able to Reconnect without any problems.0
Answers
-
The reason for this was that although we had prepared a variable with room options, we had not included those options in the CreateRoom argument.
After assigning the options to the arguments, I was able to Reconnect without any problems.0 -
Thanks for the update!0