unity3d - Check if a player is still online or gone offline by power-off or Gameroom exit -


i have player playing game in facebook gameroom. in database there flag telling me player logged in facebook can tell online. in unity have script implementing monobehaviour.onapplicationquit() flag player offline , monobehaviour.onapplicationfocus(bool) flag player nofocus or afk.

  1. case 1: let's electricity problem shuts down player's pc. how can flag player offline? there anyway detect player shut down?
  2. case 2: player closes gameroom window. there anyway detect action? onapplicationquit() didn't work on this.

the standard way handle set timeout lastseen datetime stamp. game should refresh time stamp regularly (such on timed interval, or on event such sending chat message or accomplishing something)...

then set job on database (such agent job in mssql server) pull records logged in timestamp has expired. job changed loggedin flag user logged out. also, job's agent program runs in background on 1 of servers handles this... but, basic method handle situations asked about.

good luck , hope helps!!


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -