try to check_alive

This commit is contained in:
Maxim Khomutov 2023-07-18 22:33:15 +03:00
parent 45d45a820c
commit 31d8cf7842

View File

@ -95,6 +95,7 @@ class Core:
async def check_alive(self):
maxp = config.Game['players']
try:
while self.run:
await asyncio.sleep(1)
ca = f"Ss{len(self.clients_by_id)}/{maxp}:{self.get_clients_list()}"
@ -105,6 +106,9 @@ class Core:
client.is_disconnected()
continue
await client._send(bytes(ca, "utf-8"))
except Exception as e:
self.log.error("Error in check_alive.")
self.log.exception(e)
@staticmethod
def start_web():