Using same UserId to connect to Photon Chat

Hey there,

Is there any way to detect whether a second device is trying to connect with the same UserId in order to prevent this from happening?

Thanks and regards,



  • right now this is not possible
  • By any chance:
    • Do you have this in the works?
    • Is it possible to achieve this directly with Photon Realtime?
  • well, there is support for SingleConnection mode, but it works for entire cloud, not per application. in the future we are going to support this on per application basis

    >>Is it possible to achieve this directly with Photon Realtime?
    did Not really get what you mean

  • andrew_fsg
    edited December 2015

    I will checkout SingleConnection mode: any docs on this?

    As for the photon realtime question: We make use of PUN+ in Unity - I meant to ask whether it was possible to detect this using PUN+.
  • >I will checkout SingleConnection mode: any docs on this?
    you will not find this in any docs. because chat server code is not open.

    In PUN you may not do this too. but may be you may apply next trick.

    When you join chat, you may send status update with some data. if second connection exists it will get this status update and this case you may close this connection. or send update back so, that second connection will be closed

    you may use Inivisible status with message. it should work for you i think
  • Thanks @chvetsov we'll try it out :)
  • @chvetsov Implemented as suggested and it works! Thanks!

    If possible in the future, as a nice to have, it would be nice to have a way to query.

    Thanks again.
  • we are thinking about providing way to setup this using application dashboard. Our idea is that you may select whether to allow multiple connection or not
    is this suitable for your application?
  • It would be ideal to make some sort of functionality to disable or enable whether you want a user to be able to login to the same account (on more then 1 machine), however it isn't ideal for multiplayer games where you need to login to your account and use your account data. What im getting at is, if the userId != null, no one else can log in with that account.
  • got it. Thank you for your feedback
  • Please, give at least some hint on how to implement Server SDK 4.0
  • not sure what you mean