Mercurial > hg > rlgwebd
diff rlgterm.js @ 109:67b393f10c2b
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.
author | John "Elwin" Edwards <elwin@sdf.org> |
---|---|
date | Sun, 15 Jul 2012 20:30:33 -0700 |
parents | 86a458080e80 |
children | f56fdfeed01a |
line wrap: on
line diff
--- a/rlgterm.js Sun Jul 15 18:18:53 2012 -0700 +++ b/rlgterm.js Sun Jul 15 20:30:33 2012 -0700 @@ -417,6 +417,10 @@ 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 @@ 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.");