From a01567c89a3d3475a82219a9affcf4947ce2769e Mon Sep 17 00:00:00 2001 From: SantaSpeen Date: Tue, 18 Jul 2023 04:14:46 +0300 Subject: [PATCH] Auto removing cars after disconnect --- src/core/Client.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/Client.py b/src/core/Client.py index aef1c26..122c012 100644 --- a/src/core/Client.py +++ b/src/core/Client.py @@ -488,6 +488,10 @@ class Client: self.__alive = False if (self.cid > 0 or self.nick is not None) and \ self.__Core.clients_by_nick.get(self.nick): + for i, car in enumerate(self.cars): + if not car: + continue + await self._send(f"Od:{self.cid}-{i}") if self.ready: await self._send(f"J{self.nick} disconnected!", to_all=True) # I'm disconnected. self.log.debug(f"Removing client {self.nick}:{self.cid}")