def onPlayerStateChanged(self, entity, roster, playerInfo):
     team, assigned = decodeRoster(roster)
     data = {
         'dbID': playerInfo.dbID,
         'state': playerInfo.state,
         'igrType': playerInfo.igrType,
         'icon': '',
         'vShortName': '',
         'vLevel': '',
         'vType': ''
     }
     if playerInfo.isVehicleSpecified():
         vehicle = playerInfo.getVehicle()
         data.update({
             'icon': vehicle.iconContour,
             'vShortName': vehicle.shortUserName,
             'vLevel': int2roman(vehicle.level),
             'vType': vehicle.type
         })
     self.as_setPlayerStateS(team, assigned, data)
     if playerInfo.isCurrentPlayer():
         self.as_toggleReadyBtnS(not playerInfo.isReady())
     else:
         chat = self.chat
         if chat:
             chat.as_addMessageS(
                 messages.getPlayerStateChangedMessage(
                     self.__prbName, playerInfo))
Example #2
0
 def onPlayerStateChanged(self, entity, roster, playerInfo):
     team, assigned = decodeRoster(roster)
     data = {'dbID': playerInfo.dbID,
      'state': playerInfo.state,
      'igrType': playerInfo.igrType,
      'icon': '',
      'vShortName': '',
      'vLevel': '',
      'vType': '',
      'isCurrentPayer': playerInfo.isCurrentPlayer()}
     if playerInfo.isVehicleSpecified():
         moduleName = ''
         vehicle = playerInfo.getVehicle()
         badgeVisibility = playerInfo.getEnhancementVisibility()
         if badgeVisibility:
             moduleName = MODULE_NAME_SEPARATOR.join([ self.__craftmacineConrtoller.getModuleName(module) for module in playerInfo.getEnhancementModules() ])
         data.update({'icon': vehicle.iconContour,
          'vShortName': vehicle.shortUserName,
          'vLevel': int2roman(vehicle.level),
          'vType': vehicle.type,
          'isExperimentalModule': bool(badgeVisibility),
          'experimentalModuleName': moduleName})
     self.as_setPlayerStateS(team, assigned, data)
     if playerInfo.isCurrentPlayer():
         self.as_toggleReadyBtnS(not playerInfo.isReady())
     else:
         chat = self.chat
         if chat:
             chat.as_addMessageS(messages.getPlayerStateChangedMessage(self.__prbName, playerInfo))
 def onPlayerStateChanged(self, functional, roster, playerInfo):
     team, assigned = decodeRoster(roster)
     data = {'uid': playerInfo.dbID,
      'state': playerInfo.state,
      'icon': '',
      'vShortName': '',
      'vLevel': '',
      'vType': ''}
     if playerInfo.isVehicleSpecified():
         vehicle = playerInfo.getVehicle()
         data.update({'icon': vehicle.iconContour,
          'vShortName': vehicle.shortUserName,
          'vLevel': int2roman(vehicle.level),
          'vType': vehicle.type})
     self.as_setPlayerStateS(team, assigned, data)
     if playerInfo.isCurrentPlayer():
         self.as_toggleReadyBtnS(not playerInfo.isReady())
     else:
         chat = self.chat
         if chat:
             chat.as_addMessageS(messages.getPlayerStateChangedMessage(self.__prbName, playerInfo))