photon networking joining room failed with same username with 2 players

HI,

I created room "Demo" with player (username) name as "kamal".
I am trying to join the same username " kamal ".

I am unable join the room.

I am getting below following error.
Operation failed: OperationResponse 226: ReturnCode: 32746 (Join failed: UserId 'kamal' already joined the specified game (JoinMode=0).). Parameters: {} Server: GameServer



11:11 AM

Comments

  • Hi @biyyala,

    the error message tells you, that two clients with the same UserId can't join the same room. You shouldn't set this one at all. It is handled internally. Instead of using the UserId, try using the NickName property. You can access it locally by using PhotonNetwork.player.NickName.
  • Hi @biyyala how to set like this can you please tell me to not connect same player name with same player name (I am getting below following error.

    Operation failed: OperationResponse 226: ReturnCode: 32746 (Join failed: UserId 'kamal' already joined the specified game (JoinMode=0).). Parameters: {} Server: GameServer )

  • Please refer to the Matchmaking Checklist for help on this.

    If a client wants to get back into a game (after dropping out), use RejoinRoom or better: ReconnectAndRejoin.

  • @Tobias Ya thanks but I don't want to connect with user id, For me it is now connecting to same user id with different devices.

  • I don't want to connect with same user id

  • I don't understand the situation, sorry.

  • @Tobias Ok sir, I have one game and in that logged in with some xxxx mobile number and also logged in with same xxxx number in another device, So while i start the game the same mobile number is connecting to the same mobile number. In my game it should not happen like that.

  • If you use JoinRandomRoom, it will automatically prevent users from joining the same room multiple times. So if any client's userID is already present in a fitting room, JoinRandomRoom will pick another room.

    Overall, you might want to avoid using the same userID from multiple devices. It makes a lot of cases tricky and somewhat breaks the idea of being able to identify a user (by unique userID).

  • @Tobias ok thank you for your response.

  • But How @biyyala is not able to connect with user id.