示例#1
0
 def addCapturingTeamBase(self, clientID, playerTeam, points, rate, timeLeft, invadersCnt, capturingStopped):
     baseTeam, _ = team_bases_ctrl.parseClientTeamBaseID(clientID)
     if self._getValidBaseMask() == baseTeam ^ playerTeam:
         self.__pointsToBase[clientID] = points
         self.__setRtpcGlobal(points, invadersCnt)
         return self._validatePoints()
     return False
def _getSettingItem(clientID, ownTeam, arenaTypeID):
    baseTeam, baseID = team_bases_ctrl.parseClientTeamBaseID(clientID)
    itemSettings = (0, 'green', '%s %s', '%s %s', '%s %s')
    key = baseTeam ^ ownTeam
    if isControlPointExists(arenaTypeID):
        if key in _SETTINGS_TO_CONTROL_POINT:
            itemSettings = _SETTINGS_TO_CONTROL_POINT[key]
    elif key in _SETTINGS_TO_TEAM:
        itemSettings = _SETTINGS_TO_TEAM[key]
    item = _TeamBaseSettingItem(*itemSettings)
    item.setup(arenaTypeID, baseID, baseTeam)
    return item
def getSettingItem(clientID, ownTeam, arenaTypeID):
    baseTeam, baseID = team_bases_ctrl.parseClientTeamBaseID(clientID)
    item = None
    key = baseTeam ^ ownTeam
    if isControlPointExists(arenaTypeID):
        if key in _SETTINGS_TO_CONTROL_POINT:
            item = _SETTINGS_TO_CONTROL_POINT[key]
    elif key in _SETTINGS_TO_TEAM:
        item = _SETTINGS_TO_TEAM[key]
    if item is None:
        item = _TeamBaseSettingItem(0, 'green', '%s', '%s')
    item.setup(arenaTypeID, baseID, baseTeam)
    return item