From 2f37cf2d94c870be14627871520f5618e6e03573 Mon Sep 17 00:00:00 2001 From: "John \"Elwin\" Edwards" Date: Mon, 16 Jul 2012 10:09:57 -0700 Subject: [PATCH] RLG-Web server: update timestamps for WebSocket games. The login timestamps will now be refreshed when games are started via WebSockets or stopped. --- rlgwebd.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rlgwebd.js b/rlgwebd.js index 968aeb6..64fffd0 100755 --- a/rlgwebd.js +++ b/rlgwebd.js @@ -460,6 +460,7 @@ function wsStart(wsReq) { wsReq.reject(404, errorcodes[1]); return; } + logins[lkey].ts = new Date(); var pname = logins[lkey].name; var dims = [wsReq.resourceURL.query.h, wsReq.resourceURL.query.w]; function progcallback(err, fname) { @@ -902,6 +903,8 @@ function stopgame(res, formdata) { sendError(res, 1); return; } + /* Update timestamp, because this is an authenticated action. */ + logins[formdata["key"]].ts = new Date(); var pname = logins[formdata["key"]].name; if (!("g" in formdata) || !(formdata["g"] in games)) { sendError(res, 2, "No such game.");