RLG-Web server: update timestamps for WebSocket games.
The login timestamps will now be refreshed when games are started via WebSockets or stopped.
This commit is contained in:
parent
f7f56fedae
commit
2f37cf2d94
1 changed files with 3 additions and 0 deletions
|
|
@ -460,6 +460,7 @@ function wsStart(wsReq) {
|
||||||
wsReq.reject(404, errorcodes[1]);
|
wsReq.reject(404, errorcodes[1]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
logins[lkey].ts = new Date();
|
||||||
var pname = logins[lkey].name;
|
var pname = logins[lkey].name;
|
||||||
var dims = [wsReq.resourceURL.query.h, wsReq.resourceURL.query.w];
|
var dims = [wsReq.resourceURL.query.h, wsReq.resourceURL.query.w];
|
||||||
function progcallback(err, fname) {
|
function progcallback(err, fname) {
|
||||||
|
|
@ -902,6 +903,8 @@ function stopgame(res, formdata) {
|
||||||
sendError(res, 1);
|
sendError(res, 1);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
/* Update timestamp, because this is an authenticated action. */
|
||||||
|
logins[formdata["key"]].ts = new Date();
|
||||||
var pname = logins[formdata["key"]].name;
|
var pname = logins[formdata["key"]].name;
|
||||||
if (!("g" in formdata) || !(formdata["g"] in games)) {
|
if (!("g" in formdata) || !(formdata["g"] in games)) {
|
||||||
sendError(res, 2, "No such game.");
|
sendError(res, 2, "No such game.");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue