コード例 #1
0
 def create(cls, setup):
     repository = cls()
     from gui.battle_control.controllers import crosshair_proxy
     repository.addController(crosshair_proxy.CrosshairDataProxy())
     ammo = consumables.createAmmoCtrl(setup)
     repository.addViewController(ammo, setup)
     repository.addController(consumables.createEquipmentCtrl(setup))
     repository.addController(consumables.createOptDevicesCtrl(setup))
     state = vehicle_state_ctrl.createCtrl(setup)
     repository.addController(state)
     repository.addController(avatar_stats_ctrl.AvatarStatsController())
     messages = msgs_ctrl.createBattleMessagesCtrl(setup)
     feedback = feedback_adaptor.createFeedbackAdaptor(setup)
     repository.addController(feedback)
     repository.addController(messages)
     repository.addController(
         chat_cmd_ctrl.ChatCommandsController(setup, feedback, ammo))
     repository.addController(drr_scale_ctrl.DRRScaleController(messages))
     repository.addController(
         personal_efficiency_ctrl.createEfficiencyCtrl(
             setup, feedback, state))
     repository.addController(
         korea_msgs_ctrl.createKoreaMessagesController())
     repository.addArenaController(bootcamp_ctrl.BootcampController(),
                                   setup)
     repository.addArenaController(
         quest_progress_ctrl.createQuestProgressController(), setup)
     repository.addArenaController(
         view_points_ctrl.ViewPointsController(setup), setup)
     guiVisitor = setup.arenaVisitor.gui
     if guiVisitor.isBattleRoyale():
         repository.addArenaController(
             arena_border_ctrl.BattleRoyaleBorderCtrl(), setup)
     else:
         repository.addArenaController(
             arena_border_ctrl.ArenaBorderController(), setup)
     repository.addArenaController(
         anonymizer_fakes_ctrl.AnonymizerFakesController(setup), setup)
     repository.addArenaViewController(
         prebattle_setups_ctrl.PrebattleSetupsController(), setup)
     repository.addArenaViewController(
         arena_load_ctrl.createArenaLoadController(setup), setup)
     repository.addArenaViewController(period_ctrl.createPeriodCtrl(setup),
                                       setup)
     repository.addViewController(
         hit_direction_ctrl.createHitDirectionController(setup), setup)
     repository.addViewController(
         game_messages_ctrl.createGameMessagesController(setup), setup)
     repository.addViewController(
         callout_ctrl.createCalloutController(setup), setup)
     from gui.battle_control.controllers import area_marker_ctrl
     repository.addArenaController(area_marker_ctrl.AreaMarkersController(),
                                   setup)
     repository.addArenaController(deathzones_ctrl.DeathZonesController(),
                                   setup)
     return repository
