diff rlgwebd.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 d644e7d46852
children 597e9477b8ae
line wrap: on
line diff
--- a/rlgwebd.js	Tue Jul 10 13:53:38 2012 -0700
+++ b/rlgwebd.js	Tue Jul 10 16:32:49 2012 -0700
@@ -621,7 +621,7 @@
       if (success) {
         res.writeHead(200, {'Content-Type': 'application/json'});
         var reply = {"t": "s", "id": nclient.id, "w": nclient.w, "h": 
-                     nclient.h};
+                     nclient.h, "p": username, "g": gname};
         res.write(JSON.stringify(reply));
         res.end();
       }
@@ -647,7 +647,8 @@
   }
   var session = sessions[gamenumber];
   var watch = new Watcher(session);
-  var reply = {"t": "w", "id": watch.id, "w": session.w, "h": session.h};
+  var reply = {"t": "w", "id": watch.id, "w": session.w, "h": session.h, 
+               "p": session.pname, "g": session.game.uname};
   res.writeHead(200, {'Content-Type': 'application/json'});
   res.write(JSON.stringify(reply));
   res.end();