photon networking joining room failed with same username with 2 players
The whole answer can be found below.
Try Our
Documentation
Please check if you can find an answer in our extensive documentation on PUN.
Join Us
on Discord
Meet and talk to our staff and the entire Photon-Community via Discord.
Read More on
Stack Overflow
Find more information on Stack Overflow (for Circle members only).
photon networking joining room failed with same username with 2 players
biyyala
2018-07-25 05:42:56
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
[Deleted User]
2018-07-26 08:48:16
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
.
@TobiasYa 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.
@TobiasOk 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.
Back to top