Mercurial > hg > rlgwebd
comparison rlgwebd.js @ 64:e3082fd06520
Some status improvements.
Status messages now consistently use the game's uname, and the table
of choices puts the games in the right order.
author | John "Elwin" Edwards <elwin@sdf.org> |
---|---|
date | Wed, 20 Jun 2012 08:49:10 -0700 |
parents | 7793ad53b90f |
children | 57bf0dcd080e |
comparison
equal
deleted
inserted
replaced
63:a077f9f84052 | 64:e3082fd06520 |
---|---|
804 var reply = {"s": allowlogin, "g": []}; | 804 var reply = {"s": allowlogin, "g": []}; |
805 for (var sessid in sessions) { | 805 for (var sessid in sessions) { |
806 var gamedesc = {}; | 806 var gamedesc = {}; |
807 gamedesc["n"] = sessid; | 807 gamedesc["n"] = sessid; |
808 gamedesc["p"] = sessions[sessid].pname; | 808 gamedesc["p"] = sessions[sessid].pname; |
809 gamedesc["g"] = sessions[sessid].game.name; | 809 gamedesc["g"] = sessions[sessid].game.uname; |
810 reply["g"].push(gamedesc); | 810 reply["g"].push(gamedesc); |
811 } | 811 } |
812 res.writeHead(200, { "Content-Type": "application/json" }); | 812 res.writeHead(200, { "Content-Type": "application/json" }); |
813 if (req.method != 'HEAD') | 813 if (req.method != 'HEAD') |
814 res.write(JSON.stringify(reply)); | 814 res.write(JSON.stringify(reply)); |