Makes running games visible in the lobby. These will be colored in red. Refs #2463, #2448.

This was SVN commit r15751.
This commit is contained in:
scythetwirler 2014-09-14 20:59:35 +00:00
parent 67c3a80c42
commit 113f72a503
2 changed files with 8 additions and 6 deletions

View File

@ -256,7 +256,13 @@ function updateGameList()
if(!filterGame(g))
{
// Highlight games 'waiting' for this player, otherwise display as green
var name = (g.state != 'waiting') ? '[color="0 125 0"]' + g.name + '[/color]' : '[color="orange"]' + g.name + '[/color]';
var name;
if (g.state == 'init')
name = '[color="0 125 0"]' + g.name + '[/color]';
else if (g.state == 'waiting')
name = '[color="255 127 0"]' + g.name + '[/color]';
else
name = '[color="255 0 0"]' + g.name + '[/color]';
list_name.push(name);
list_ip.push(g.ip);
list_mapName.push(g.niceMapName);

View File

@ -637,11 +637,7 @@ class XpartaMuPP(sleekxmpp.ClientXMPP):
## Pull games and add each to the stanza
for JIDs in games:
g = games[JIDs]
# Only send the games that are in the 'init' state and games
# that are in the 'waiting' state which the receiving player is in. TODO
# Split the rating off
if g['state'] == 'init' or (g['state'] == 'waiting' and self.nicks[str(JID)] in (formattedPlayer.split()[0] for formattedPlayer in g['players-init'])):
stz.addGame(g)
stz.addGame(g)
## Set additional IQ attributes
iq = self.Iq()