mirror of
https://github.com/kuitoi/kuitoi-Server.git
synced 2025-08-17 16:25:36 +00:00
Minor updates..
This commit is contained in:
parent
2368fec501
commit
43fd56f327
@ -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
|
||||
|
@ -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,15 +181,18 @@ 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":
|
||||
if test:
|
||||
# TODO: i18n
|
||||
self.log.info(f"Authenticated! {msg}")
|
||||
elif status == "200":
|
||||
if test:
|
||||
self.log.info(f"Resumed authenticated session. {msg}")
|
||||
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.")
|
||||
|
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user