Beispiel #1
0
    def getController(player):

        #battle type checks
        battleType = player.arena.guiType
        controller = None
        battleTypeName = ''
        if battleType == constants.ARENA_GUI_TYPE.RANDOM:
            battleTypeName = 'Random'
            if SpotMessanger.myConf['TryPlatoonMes']:
                if IngameMessanger().hasSquadChannelController():
                    controller = IngameMessanger().getSquadChannelController()
                elif SpotMessanger.myConf['Avoid' + battleTypeName + 'Mes']:
                    return None
                else:
                    controller = IngameMessanger().getTeamChannelController()
            elif SpotMessanger.myConf['Avoid' + battleTypeName + 'Mes']:
                return None
            else:
                controller = IngameMessanger().getTeamChannelController()
        elif battleType == constants.ARENA_GUI_TYPE.TRAINING:
            battleTypeName = 'Training'
            if SpotMessanger.myConf['Avoid' + battleTypeName + 'Mes']:
                return None
            controller = IngameMessanger().getTeamChannelController()
        elif battleType == constants.ARENA_GUI_TYPE.COMPANY:
            battleTypeName = 'Company'
            if SpotMessanger.myConf['Avoid' + battleTypeName + 'Mes']:
                return None
            controller = IngameMessanger().getTeamChannelController()
        elif battleType == constants.ARENA_GUI_TYPE.CYBERSPORT:
            battleTypeName = 'CyberSport'
            if SpotMessanger.myConf['Avoid' + battleTypeName + 'Mes']:
                return None
            controller = IngameMessanger().getTeamChannelController()
        elif battleType == constants.ARENA_GUI_TYPE.HISTORICAL:
            battleTypeName = 'Historical'
            if SpotMessanger.myConf['Avoid' + battleTypeName + 'Mes']:
                return None
            controller = IngameMessanger().getTeamChannelController()
        elif battleType == constants.ARENA_GUI_TYPE.SORTIE:
            battleTypeName = 'Fortifications'
            if SpotMessanger.myConf['Avoid' + battleTypeName + 'Mes']:
                return None
            controller = IngameMessanger().getTeamChannelController()
        else:
            battleTypeName = 'ClanWar'
            if not SpotMessanger.myConf['Avoid' + battleTypeName + 'Mes']:
                controller = IngameMessanger().getTeamChannelController()
            else:
                return None

        #vehicle type checks
        vehicleType = BattleUtils.getVehicleType(
            BattleUtils.getCurrentVehicleDesc(player))
        if vehicleType == VEHICLE_CLASS_NAME.SPG and not SpotMessanger.myConf[
                'OnSPG']:
            return None
        elif vehicleType == VEHICLE_CLASS_NAME.LIGHT_TANK and not SpotMessanger.myConf[
                'OnLT']:
            return None
        elif vehicleType == VEHICLE_CLASS_NAME.MEDIUM_TANK and not SpotMessanger.myConf[
                'OnMD']:
            return None
        elif vehicleType == VEHICLE_CLASS_NAME.HEAVY_TANK and not SpotMessanger.myConf[
                'OnHT']:
            return None
        elif vehicleType == VEHICLE_CLASS_NAME.AT_SPG and not SpotMessanger.myConf[
                'OnTD']:
            return None

        #team amount checks
        maxTeamAmount = SpotMessanger.myConf['MaxTeamAmountOn' +
                                             battleTypeName]
        if maxTeamAmount > 0:
            if maxTeamAmount < BattleUtils.getTeamAmount(player):
                return None
        return controller
Beispiel #2
0
 def myCallHelp(controller):
     if controller and SpotMessanger.myConf['CallHelp']:
         IngameMessanger().callHelp(controller)
Beispiel #3
0
 def mySendMessage(controller, text):
     if text != "None" and text and controller:
         IngameMessanger().sendText(controller, text)
Beispiel #4
0
 def myDoPing(controller, position):
     if controller and SpotMessanger.myConf['DoPing']:
         IngameMessanger().doPing(controller,
                                  MinimapUtils.name2cell(position))