Mercurial > hg > rlgwebd
comparison 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 |
comparison
equal
deleted
inserted
replaced
108:86a458080e80 | 109:67b393f10c2b |
---|---|
414 else if (allscreen.scrollWidth * 2 < window.innerWidth) { | 414 else if (allscreen.scrollWidth * 2 < window.innerWidth) { |
415 csize = textsize(true); | 415 csize = textsize(true); |
416 } | 416 } |
417 else | 417 else |
418 break; | 418 break; |
419 } | |
420 if (!WebSocket) { | |
421 message("Your browser does not support WebSockets. You can still play, " + | |
422 "but it will be slower, and may not work in the future.", "warn"); | |
419 } | 423 } |
420 return; | 424 return; |
421 } | 425 } |
422 | 426 |
423 function toggleshift() { | 427 function toggleshift() { |
690 if (reply.c == 1) { | 694 if (reply.c == 1) { |
691 logout(); | 695 logout(); |
692 message("The server forgot about you, please log in again.", "warn"); | 696 message("The server forgot about you, please log in again.", "warn"); |
693 } | 697 } |
694 else if (reply.c == 4) { | 698 else if (reply.c == 4) { |
695 message("You can't play that game because it is currently being " + | 699 if (reply.s == "dgamelaunch") { |
696 "played over SSH.", "warn"); | 700 message("You are already playing " + game.name + " over SSH.", |
701 "warn"); | |
702 } | |
703 else { | |
704 message("You are already playing " + game.name + | |
705 " in another browser window.", "warn"); | |
706 } | |
697 } | 707 } |
698 else if (reply.c == 7) { | 708 else if (reply.c == 7) { |
699 message("The game is being saved, try again in a few seconds."); | 709 message("The game is being saved, try again in a few seconds."); |
700 } | 710 } |
701 else { | 711 else { |