Exemplo n.º 1
0
    def __init__(self,
                 args,
                 id,
                 last_known_state,
                 websocket_handler,
                 walker_routemanager,
                 devicesettings,
                 db_wrapper,
                 mitm_mapper,
                 pogoWindowManager,
                 NoOcr=False,
                 walker=None):
        WorkerBase.__init__(self,
                            args,
                            id,
                            last_known_state,
                            websocket_handler,
                            walker_routemanager,
                            devicesettings,
                            db_wrapper=db_wrapper,
                            NoOcr=True,
                            pogoWindowManager=pogoWindowManager,
                            walker=walker)

        self._reboot_count = 0
        self._restart_count = 0
        self._rec_data_time = ""
        self._mitm_mapper = mitm_mapper
        self._latest_encounter_update = 0
        self._encounter_ids = {}
Exemplo n.º 2
0
    def __init__(self,
                 args,
                 id,
                 last_known_state,
                 websocket_handler,
                 mapping_manager: MappingManager,
                 routemanager_name: str,
                 db_wrapper,
                 mitm_mapper: MitmMapper,
                 pogoWindowManager: PogoWindows,
                 NoOcr=False,
                 walker=None):
        WorkerBase.__init__(self,
                            args,
                            id,
                            last_known_state,
                            websocket_handler,
                            mapping_manager=mapping_manager,
                            routemanager_name=routemanager_name,
                            db_wrapper=db_wrapper,
                            NoOcr=True,
                            pogoWindowManager=pogoWindowManager,
                            walker=walker)

        self._reboot_count = 0
        self._restart_count = 0
        self._rec_data_time = ""
        self._mitm_mapper = mitm_mapper
        self._latest_encounter_update = 0
        self._encounter_ids = {}

        self._mitm_mapper.collect_location_stats(
            self._id, self.current_location, 1, time.time(), 2, 0,
            self._mapping_manager.routemanager_get_mode(
                self._routemanager_name), 99)
Exemplo n.º 3
0
    def __init__(self, args, id, last_known_state, websocket_handler,
                 route_manager_daytime, route_manager_nighttime, mitm_mapper,
                 devicesettings, db_wrapper):

        self._resocalc = Resocalculator
        WorkerBase.__init__(self,
                            args,
                            id,
                            last_known_state,
                            websocket_handler,
                            route_manager_daytime,
                            route_manager_nighttime,
                            devicesettings,
                            db_wrapper=db_wrapper,
                            NoOcr=False,
                            resocalc=self._resocalc)

        self.id = id
        self._work_mutex = Lock()
        self._run_warning_thread_event = Event()
        self._locationCount = 0
        self._mitm_mapper = mitm_mapper
        # self.thread_pool = ThreadPool(processes=4)
        self.loop = None
        self.loop_started = Event()
        self.loop_tid = None
        # TODO: own InjectionSettings class
        self._injection_settings = {}
        self.__update_injection_settings()
        self._screen_x = 0
        self._screen_y = 0
        self._clear_box = False
        self._clear_quest = False
        self._delayadd = 0
Exemplo n.º 4
0
    def __init__(self,
                 args,
                 id,
                 last_known_state,
                 websocket_handler,
                 route_manager_daytime,
                 route_manager_nighttime,
                 devicesettings,
                 db_wrapper,
                 timer,
                 mitm_mapper,
                 NoOcr=False):
        WorkerBase.__init__(self,
                            args,
                            id,
                            last_known_state,
                            websocket_handler,
                            route_manager_daytime,
                            route_manager_nighttime,
                            devicesettings,
                            db_wrapper=db_wrapper,
                            NoOcr=True,
                            timer=timer)

        self._reboot_count = 0
        self._restart_count = 0
        self._rec_data_time = ""
        self._mitm_mapper = mitm_mapper

        if not NoOcr:
            from ocr.pogoWindows import PogoWindows
            self._pogoWindowManager = PogoWindows(self._communicator,
                                                  args.temp_path)
Exemplo n.º 5
0
    def __init__(self,
                 args,
                 id,
                 last_known_state,
                 websocket_handler,
                 route_manager_daytime,
                 route_manager_nighttime,
                 devicesettings,
                 db_wrapper,
                 timer,
                 mitm_mapper,
                 pogoWindowManager,
                 NoOcr=False):
        WorkerBase.__init__(self,
                            args,
                            id,
                            last_known_state,
                            websocket_handler,
                            route_manager_daytime,
                            route_manager_nighttime,
                            devicesettings,
                            db_wrapper=db_wrapper,
                            NoOcr=True,
                            timer=timer,
                            pogoWindowManager=pogoWindowManager)

        self._reboot_count = 0
        self._restart_count = 0
        self._rec_data_time = ""
        self._mitm_mapper = mitm_mapper
