I've developed a mulitplayer app with a php backend. Everything works fine except that I can't figure out how to handle sudden disconnection of any one client in a netgroup. The flash clients themselves handle disconnections just fine. I get NetConnection.Connect.Disconnected event. But how do I remove the name of the disconnected user from the Database? The user himself can't do anything about sudden disconnections. Are there any efficient methods in handling disconnections when using PHP as the ID exchange service and application backend?
You may try to send a short "keep-alive" ping every, say, 30 seconds, from every peer to php. A peer that hasn't announced itself as "alive" in the last minute is most probably disconnected and can be removed from DB.
Yes the solution is simple. I used a polling method where the client sends a 'renewal' msg every 15 secs. On invoking of that script it performs some DB clean up by checking the timestamp of all users. Hence if someone's timestamp is older than 45 seconds for example that user is deleted from the DB