From 2cab17fe27c16b404ce339a93ea5353beb27741c Mon Sep 17 00:00:00 2001 From: gsd Date: Sun, 3 Nov 2024 20:44:23 +0300 Subject: [PATCH] next --- player.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/player.py b/player.py index 3716988..9bb038a 100644 --- a/player.py +++ b/player.py @@ -136,6 +136,7 @@ class Player: if not workshopmap2bsp(map_name) in self.lastplayAndGametime: self.lastplayAndGametime[workshopmap2bsp(map_name)] = {"total":0, "lastplay":0} self.lastplayAndGametime[workshopmap2bsp(map_name)]['lastplay'] = last_play + if "gametime" in self.current and self.current["gametime"]: message += "Статистика по картам:\n" for maps in self.current["gametime"].values(): @@ -143,9 +144,11 @@ class Player: if not workshopmap2bsp(map_name) in self.lastplayAndGametime: self.lastplayAndGametime[workshopmap2bsp(map_name)] = {"total":0, "lastplay":0} self.lastplayAndGametime[workshopmap2bsp(map_name)]["total"] = play_time - message += "Статистика игры:\n" - for map_name, values in self.lastplayAndGametime.items(): - message += f"{map_name}\n{human_TIME(values['total']) if values['total'] > 0 else 'Не играл'} / {utime2human(values['lastplay']) if values['lastplay'] > 0 else 'Не играл'}\n\n" + + if len(list(self.lastplayAndGametime.keys())) > 0: + message += "Статистика игры:\n" + for map_name, values in self.lastplayAndGametime.items(): + message += f"{map_name}\n{human_TIME(values['total']) if values['total'] > 0 else 'Не играл'} / {utime2human(values['lastplay']) if values['lastplay'] > 0 else 'Не играл'}\n\n" #Далее идут проверка прав if "permition" in self.current and self.current["permition"]: