# HG changeset patch # User John "Elwin" Edwards # Date 1340207350 25200 # Node ID e3082fd06520fc281bb7d88ba39c6dcaacdaaa4f # Parent a077f9f84052296e5da4c9cbead37ebebcd4ed60 Some status improvements. Status messages now consistently use the game's uname, and the table of choices puts the games in the right order. diff -r a077f9f84052 -r e3082fd06520 rlgterm.js --- a/rlgterm.js Wed Jun 20 07:41:59 2012 -0700 +++ b/rlgterm.js Wed Jun 20 08:49:10 2012 -0700 @@ -454,7 +454,13 @@ var cell2 = document.createElement("div"); var cell3 = document.createElement("div"); cell1.appendChild(document.createTextNode(reply.g[i].p)); - cell2.appendChild(document.createTextNode(reply.g[i].g)); + var uname = reply.g[i].g; + if (uname in games) + cell2.appendChild(document.createTextNode(games[uname].name)); + else { + debug(1, "Unrecognized game: " + uname); + continue; + } var button = document.createElement("span"); button.appendChild(document.createTextNode("Watch")); button.onclick = makeWatcher(reply.g[i].n); @@ -492,8 +498,8 @@ /* Don't remove the first child, it's the header. */ while (optdiv.childNodes.length > 1) optdiv.removeChild(optdiv.childNodes[1]); - for (var gname in reply.stat) { - if (!(gname in games)) + for (var gname in games) { + if (!(gname in reply.stat)) continue; var acttext; if (reply.stat[gname] == "s") diff -r a077f9f84052 -r e3082fd06520 rlgwebd.js --- a/rlgwebd.js Wed Jun 20 07:41:59 2012 -0700 +++ b/rlgwebd.js Wed Jun 20 08:49:10 2012 -0700 @@ -806,7 +806,7 @@ var gamedesc = {}; gamedesc["n"] = sessid; gamedesc["p"] = sessions[sessid].pname; - gamedesc["g"] = sessions[sessid].game.name; + gamedesc["g"] = sessions[sessid].game.uname; reply["g"].push(gamedesc); } res.writeHead(200, { "Content-Type": "application/json" });