mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 20:21:32 -06:00
BizHawkClient: Store seed name sent by the server for clients to check (#4702)
This commit is contained in:
@@ -41,6 +41,7 @@ class BizHawkClientCommandProcessor(ClientCommandProcessor):
|
|||||||
|
|
||||||
class BizHawkClientContext(CommonContext):
|
class BizHawkClientContext(CommonContext):
|
||||||
command_processor = BizHawkClientCommandProcessor
|
command_processor = BizHawkClientCommandProcessor
|
||||||
|
server_seed_name: str | None = None
|
||||||
auth_status: AuthStatus
|
auth_status: AuthStatus
|
||||||
password_requested: bool
|
password_requested: bool
|
||||||
client_handler: BizHawkClient | None
|
client_handler: BizHawkClient | None
|
||||||
@@ -68,6 +69,8 @@ class BizHawkClientContext(CommonContext):
|
|||||||
if cmd == "Connected":
|
if cmd == "Connected":
|
||||||
self.slot_data = args.get("slot_data", None)
|
self.slot_data = args.get("slot_data", None)
|
||||||
self.auth_status = AuthStatus.AUTHENTICATED
|
self.auth_status = AuthStatus.AUTHENTICATED
|
||||||
|
elif cmd == "RoomInfo":
|
||||||
|
self.server_seed_name = args.get("seed_name", None)
|
||||||
|
|
||||||
if self.client_handler is not None:
|
if self.client_handler is not None:
|
||||||
self.client_handler.on_package(self, cmd, args)
|
self.client_handler.on_package(self, cmd, args)
|
||||||
@@ -100,6 +103,7 @@ class BizHawkClientContext(CommonContext):
|
|||||||
|
|
||||||
async def disconnect(self, allow_autoreconnect: bool=False):
|
async def disconnect(self, allow_autoreconnect: bool=False):
|
||||||
self.auth_status = AuthStatus.NOT_AUTHENTICATED
|
self.auth_status = AuthStatus.NOT_AUTHENTICATED
|
||||||
|
self.server_seed_name = None
|
||||||
await super().disconnect(allow_autoreconnect)
|
await super().disconnect(allow_autoreconnect)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user