Exemple #1
0
 def __init__(self,
              db_wrapper: DbWrapper,
              dbm,
              area_id,
              coords: List[Location],
              max_radius: float,
              max_coords_within_radius: int,
              path_to_include_geofence: str,
              path_to_exclude_geofence: str,
              routefile: str,
              mode=None,
              init: bool = False,
              name: str = "unknown",
              settings: dict = None,
              level: bool = False,
              calctype: str = "route",
              joinqueue=None):
     RouteManagerQuests.__init__(
         self,
         db_wrapper=db_wrapper,
         dbm=dbm,
         area_id=area_id,
         coords=coords,
         max_radius=max_radius,
         max_coords_within_radius=max_coords_within_radius,
         path_to_include_geofence=path_to_include_geofence,
         path_to_exclude_geofence=path_to_exclude_geofence,
         routefile=routefile,
         init=init,
         name=name,
         settings=settings,
         mode=mode,
         level=level,
         calctype=calctype,
         joinqueue=joinqueue)
Exemple #2
0
    def get_routemanager(db_wrapper, dbm, area_id, coords, max_radius, max_coords_within_radius,
                         path_to_include_geofence,
                         path_to_exclude_geofence: Optional[int], routefile: str, mode: Optional[str] = None,
                         init: bool = False, name: str = "unknown", settings=None,
                         coords_spawns_known: bool = False,
                         level: bool = False, calctype: str = "optimized", useS2: bool = False,
                         S2level: int = 15, joinqueue=None):

        if mode == "raids_mitm":
            route_manager = RouteManagerRaids(db_wrapper, dbm, area_id, coords, max_radius,
                                              max_coords_within_radius,
                                              path_to_include_geofence, path_to_exclude_geofence, routefile,
                                              mode=mode, settings=settings, init=init, name=name,
                                              joinqueue=joinqueue,
                                              useS2=useS2, S2level=S2level
                                              )
        elif mode == "mon_mitm":
            route_manager = RouteManagerMon(db_wrapper, dbm, area_id, coords, max_radius,
                                            max_coords_within_radius,
                                            path_to_include_geofence, path_to_exclude_geofence, routefile,
                                            mode=mode, settings=settings, init=init, name=name,
                                            joinqueue=joinqueue,
                                            coords_spawns_known=coords_spawns_known
                                            )
        elif mode == "iv_mitm":
            route_manager = RouteManagerIV(db_wrapper, dbm, area_id, coords, 0, 99999999,
                                           path_to_include_geofence, path_to_exclude_geofence, routefile,
                                           mode=mode, settings=settings, init=False, name=name,
                                           joinqueue=joinqueue
                                           )
        elif mode == "idle":
            route_manager = RouteManagerRaids(db_wrapper, dbm, area_id, coords, max_radius,
                                              max_coords_within_radius,
                                              path_to_include_geofence, path_to_exclude_geofence, routefile,
                                              mode=mode, settings=settings, init=init, name=name,
                                              joinqueue=joinqueue
                                              )
        elif mode == "pokestops":
            if level:
                route_manager = RouteManagerLeveling(db_wrapper, dbm, area_id, coords, max_radius,
                                                     max_coords_within_radius,
                                                     path_to_include_geofence, path_to_exclude_geofence,
                                                     routefile,
                                                     mode=mode, settings=settings, init=init, name=name,
                                                     level=True,
                                                     calctype=calctype, joinqueue=joinqueue
                                                     )
            else:
                route_manager = RouteManagerQuests(db_wrapper, dbm, area_id, coords, max_radius,
                                                   max_coords_within_radius,
                                                   path_to_include_geofence, path_to_exclude_geofence,
                                                   routefile,
                                                   mode=mode, settings=settings, init=init, name=name,
                                                   level=level,
                                                   calctype=calctype, joinqueue=joinqueue
                                                   )
        else:
            raise RuntimeError("Invalid mode found in mapping parser.")
        return route_manager
Exemple #3
0
    def get_routemanager(db_wrapper,
                         dbm,
                         area_id,
                         coords,
                         max_radius,
                         max_coords_within_radius,
                         path_to_include_geofence,
                         path_to_exclude_geofence: Optional[int],
                         routefile: str,
                         mode: WorkerType = WorkerType.UNDEFINED,
                         init: bool = False,
                         name: str = "unknown",
                         settings=None,
                         coords_spawns_known: bool = False,
                         level: bool = False,
                         calctype: str = "optimized",
                         useS2: bool = False,
                         S2level: int = 15,
                         joinqueue=None,
                         include_event_id=None):

        if mode == WorkerType.RAID_MITM.value:
            route_manager = RouteManagerRaids(db_wrapper,
                                              dbm,
                                              area_id,
                                              coords,
                                              max_radius,
                                              max_coords_within_radius,
                                              path_to_include_geofence,
                                              path_to_exclude_geofence,
                                              routefile,
                                              mode=mode,
                                              settings=settings,
                                              init=init,
                                              name=name,
                                              joinqueue=joinqueue,
                                              useS2=useS2,
                                              S2level=S2level)
        elif mode == WorkerType.MON_MITM.value:
            route_manager = RouteManagerMon(
                db_wrapper,
                dbm,
                area_id,
                coords,
                max_radius,
                max_coords_within_radius,
                path_to_include_geofence,
                path_to_exclude_geofence,
                routefile,
                mode=mode,
                settings=settings,
                init=init,
                name=name,
                joinqueue=joinqueue,
                coords_spawns_known=coords_spawns_known,
                include_event_id=include_event_id)
        elif mode == WorkerType.IV_MITM.value:
            route_manager = RouteManagerIV(db_wrapper,
                                           dbm,
                                           area_id,
                                           coords,
                                           0,
                                           99999999,
                                           path_to_include_geofence,
                                           path_to_exclude_geofence,
                                           routefile,
                                           mode=mode,
                                           settings=settings,
                                           init=False,
                                           name=name,
                                           joinqueue=joinqueue)
        elif mode == WorkerType.IDLE.value:
            route_manager = RouteManagerRaids(db_wrapper,
                                              dbm,
                                              area_id,
                                              coords,
                                              max_radius,
                                              max_coords_within_radius,
                                              path_to_include_geofence,
                                              path_to_exclude_geofence,
                                              routefile,
                                              mode=mode,
                                              settings=settings,
                                              init=init,
                                              name=name,
                                              joinqueue=joinqueue)
        elif mode == WorkerType.STOPS.value:
            if level:
                route_manager = RouteManagerLeveling(db_wrapper,
                                                     dbm,
                                                     area_id,
                                                     coords,
                                                     max_radius,
                                                     max_coords_within_radius,
                                                     path_to_include_geofence,
                                                     path_to_exclude_geofence,
                                                     routefile,
                                                     mode=mode,
                                                     settings=settings,
                                                     init=init,
                                                     name=name,
                                                     level=True,
                                                     calctype=calctype,
                                                     joinqueue=joinqueue)
            else:
                route_manager = RouteManagerQuests(db_wrapper,
                                                   dbm,
                                                   area_id,
                                                   coords,
                                                   max_radius,
                                                   max_coords_within_radius,
                                                   path_to_include_geofence,
                                                   path_to_exclude_geofence,
                                                   routefile,
                                                   mode=mode,
                                                   settings=settings,
                                                   init=init,
                                                   name=name,
                                                   level=level,
                                                   calctype=calctype,
                                                   joinqueue=joinqueue)
        else:
            raise RuntimeError("Invalid mode found in mapping parser.")
        return route_manager