Mercurial > hg > rlgwebd
diff rlgwebd.js @ 113:43340faa061c
RLG-Web server: update timestamps for WebSocket games.
The login timestamps will now be refreshed when games are started via
WebSockets or stopped.
author | John "Elwin" Edwards <elwin@sdf.org> |
---|---|
date | Mon, 16 Jul 2012 10:09:57 -0700 |
parents | 4f2b89e6fde2 |
children | 54979d35611a |
line wrap: on
line diff
--- a/rlgwebd.js Mon Jul 16 08:23:51 2012 -0700 +++ b/rlgwebd.js Mon Jul 16 10:09:57 2012 -0700 @@ -460,6 +460,7 @@ 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 @@ 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.");