Ticket #3476: 3476_start_time_lobby_bot_v1.1.patch

File 3476_start_time_lobby_bot_v1.1.patch, 1.6 KB (added by elexis, 8 years ago)

Briefly tested positive

  • source/tools/XpartaMuPP/XpartaMuPP.py

    class GameList():  
    305305      else:
    306306        logging.debug("change game (%s) state from %s to %s", JID, self.gameList[JID]['state'], 'running')
    307307        self.gameList[JID]['state'] = 'running'
    308308      self.gameList[JID]['nbp'] = data['nbp']
    309309      self.gameList[JID]['players'] = data['players']
     310      if 'startTime' not in self.gameList[JID]:
     311        self.gameList[JID]['startTime'] = str(round(time.time()))
    310312
    311313## Class which manages different game reports from clients ##
    312314##   and calls leaderboard functions as appropriate.       ##
    313315class ReportManager():
    314316  def __init__(self, leaderboard):
  • source/lobby/XmppClient.cpp

    void XmppClient::GUIGetGameList(ScriptIn  
    500500{
    501501    JSContext* cx = scriptInterface.GetContext();
    502502    JSAutoRequest rq(cx);
    503503
    504504    scriptInterface.Eval("([])", ret);
    505     const char* stats[] = { "name", "ip", "port", "state", "nbp", "maxnbp", "players", "mapName", "niceMapName", "mapSize", "mapType", "victoryCondition" };
     505    const char* stats[] = { "name", "ip", "port", "state", "nbp", "maxnbp", "startTime", "players", "mapName", "niceMapName", "mapSize", "mapType", "victoryCondition" };
    506506    for(const glooxwrapper::Tag* const& t : m_GameList)
    507507    {
    508508        JS::RootedValue game(cx);
    509509        scriptInterface.Eval("({})", &game);
    510510