RLG-Web: Complete the WebSocket watcher.

Watching via WebSockets now takes into account terminal size, player
name, etc.
This commit is contained in:
John "Elwin" Edwards 2012-07-13 08:39:39 -07:00
parent aee00a29d5
commit f4c4f5e0f1
2 changed files with 13 additions and 2 deletions

View file

@ -390,6 +390,10 @@ function wsWatcher(conn, session) {
session.removeListener('exit', exitH);
tslog("A WebSocket watcher has left game %d", session.sessid);
});
conn.sendUTF(JSON.stringify({
"t": "w", "w": session.w, "h": session.h,
"p": session.pname, "g": session.game.uname
}));
conn.sendUTF(JSON.stringify({"t": "d",
"d": session.framebuf.toString("hex", 0, session.frameoff)}));
}