Ticket #3476: 3143_lobby_data_v2.6_lobby_bot_v3.patch

File 3143_lobby_data_v2.6_lobby_bot_v3.patch, 1.1 KB (added by Imarok, 8 years ago)

Add startTime to the lobby attributes

  • source/tools/XpartaMuPP/XpartaMuPP.py

     
    301301    if JID in self.gameList:
    302302      if self.gameList[JID]['nbp-init'] > data['nbp']:
    303303        logging.debug("change game (%s) state from %s to %s", JID, self.gameList[JID]['state'], 'waiting')
    304         self.gameList[JID]['nbp'] = data['nbp']
    305304        self.gameList[JID]['state'] = 'waiting'
    306305      else:
    307306        logging.debug("change game (%s) state from %s to %s", JID, self.gameList[JID]['state'], 'running')
    308         self.gameList[JID]['nbp'] = data['nbp']
    309307        self.gameList[JID]['state'] = 'running'
     308      self.gameList[JID]['nbp'] = data['nbp']
     309      self.gameList[JID]['players'] = data['players']
     310      if !self.gameList[JID]['startTime']
     311        self.gameList[JID]['startTime'] = time.time()
    310312
    311313## Class which manages different game reports from clients ##
    312314##   and calls leaderboard functions as appropriate.       ##