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:
(32746) for join requests. Indicates the list of ActiveActors already contains an actor with the requested ActorNr or UserId.
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() ?

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
  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Hi @DuckOfDoom,

    While we are looking at your report you can take a look at the other discussion here.
  • @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?
  • JohnTube
    JohnTube ✭✭✭✭✭
    edited September 2017
    Options
    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)?
    1. ReconnectAndRejoin
    2. Join
    3. Rejoin
  • DuckOfDoom
    edited September 2017
    Options
    Hi, @JohnTube,

    I'm using Photon Cloud.

    After timeout-disconnect and connecting back to lobby (OnJoinedLobby() is called) I call PhotonNetwork.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.
  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    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.
  • @JohnTube Thanks, I'll try ReconnectAndRejoin.

    User ID per player is 100% unique because players can correctly rejoin in other cases.