changeset 162:5a7e7ec136c8

Properly print session tags in the log. They are Strings and should not be formatted with %d.
author John "Elwin" Edwards
date Sat, 03 Jan 2015 20:07:42 -0500
parents a2a25b7631f1
children 0f6da35b27a0
files rlgwebd.js
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/rlgwebd.js	Sat Jan 03 20:03:49 2015 -0500
+++ b/rlgwebd.js	Sat Jan 03 20:07:42 2015 -0500
@@ -161,7 +161,7 @@
       this.framebuf.copy(nbuf, 0, 0, this.frameoff);
       this.framebuf = nbuf;
       if (this.framebuf.length > 65536) {
-        tslog("Warning: Game %d frame buffer at %d bytes", this.tag(), 
+        tslog("Warning: Game %s frame buffer at %d bytes", this.tag(), 
                 this.framebuf.length);
       }
     }
@@ -207,7 +207,7 @@
     session.removeListener('data', dataH);
     session.removeListener('exit', exitH);
     if (session.tag() in sessions)
-      tslog("A WebSocket watcher has left game %d", session.tag());
+      tslog("A WebSocket watcher has left game %s", session.tag());
   });
   conn.sendUTF(JSON.stringify({
             "t": "w", "w": session.w, "h": session.h, 
@@ -936,7 +936,7 @@
     var tsession = sessions[watchmatch[1]];
     var conn = wsRequest.accept(null, wsRequest.origin);
     new wsWatcher(conn, tsession);
-    tslog("Game %d is being watched via WebSockets", tsession.tag());
+    tslog("Game %s is being watched via WebSockets", tsession.tag());
   }
   else if (playmatch !== null) {
     wsStart(wsRequest);