# HG changeset patch # User John "Elwin" Edwards # Date 1396395815 25200 # Node ID 127f9e256d02a92230b840b76be146ad44753509 # Parent 245a2959f504f6a898c3de4dd7bf8a7d65be0fad Keep a list of dgamelaunch games and put it in the /status message. diff -r 245a2959f504 -r 127f9e256d02 rlgwebd.js --- a/rlgwebd.js Tue Apr 01 11:23:25 2014 -0700 +++ b/rlgwebd.js Tue Apr 01 16:43:35 2014 -0700 @@ -65,6 +65,7 @@ var logins = {}; var sessions = {}; var clients = {}; +var dglgames = {}; var allowlogin = true; var nextsession = 0; var gamemux = new events.EventEmitter(); @@ -957,16 +958,20 @@ var matchresult = fname.match(filere); if (!matchresult || matchresult[3]) return; - gname = matchresult[1]; - pname = matchresult[2]; + var gname = matchresult[1]; + var pname = matchresult[2]; + var tag = gname + "/" + pname; if (chunk[0] == "E") { tslog("DGL: %s is playing %s: %s", pname, gname, fname) + dglgames[tag] = fname; } else if (chunk[0] == "C") { tslog("DGL: %s started playing %s: %s", pname, gname, fname) + dglgames[tag] = fname; } else if (chunk[0] == "D") { tslog("DGL: %s finished playing %s: %s", pname, gname, fname) + delete dglgames[tag]; } else { tslog("Watcher says: %s", chunk) @@ -1054,6 +1059,10 @@ gamedesc["g"] = sessions[sessid].game.uname; statusinfo["g"].push(gamedesc); } + statusinfo["dgl"] = []; + for (var tag in dglgames) { + statusinfo["dgl"].push(tag); + } if (statusinfo.g.length == 0) { callback(statusinfo); return;