Example #1
0
    def __init__(self, reader, writer, token):
        super().__init__(Platform.Steam, __version__, reader, writer, token)
        self._steam_id = None
        self._miniprofile_id = None
        self._level_db_parser = None
        self._regmon = get_steam_registry_monitor()
        self._local_games_cache: Optional[List[LocalGame]] = None
        self._ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
        self._ssl_context.load_verify_locations(certifi.where())
        self._http_client = AuthenticatedHttpClient()
        self._client = SteamHttpClient(self._http_client)
        self._persistent_storage_state = PersistentCacheState()
        self._servers_cache = ServersCache(self._client, self._ssl_context,
                                           self.persistent_cache,
                                           self._persistent_storage_state)
        self._friends_cache = FriendsCache()
        self._steam_client = WebSocketClient(self._client, self._ssl_context,
                                             self._servers_cache,
                                             self._friends_cache)
        self._achievements_cache = Cache()
        self._achievements_cache_updated = False

        self._achievements_semaphore = asyncio.Semaphore(20)
        self._tags_semaphore = asyncio.Semaphore(5)

        self._library_settings_import_iterator = 0
        self._game_tags_cache = {}

        self._update_task = None

        def user_presence_update_handler(user_id: str, user_info: UserInfo):
            self.update_user_presence(user_id, from_user_info(user_info))

        self._friends_cache.updated_handler = user_presence_update_handler
Example #2
0
 def __init__(self, reader, writer, token):
     super().__init__(Platform.Steam, __version__, reader, writer, token)
     self._steam_id = None
     self._regmon = get_steam_registry_monitor()
     self._local_games_cache = local_games_list()
     self._http_client = AuthenticatedHttpClient()
     self._client = SteamHttpClient(self._http_client)
     self._achievements_cache = Cache()
    def __init__(self, reader, writer, token):
        super().__init__(Platform.Steam, __version__, reader, writer, token)
        self._steam_id = None
        self._regmon = get_steam_registry_monitor()
        self._local_games_cache: List[LocalGame] = []
        self._http_client = AuthenticatedHttpClient()
        self._client = SteamHttpClient(self._http_client)
        self._achievements_cache = Cache()
        self._achievements_cache_updated = False
        self._achievements_semaphore = asyncio.Semaphore(20)

        self.create_task(self._update_local_games(), "Update local games")
    def __init__(self, reader, writer, token):
        super().__init__(Platform.Steam, __version__, reader, writer, token)
        self._regmon = get_steam_registry_monitor()
        self._local_games_cache: Optional[List[LocalGame]] = None
        self._ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
        self._ssl_context.load_verify_locations(certifi.where())
        self._http_client = AuthenticatedHttpClient()
        self._client = SteamHttpClient(self._http_client)
        self._persistent_storage_state = PersistentCacheState()
        self._servers_cache = ServersCache(self._client, self._ssl_context,
                                           self.persistent_cache,
                                           self._persistent_storage_state)
        self._friends_cache = FriendsCache()
        self._games_cache = GamesCache()
        self._translations_cache = dict()
        self._stats_cache = StatsCache()
        self._user_info_cache = UserInfoCache()
        self._times_cache = TimesCache()
        self._steam_client = WebSocketClient(
            self._client, self._ssl_context, self._servers_cache,
            self._friends_cache, self._games_cache, self._translations_cache,
            self._stats_cache, self._times_cache, self._user_info_cache,
            self.store_credentials)
        self._steam_client_run_task = None

        self._tags_semaphore = asyncio.Semaphore(5)

        self._library_settings_import_iterator = 0
        self._last_launch: Timestamp = 0

        self._update_local_games_task = asyncio.create_task(asyncio.sleep(0))
        self._update_owned_games_task = asyncio.create_task(asyncio.sleep(0))
        self._owned_games_parsed = None

        self._auth_data = None
        self._cooldown_timer = time.time()

        async def user_presence_update_handler(user_id: str,
                                               proto_user_info: ProtoUserInfo):
            self.update_user_presence(
                user_id, await
                presence_from_user_info(proto_user_info,
                                        self._translations_cache))

        self._friends_cache.updated_handler = user_presence_update_handler
Example #5
0
    def __init__(self, reader, writer, token):
        super().__init__(Platform.Steam, __version__, reader, writer, token)
        self._steam_id = None
        self._miniprofile_id = None
        self._level_db_parser = None
        self._regmon = get_steam_registry_monitor()
        self._local_games_cache: List[LocalGame] = []
        self._http_client = AuthenticatedHttpClient()
        self._client = SteamHttpClient(self._http_client)
        self._achievements_cache = Cache()
        self._achievements_cache_updated = False

        self._achievements_semaphore = asyncio.Semaphore(20)
        self._tags_semaphore = asyncio.Semaphore(5)

        self._library_settings_import_iterator = 0
        self._game_tags_cache = {}

        self._update_task = self.create_task(self._update_local_games(),
                                             "Update local games")
Example #6
0
def test_unlock_time_parsing(input_time, parsed_date):
    assert parsed_date == SteamHttpClient.parse_date(input_time)