I have a player that is playing my game in Facebook Gameroom. In my database there is a flag telling me the player is logged in with Facebook so I can tell he is online. In Unity I have a script implementing MonoBehaviour.OnApplicationQuit() to flag the player as offline and MonoBehaviour.OnApplicationFocus(bool) to flag the player as NoFocus or AFK.
- Case 1: Let's say that electricity problem shuts down player's PC. How can I flag the player as offline? Is there anyway to detect that the player is shut down?
- Case 2: Player closes Gameroom window. Is there anyway to detect this action? OnApplicationQuit() didn't work on this.