Strange PhotonID

Hi, we are using PUN for our multiplayer game and made own backend to keep current game state in DB. It is working very nicely like 99% of the times but sometimes we get some strange PhotonID that does not make sense and I wonder how this is possible. This is creating game issues and I want to know how this ID that we get like 10 and 11, why and how?

The we have 4 players and first player is host and when all 4 players are seated and ready Photon PUN is initialized and client get PhotonID and simply send it to Room data in DB. (see image)
https://drive.google.com/file/d/1PJJN50gNhOvmMPwVixXToQC3aEIgQUPn/view?usp=sharing

Any suggestions?

/Tommy

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    edited February 2018
    Hi @Endeavour,

    Why do you have a UserId and a PhotonID? Why not use the same value in both?
    The PhotonID is the Photon player's UserId, right? When and how do you set that in your DB?

    I think it's either:

    a. you are setting those values explicitly from the client.
    b. there is something wrong with your backend logic.
  • Endeavour
    Endeavour
    edited February 2018
    So, let me explain:
    We are using first player to join table as Host, or actually the person creating a game is the host meaning
    UserID is the Player ID (hosts ID)
    PhotonID we get when connection to Photon which normally looks like: 5a7432f519bf00
    This is where we have some problems with PhotonID showing: 11

    Name and hostname is the same and just name of the player.
    Join member count is how many members connected to this table (4 is full table)




  • To be honest I think I screwed up when I made it as it is first game and new to all this thing.. Anyway so we now create a Room and you can invite, open public or password protect a slot. (Total 4 slots, always 4 players).

    So we create a room and first when all 4 players are seated and ready we create Photon connection. That is why we have own ID and not using PhotonID, we simply do not have PhotonID until all 4 players are connected and ready, then we get that one.

    I would think about making new structure and first players who connects gets the PhotonID as ID for game like you say and the others connect to that ID. Much better, but now the whole game is based on this... hmmmm