コード例 #1
0
 async def join_game_session(self, session: GameSessionListEntry,
                             password: Optional[str]):
     result = await self._emit_with_result("join_game_session",
                                           (session.id, password))
     self._current_game_session = GameSessionEntry.from_json(result)
コード例 #2
0
 async def on_game_session_updated(self, data):
     self._current_game_session = GameSessionEntry.from_json(data)
     self.logger.debug(f"{self._current_game_session.id}")
コード例 #3
0
 async def create_new_session(self, session_name: str) -> GameSessionEntry:
     result = await self._emit_with_result("create_game_session",
                                           session_name)
     self._current_game_session = GameSessionEntry.from_json(result)
     return self._current_game_session
コード例 #4
0
 async def _on_game_session_meta_update_raw(self, data: bytes):
     entry = GameSessionEntry.from_json(data)
     self.logger.debug(
         "%s: %s", entry.id,
         hashlib.blake2b(str(data).encode("utf-8")).hexdigest())
     await self.on_game_session_meta_update(entry)