Gap Between Room.PlayerCount and ActorList.Length

Options
Hi,

We've encountered a bug about a topic similar to one already asked ( https://forum.photonengine.com/discussion/11286/nuance-between-playerlist-length-amp-room-playercount ), but the answer didn't match our experience and we didn't find anything else related.

Brief recap: after a Room creation, we have a PlayerCount of 2 in a room containing only 1 player, and are desperately searching why (thus: what is exactly the origin of PlayerCount)

In details: server-side, whenever we receive a GamePlugin.OnCreateGame (inheritor of BaseVRIPlugin), our GamePlugin makes a AddPlayer call for the one who asked for its creation, with actorID 1.
This works seemingly well, but we noticed a strange gap:
- The player added to the room receives a CreateGame OperationResponse, with an ActorList containing only himself (Length 1), which is fine
- Other players' GameListUpdate event, containing the new room, have its PlayerCount already with a value of 2 (which appears wrong to us)

Our server-side logs don't show any duplicate events, or interference or anything like that.

We have this bug on all our rooms' creations, but it's especially damaging since one of our game mode is a "duel" one, with rooms of 2 players : when the 2nd player tries to join, it systematically receives a GameFull error (32765) because of this.

We are using PUN 2.13 (not the latest one, but we didn't see any changelog related to this issue on more recent versions) and Unity 2018.3.14

Thanks for reading, and thanks in advance for any help or hint!

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Hi @Arthur_VR,

    Thank you for choosing Photon!

    our GamePlugin makes a AddPlayer call for the one who asked for its creation, with actorID 1.
    How do you do this exactly? I think we do not support manually and explicitly adding players to the room either locally on the client or via plugin?

    I think we rely on the Join event that is sent after the Create or Join operation response.
    You could optionally suppress Join or Leave events and replace with your own logic but I doubt that it will help here.