3
2
forked from Dniel97/artemis

idz: fix userdb

This commit is contained in:
Hay1tsme 2024-01-23 11:31:09 -05:00
parent 83b981917e
commit ce5888227e
2 changed files with 4 additions and 5 deletions

View File

@ -137,7 +137,7 @@ class IDZServlet(BaseServlet):
continue continue
loop = asyncio.get_running_loop() loop = asyncio.get_running_loop()
IDZUserDB(self.core_cfg, self.game_cfg, self.rsa_keys, handler_map) IDZUserDB(self.core_cfg, self.game_cfg, self.rsa_keys, handler_map).start()
asyncio.create_task( asyncio.create_task(
loop.create_datagram_endpoint( loop.create_datagram_endpoint(
lambda: IDZEcho(), lambda: IDZEcho(),
@ -157,7 +157,6 @@ class IDZServlet(BaseServlet):
) )
) )
self.logger.info(f"UserDB Listening on port {self.game_cfg.ports.userdb}")
async def render_GET(self, request: Request) -> bytes: async def render_GET(self, request: Request) -> bytes:
url_path = request.path_params.get('endpoint', '') url_path = request.path_params.get('endpoint', '')

View File

@ -41,8 +41,8 @@ class IDZUserDB:
self.skip_next = False self.skip_next = False
def start(self) -> None: def start(self) -> None:
self.logger.info(f"Start on port {self.config.aimedb.port}") self.logger.info(f"Start on port {self.game_config.ports.userdb}")
asyncio.create_task(asyncio.start_server(self.connection_cb, self.config.server.listen_address, self.config.aimedb.port)) asyncio.create_task(asyncio.start_server(self.connection_cb, self.core_config.server.listen_address, self.game_config.ports.userdb))
def append_padding(self, data: bytes): def append_padding(self, data: bytes):
"""Appends 0s to the end of the data until it's at the correct size""" """Appends 0s to the end of the data until it's at the correct size"""
@ -81,7 +81,7 @@ class IDZUserDB:
self.logger.debug("Connection closed") self.logger.debug("Connection closed")
return return
await self.data.Received(data, reader, writer) await self.dataReceived(data, reader, writer)
await writer.drain() await writer.drain()
except ConnectionResetError as e: except ConnectionResetError as e: