RLG-Web: improve taking over sessions.

WebSocket sessions should not be taken over, and polling sessions are
not yet convertible to WebSockets.  Eventually the current method of
taking over via Player#reset() should be replaced with autosaving the
game, which will always work.
This commit is contained in:
John "Elwin" Edwards 2012-07-15 20:30:33 -07:00
parent 3abb05683e
commit 854519a7bd
2 changed files with 16 additions and 4 deletions

View file

@ -756,7 +756,7 @@ function startgame(req, res, formdata) {
var nodematch = new RegExp("^" + username + ":node:");
if (fname && (fname.match(nodematch) === null)) {
/* It's being played in dgamelaunch. */
sendError(res, 4, null);
sendError(res, 4, "dgamelaunch");
tslog("%s is already playing %s", username, gname);
return;
}
@ -786,7 +786,9 @@ function startgame(req, res, formdata) {
return;
}
}
sendError(res, 7);
/* If there's no player, it's a WebSocket game, and shouldn't be
* seized. */
sendError(res, 4, "WebSocket");
}
else {
new Player(gname, lkey, dims, respondlaunch);