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

@ -417,6 +417,10 @@ function setup() {
else
break;
}
if (!WebSocket) {
message("Your browser does not support WebSockets. You can still play, " +
"but it will be slower, and may not work in the future.", "warn");
}
return;
}
@ -692,8 +696,14 @@ function startgame(game) {
message("The server forgot about you, please log in again.", "warn");
}
else if (reply.c == 4) {
message("You can't play that game because it is currently being " +
"played over SSH.", "warn");
if (reply.s == "dgamelaunch") {
message("You are already playing " + game.name + " over SSH.",
"warn");
}
else {
message("You are already playing " + game.name +
" in another browser window.", "warn");
}
}
else if (reply.c == 7) {
message("The game is being saved, try again in a few seconds.");