Exemplo n.º 6
0
    def __init__(self, args, id, last_known_state, websocket_handler,
                 route_manager_daytime, route_manager_nighttime, mitm_mapper,
                 devicesettings, db_wrapper):
        WorkerBase.__init__(self,
                            args,
                            id,
                            last_known_state,
                            websocket_handler,
                            route_manager_daytime,
                            route_manager_nighttime,
                            devicesettings,
                            db_wrapper=db_wrapper,
                            NoOcr=True)

        self.id = id
        self._work_mutex = Lock()
        self._run_warning_thread_event = Event()
        self._locationCount = 0
        self._mitm_mapper = mitm_mapper
        # self.thread_pool = ThreadPool(processes=4)
        self.loop = None
        self.loop_started = Event()
        self.loop_tid = None
        # TODO: own InjectionSettings class
        self._injection_settings = {}
        self.__update_injection_settings()
Exemplo n.º 7
0
 def __init__(self, args, id, last_known_state, websocket_handler,
              route_manager_daytime, route_manager_nighttime, mitm_mapper,
              devicesettings, db_wrapper, timer):
     WorkerBase.__init__(self,
                         args,
                         id,
                         last_known_state,
                         websocket_handler,
                         route_manager_daytime,
                         route_manager_nighttime,
                         devicesettings,
                         db_wrapper=db_wrapper,
                         NoOcr=False,
                         timer=timer)
     self.first_round = True
     self.clear_thread = None
     # 0 => None
     # 1 => clear box
     # 2 => clear quest
     self.clear_thread_task = 0
     self._mitm_mapper = mitm_mapper
     self._data_error_counter = 0
     self._start_inventory_clear = Event()
     self._delay_add = int(self._devicesettings.get("vps_delay", 0))
     self._reboot_count = 0
     self._restart_count = 0
     self._rec_data_time = 0
Exemplo n.º 8
0
    def __init__(self, args, id, last_known_state, websocket_handler, route_manager_daytime, route_manager_nighttime,
                 received_mapping, devicesettings, db_wrapper):
        WorkerBase.__init__(self, args, id, last_known_state, websocket_handler, route_manager_daytime,
                            route_manager_nighttime, devicesettings, db_wrapper=db_wrapper, NoOcr=True)

        self.id = id
        self._work_mutex = Lock()
        self._run_warning_thread_event = Event()
        self._locationCount = 0
        self._received_mapping = received_mapping
        # self.thread_pool = ThreadPool(processes=4)
        self.loop = None
        self.loop_started = Event()
        self.loop_tid = None
Exemplo n.º 9
0
    def __init__(self, args, id, last_known_state, websocket_handler,
                 walker_routemanager, devicesettings, db_wrapper, mitm_mapper, pogoWindowManager,
                 NoOcr=False, walker=None):
        WorkerBase.__init__(self, args, id, last_known_state, websocket_handler,
                            walker_routemanager, devicesettings, db_wrapper=db_wrapper, NoOcr=True,
                            pogoWindowManager=pogoWindowManager, walker=walker)

        self._reboot_count = 0
        self._restart_count = 0
        self._rec_data_time = ""
        self._mitm_mapper = mitm_mapper
        self._latest_encounter_update = 0
        self._encounter_ids = {}

        self._mitm_mapper.collect_location_stats(self._id, self.current_location, 1, time.time(), 2, 0,
                                                 self._walker_routemanager.get_walker_type(), 99)
Exemplo n.º 10
0
 def __init__(self, args, id, last_known_state, websocket_handler,
              route_manager_daytime, route_manager_nighttime, mitm_mapper,
              devicesettings, db_wrapper, timer):
     WorkerBase.__init__(self,
                         args,
                         id,
                         last_known_state,
                         websocket_handler,
                         route_manager_daytime,
                         route_manager_nighttime,
                         devicesettings,
                         db_wrapper=db_wrapper,
                         NoOcr=True,
                         timer=timer)
     self._mitm_mapper = mitm_mapper
     # TODO: own InjectionSettings class
     self._injection_settings = {}
     self.__update_injection_settings()
Exemplo n.º 11
0
    def __init__(self,
                 args,
                 id,
                 last_known_state,
                 websocket_handler,
                 walker_routemanager,
                 devicesettings,
                 db_wrapper,
                 mitm_mapper,
                 pogoWindowManager,
                 NoOcr=False,
                 walker=None):
        WorkerBase.__init__(self,
                            args,
                            id,
                            last_known_state,
                            websocket_handler,
                            walker_routemanager,
                            devicesettings,
                            db_wrapper=db_wrapper,
                            NoOcr=True,
                            pogoWindowManager=pogoWindowManager,
                            walker=walker)

        self._reboot_count = 0
        self._restart_count = 0
        self._rec_data_time = ""
        self._mitm_mapper = mitm_mapper
        self._latest_encounter_update = 0
        self._encounter_ids = {}

        if self._devicesettings.get('last_mode', None) is not None and \
                self._devicesettings['last_mode'] in ("raids_mitm", "mon_mitm", "iv_mitm", "raids_ocr"):
            logger.info('Last Mode not pokestop - reset saved location')
            self.last_location = Location(0.0, 0.0)
        self._devicesettings['last_mode'] = self._walker_routemanager.mode