comparison rlgterm.js @ 91:e07f98799120

RLG-Web: improve game-starting messages. Include the name of the player and game when watching or playing.
author John "Elwin" Edwards <elwin@sdf.org>
date Tue, 10 Jul 2012 16:32:49 -0700
parents 6c6a6e4f1e5b
children a4d3ecf188b7
comparison
equal deleted inserted replaced
90:6c6a6e4f1e5b 91:e07f98799120
623 session.id = reply.id; 623 session.id = reply.id;
624 session.playing = true; 624 session.playing = true;
625 termemu.resize(reply.h, reply.w); 625 termemu.resize(reply.h, reply.w);
626 setTitle("Playing as " + session.lname); 626 setTitle("Playing as " + session.lname);
627 debug(1, "Playing with id " + session.id); 627 debug(1, "Playing with id " + session.id);
628 message("Your game has started."); 628 message("You are now playing " + game.name + ".");
629 setmode("play"); 629 setmode("play");
630 getData(); 630 getData();
631 } 631 }
632 else if (reply.t == 'E') { 632 else if (reply.t == 'E') {
633 debug(1, "Could not start game: " + reply.s); 633 debug(1, "Could not start game: " + reply.s);
659 termemu.resize(reply.h, reply.w); 659 termemu.resize(reply.h, reply.w);
660 termemu.reset(); 660 termemu.reset();
661 termemu.toAltBuf(); 661 termemu.toAltBuf();
662 setTitle("Watching"); 662 setTitle("Watching");
663 debug(1, "Watching with id " + session.id); 663 debug(1, "Watching with id " + session.id);
664 message("You are now watching."); 664 var pname = reply.p;
665 var gname = games[reply.g].name;
666 message("You are now watching " + pname + " play " + gname + ".");
665 setmode("watch"); 667 setmode("watch");
666 getData(); 668 getData();
667 } 669 }
668 else if (reply.t == 'E') { 670 else if (reply.t == 'E') {
669 debug(1, "Could not watch game " + gamenumber + ": " + reply.s); 671 debug(1, "Could not watch game " + gamenumber + ": " + reply.s);