How to handle error 32746 (already joined)?
Options
There are some rare cases when my users get disconnected and when they try to rejoin, PUN answers with an error code 32746.
In documentation:
However, if I assume that user joined the room after that,
What do I have to do to successfully rejoin? Call
In documentation:
(32746) for join requests. Indicates the list of ActiveActors already contains an actor with the requested ActorNr or UserId.
public const int JoinFailedFoundActiveJoiner = 32746;
public const int JoinFailedFoundActiveJoiner = 32746;
However, if I assume that user joined the room after that,
PhotonNetwork.room
is null and everything after that crashes and burns.What do I have to do to successfully rejoin? Call
JoinRoom()
? Call ReconnectAndRejoin()
? 0
Comments
-
If it helps, there is something like this in the log prior to this error:
ERROR:UnityLog: 2017-09-18 14:51:14 (s) (3623.266) : Cannot send op: 252 Not connected. PeerState: Zombie ERROR:UnityLog: 2017-09-18 14:51:14 (s) (3623.266) : Cannot send op: 252 Not connected. PeerState: Zombie ERROR:UnityLog: 2017-09-18 14:51:14 (s) (3623.266) : Cannot send op: 252 Not connected. PeerState: Zombie
0 -
Hi @DuckOfDoom,
While we are looking at your report you can take a look at the other discussion here.0 -
@JohnTube Thanks for a quick reply!
I searched the forum before posting but missed that particular post. Thanks for directions.
Unfortunately, my PlayerTTL has to be a pretty big value (5 minutes) because of design issues.
Also, is there any reliable way to reproduce this error so that I could try different variants?0 -
Hi @DuckOfDoom,
FYI: the other discussion has been updated.
Do you use Photon Cloud or do you connect to self hosted servers?
If the latter which SDK version?
What did you call to get the error code (JoinFailedFoundActiveJoiner = 32746)?-
ReconnectAndRejoin
-
Join
-
Rejoin
0 -
-
Hi, @JohnTube,
I'm using Photon Cloud.
After timeout-disconnect and connecting back to lobby (OnJoinedLobby()
is called) I callPhotonNetwork.ReJoinRoom()
with room name. Most of the times this works as intended (i.e. if player terminates the app or it just enters background. After reconnect Rejoin works like a charm), but sometimes, after "timeout-disconnect", this error happens.0 -
You should use ReconnectAndRejoin in this case as it's a good shortcut and should avoid this error.
In any case if you still get this error while you make sure you use unique UserID per player and same player is not joined to the same room elsewhere then I can't suggest anything but retry.0 -
@JohnTube Thanks, I'll try ReconnectAndRejoin.
User ID per player is 100% unique because players can correctly rejoin in other cases.0