コード例 #2
0
    def pressed_key(self):  # not working in training room coz prebID identical
        prebID = 0
        config0.check_running = True
        arena = getattr(BigWorld.player(), 'arena', None)
        if arena is not None:
            if arena.bonusType in self.schematic.key_mode:
                sessionProvider = dependency.instance(IBattleSessionProvider)
                setup = repositories.BattleSessionSetup(
                    avatar=BigWorld.player(), sessionProvider=sessionProvider)
                adding = anonymizer_fakes_ctrl.AnonymizerFakesController(setup)
                databID = getAvatarDatabaseID()

                vehID = getattr(BigWorld.player(), 'playerVehicleID', None)
                if vehID is not None and vehID in arena.vehicles:
                    prebID = arena.vehicles[vehID]['prebattleID']

                for (vehicleID, vData) in getArena().vehicles.iteritems():
                    databaseID = vData['accountDBID']
                    av_ses_id = vData['avatarSessionID']
                    _prebattleID = vData['prebattleID']
                    tag = vData['vehicleType'].type.tags  # frozenset
                    veh_name = vData['vehicleType'].type.name  # str
                    user = adding.usersStorage.getUser(
                        av_ses_id, scope=UserEntityScope.BATTLE)
                    if user is not None:
                        if self.schematic.tank_cls_key or len(
                                self.schematic.tanklist) > 1:
                            if databaseID != databID and (
                                (self.schematic.tank_cls_key & tag) or
                                (veh_name in self.schematic.tanklist)):
                                if not (user.isFriend() or user.isIgnored()):
                                    if prebID > 0 and prebID != _prebattleID:
                                        adding.addBattleIgnored(av_ses_id)
                                        yield wait(1.1)
                                    elif prebID == 0:
                                        adding.addBattleIgnored(av_ses_id)
                                        yield wait(1.1)
                    else:
                        if self.schematic.tank_cls_key or len(
                                self.schematic.tanklist) > 1:
                            if databaseID != databID and (
                                (self.schematic.tank_cls_key & tag) or
                                (veh_name in self.schematic.tanklist)):
                                if prebID > 0 and prebID != _prebattleID:
                                    adding.addBattleIgnored(av_ses_id)
                                    yield wait(1.1)
                                elif prebID == 0:
                                    adding.addBattleIgnored(av_ses_id)
                                    yield wait(1.1)
                SendGuiMessage('Blacklisting finished!')
        config0.check_running = False
コード例 #3
0
def AUTO_add():
    if not config0.check_running:
        config0.check_running = True
        sessionProvider = dependency.instance(IBattleSessionProvider)
        setup = repositories.BattleSessionSetup(
            avatar=BigWorld.player(), sessionProvider=sessionProvider)
        adding2 = anonymizer_fakes_ctrl.AnonymizerFakesController(setup)
        while len(config0.id_list) > 0:
            user = adding2.usersStorage.getUser(config0.id_list[0],
                                                scope=UserEntityScope.BATTLE)
            if user is not None:
                if not (user.isFriend() or user.isIgnored()):
                    adding2.addBattleIgnored(config0.id_list[0])
                    yield wait(1.1)
            else:
                adding2.addBattleIgnored(config0.id_list[0])
                yield wait(1.1)
            config0.id_list.pop(0)
        config0.check_running = False
コード例 #4
0
def teambl_key():
    prebID = 0
    arena = getattr(BigWorld.player(), 'arena', None)
    if arena is not None and not BattleReplay.isPlaying():
        if arena.bonusType == 1:
            sessionProvider = dependency.instance(IBattleSessionProvider)
            setup = repositories.BattleSessionSetup(
                avatar=BigWorld.player(), sessionProvider=sessionProvider)
            adding = anonymizer_fakes_ctrl.AnonymizerFakesController(setup)
            databID = getAvatarDatabaseID()

            vehID = getattr(BigWorld.player(), 'playerVehicleID', None)
            if vehID is not None and vehID in arena.vehicles:
                prebID = arena.vehicles[vehID]['prebattleID']

            for (vehicleID, vData) in getArena().vehicles.iteritems():
                databaseID = vData['accountDBID']
                av_ses_id = vData['avatarSessionID']
                _prebattleID = vData['prebattleID']
                user = adding.usersStorage.getUser(
                    av_ses_id, scope=UserEntityScope.BATTLE)
                if user is not None:
                    if databaseID != databID and not (user.isFriend()
                                                      or user.isIgnored()):
                        if prebID > 0 and prebID != _prebattleID:
                            adding.addBattleIgnored(av_ses_id)
                            yield wait(1.1)
                        elif prebID == 0:
                            adding.addBattleIgnored(av_ses_id)
                            yield wait(1.1)
                else:
                    if databaseID != databID:
                        if prebID > 0 and prebID != _prebattleID:
                            adding.addBattleIgnored(av_ses_id)
                            yield wait(1.1)
                        elif prebID == 0:
                            adding.addBattleIgnored(av_ses_id)
                            yield wait(1.1)