changeset 84:d59dc5cef412

rlgwebd.js: set the width and height on Player objects. Fixes the client not being informed of the pty size.
author John "Elwin" Edwards <elwin@sdf.org>
date Sun, 08 Jul 2012 08:40:08 -0700
parents e04c8bf6d4da
children 4303d94d87a2
files rlgwebd.js
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/rlgwebd.js	Sun Jul 08 08:10:55 2012 -0700
+++ b/rlgwebd.js	Sun Jul 08 08:40:08 2012 -0700
@@ -112,7 +112,7 @@
   childenv["PTYHELPER"] = String(this.h) + "x" + String(this.w);
   args = [this.game.path, "-n", this.pname];
   this.child = child_process.spawn("/bin/ptyhelper", args, {"env": childenv});
-  this.emit('open', true);
+  this.emit('open', true, this.sessid);
   /* Set up the lockfile and ttyrec */
   var ts = timestamp();
   var progressdir = "/dgldir/inprogress-" + this.game.uname;
@@ -311,9 +311,12 @@
     if (this.alive)
       this.session.close();
   };
-  function openH(success) {
+  function openH(success, id) {
     if (success) {
       ss.alive = true;
+      ss.session = sessions[id];
+      ss.h = sessions[id].h;
+      ss.w = sessions[id].w;
     }
     callback(ss, success);
   }