Unity Full Player List

Options
hanibal532
edited October 2014 in Any Topic & Chat
Hi, i am making unity game with photon cloud. I created login/register system in php, MySQL with www form. I want to disable login, if user is already logged in. I would do this, by checking all players connected to photon server, not only all players in one room, but in every room and out of any room. How could i do that? Any other recommendations, suggestions, any other way to do this? Please help me with this.
Thank you!

Comments

  • Tobias
    Options
    We don't really support preventing login due to being logged in already.
    Photon does not have proper user-sessions. We don't do a callback anywhere when a user's connection is gone.
    It also is a problem for users: You forget to sign out somewhere and can't play due to that?

    If you need to do this, do some web service and let users have a session there. Use WWW and keep the session alive with some call every minute or so. When you do custom authentication in Photon you can check a user's session and reject the authentication/login.
  • Thanks for the reply!
    I don't want people to login to same account as a group of people could create the same account and play on it at the same time, they would level fast, gain xp and gold fast.

    And this thing with session is really genius! thank you ill probably do something like this.
  • Tobias
    Options
    You could also store the IP of the client or some client based ID. Then you can allow re-login and re-connect from that client.
    Custom Authentication in Photon allows you to include your own values. So you are not limited to id/password.
  • Yeah, but if i save ip i could make that every computer has it own account and don't need to be registered, that would not allow to play on same account on other networks. I don't want that.
  • Tobias
    Options
    You can store it temporarily. If you logged in from one IP, you only allow another login from that IP in the next 5 minutes.
    You can also generate a GUID and store it locally in the client. Only if a user sends this GUID, the user can re-connect. After 5 minutes, the user can login from any machine again.