How to check same IDs before entering a room? multi-client/access of the same user.

Hello, I have a question because of the multi-client/access of the same user.

I want to print out a fail message when the same UserID is connected. (From login or Room)


Is there a callback or variable to check that a player with the same id is already in the room before joining the room?

Or, like "OnCreateRoomFailed()", it would be convenient to have a call for admission failure due to duplicate id.



If there's no such thing, I'm just going to take all the room lists and check all the players' IDs. Is there a way to check the list of all rooms/id of all players in Lobby?


Thank you for your quick response and kindness. Have a great day!


(+Add) Additionally, I am logging in using Authentication Values. Is there a way to prevent duplicate logins (connect to photon) in relation to this feature?

Best Answer

  • Tobias
    Tobias admin
    Answer ✓

    What you really want is to check the userIDs when clients connect. While nicknames can be changed and entered at will, userIDs are supposed to be unique for the game and you can check them via Custom Authentication. Your own auth service can check if one userID logged in recently and deny access.

    There is no built in feature to prevent users from connecting multiples times. What you really need and want depends a bit on your own expectations.

    Nicknames won't work for this. Room lists don't provide the nicknames of players and they are incomplete anyways (if the title has over 500 rooms)...

Answers

  • You can check if the players have the same NickName

  • Tobias
    Tobias admin
    Answer ✓

    What you really want is to check the userIDs when clients connect. While nicknames can be changed and entered at will, userIDs are supposed to be unique for the game and you can check them via Custom Authentication. Your own auth service can check if one userID logged in recently and deny access.

    There is no built in feature to prevent users from connecting multiples times. What you really need and want depends a bit on your own expectations.

    Nicknames won't work for this. Room lists don't provide the nicknames of players and they are incomplete anyways (if the title has over 500 rooms)...