What to use to identify a player in a room?

Options
Hello There,

It seems that player number is not the same on every client, like player1 might be numbered as 1 on one client and 2 on another one, please correct me if I'm wrong about this?

If yes, is there any other unique identifier which I can use to identify a player (within players in the same room, not within the whole players connected) ?

Thanks,

Özden

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Hi @Ozden79,

    The actor number (Actor/Player Nr/ID) should be the same for the same player on all clients.
    You can also make use of the UserID which should be unique per player.
  • Ozden79
    Options
    Hi There,

    Could you please tell me the class name and method to get the actor number (iOS C++ SDK)? I used Player class getNumber method but as I said, it seems the numbers vary on different clients. I couldn't find anything about UserID as well (property or method).

    Thanks..
  • Kaiserludi
    Kaiserludi admin
    edited January 2016
    Options
    Hi @Ozden79.

    Player::getNumber() is the correct function() for that purpose.
    You can get the userID through Client::getUserID() and you can set it through the Authentication values that you pass in on connect.

    Please be aware that player numbers are only unique per game room, not per app, so if a player switches rooms his player number may change.