Keeping track of log out

Options
andersonh
edited July 2012 in DotNet
Hi,

I'm having issues with keeping track when users log out. Since I do not have an explicit GUI function to log users off the server, they're considered logged off when they disconnect from the server via closing the browser.

Are there any built in Photon functions that allow me to track users who log off? I know that I have access to a list of users within the current scene/room. But is there a way to access the list from every other scene/room?

Or any other suggestions on how to keep track of user log out?

Comments

  • dreamora
    Options
    Its not possible to access other rooms from within a room and shouldn't be relevant either cause you can not communicate with them across roomborders. Only the member within the room are affected and they will get the leave event notification
  • Philip
    Options
    Hi andersonh,

    as dreamora explains you get a leave notification of a user leaving the current room only in the context of the room.
    Which actually is not really the same as "logging off" - they could simply be leaving the room to join a different room.

    For the case you describe you could implement OnDisconnect(...) in your peer - assuming for instance that you keep
    the status of a user (logged-in/logged-off) in memcache you could trigger the status change in this method.

    In case you want to maintain an in-mem list just be aware that it has to be thread safe.
  • Thanks, that was along the lines of what I came to realize I had to do in order to handle my issue.

    I'm just not sure how photon handles threading, is there any documentation for how threading is handled from photon?
  • dreamora
    Options
    You don't need threading and shouldn't use it as it will not scale nearly as well.

    Photon uses its own mechanism to handle parallelism and scaleability which works independent of threads (bases on Retlang), the fibers.
    Every room and every user has an own fiber and they can be executed in parallel or sequential but it shouldn't matter to you cause each of them only operates on the own data, communication to the other fibers is done through event queuing