diff --git a/src/core/Client.py b/src/core/Client.py index 31583f6..ec8a7eb 100644 --- a/src/core/Client.py +++ b/src/core/Client.py @@ -112,7 +112,7 @@ class Client: if not reason: reason = "Kicked!" else: - reason = f"{reason!r}" + reason = f"{reason}" if not self.__alive: self.log.debug(f"{self.nick}.kick('{reason}') skipped: Not alive;") return diff --git a/src/core/core.py b/src/core/core.py index 6a920a2..4e71933 100644 --- a/src/core/core.py +++ b/src/core/core.py @@ -157,7 +157,6 @@ class Core: "version": self.BeamMP_version, "clientversion": self.client_major_version, "name": config.Server["name"], "modlist": modlist, "modstotalsize": modstotalsize, "modstotal": modstotal, "playerslist": "", "desc": config.Server['description'], "pass": False} - self.log.debug(f"Auth: data {data}") # Sentry? ok = False @@ -169,7 +168,6 @@ class Core: async with session.post(url, data=data, headers={"api-v": "2"}) as response: code = response.status body = await response.json() - self.log.debug(f"Auth: code {code}, body {body}") ok = True break except Exception as e: @@ -183,19 +181,22 @@ class Core: self.log.error("Missing/invalid json members in backend response") raise KeyboardInterrupt - if test: - status = body.get("status") - msg = body.get("msg") - if status == "2000": + status = body.get("status") + msg = body.get("msg") + if status == "2000": + if test: # TODO: i18n self.log.info(f"Authenticated! {msg}") - elif status == "200": + elif status == "200": + if test: self.log.info(f"Resumed authenticated session. {msg}") - else: - self.log.error(f"Backend REFUSED the auth key. Reason: " - f"{msg or 'Backend did not provide a reason'}") - self.log.info(f"Server still runnig, but only in Direct connect mode.") - self.direct = True + else: + self.log.debug(f"Auth: data {data}") + self.log.debug(f"Auth: code {code}, body {body}") + self.log.error(f"Backend REFUSED the auth key. Reason: " + f"{msg or 'Backend did not provide a reason'}") + self.log.info(f"Server still runnig, but only in Direct connect mode.") + self.direct = True else: self.direct = True if test: diff --git a/src/core/udp_server.py b/src/core/udp_server.py index f54a174..e8563a2 100644 --- a/src/core/udp_server.py +++ b/src/core/udp_server.py @@ -23,8 +23,9 @@ class UDPServer(asyncio.DatagramTransport): self.port = port self.run = False - def connection_made(self, transport): - ... + def connection_made(self, *args, **kwargs): ... + def pause_writing(self, *args, **kwargs): ... + def resume_writing(self, *args, **kwargs): ... async def handle_datagram(self, data, addr): try: