List of All players (even not in room)

Is there a way for me to get a list of ALL players, even when I'm not in a room yet? And other players not in rooms?

I want people to be able to pick their own name, but also not collide with someone else's name.

Thanks!

-Carmine

P.S. Does "OtherPlayers" mean "other players in my current room"

Comments

  • There is no world outside the rooms simply put.
    Sure there is the lobby but all it can do and will do is list the available rooms on the various game servers for you (players don't exist in a single game server but multiple to many many depending on how your rooms and app is distributed in the cloud - thats outside your control)

    Trying to do the same with player names would kill the scaleability.

    If you need to list all players you will have to implement a webservice to which every connecting and disconnecting player reports this fact through WWW and where you can query for the player.
  • dreamora wrote:
    There is no world outside the rooms simply put.
    Sure there is the lobby but all it can do and will do is list the available rooms on the various game servers for you (players don't exist in a single game server but multiple to many many depending on how your rooms and app is distributed in the cloud - thats outside your control)

    Trying to do the same with player names would kill the scaleability.

    If you need to list all players you will have to implement a webservice to which every connecting and disconnecting player reports this fact through WWW and where you can query for the player.

    Does the system allow 2 people with the same name to enter a room?
  • Yes, the same name is no problem. It's optional, too.
  • Tobias wrote:
    Yes, the same name is no problem. It's optional, too.

    Hey Tobias,
    Is there a simple way for me to stop that... like a parameter in the Join function or room create, etc.?

    -Carmine
  • No, there is no concept of accounts (the base to have any kind of uniqueness) or even persistence in Photon.

    You would need to integrate account support so either host an own Photon LoadBalancing backend you modified or handle the whole account aspect through a webservice and communicate to it through WWW.
    That is if you want them unique in your whole game.

    If its just within the room itself, then you can have the master client check the joining players name and disconnect it from the room again if the name is already taken (or call an RPC to notify him for the reason of disconnect and let him disconnect itself).
    But I would definitely NOT do this option of dropping them, as it would be your failure that the situation of 2 equal names even arised and they would correspondingly voice their frustration.
    If you want to handle it purely on PUN, then add the currently connected player names to the room properties that are exposed to the lobby and simply don't offer rooms for joining where equal names would be present.
  • dreamora wrote:
    If you want to handle it purely on PUN, then add the currently connected player names to the room properties that are exposed to the lobby and simply don't offer rooms for joining where equal names would be present.

    I think this is the best solution... I could list the players in a small font maybe and then it'll be more obvious when that player hits join and nothing happens... I got an idea. Thanks for the inspiration.

    Our game is here by the way if you're curious:
    http://www.red7games.com
Sign In or Register to comment.