Created
May 20, 2015 18:53
-
-
Save funkytaco/1a5d39fb80517a70b64d to your computer and use it in GitHub Desktop.
express.io
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.io.route("disconnect", function(req) { | |
req.session.disconnection = setTimeout(function() { | |
console.log("User timed out!"); | |
db.query("UPDATE player_data SET online=0 WHERE id="+mysql.escape(req.session.user)); | |
app.io.broadcast("event", {msg:req.session.username+" has logged out!"}); | |
app.io.broadcast("reloadXY"); | |
req.session.destroy(); | |
},5000); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment