From 18a52d33bab557402a5f38093fbc572696791b33 Mon Sep 17 00:00:00 2001 From: matte-ek Date: Sun, 7 May 2023 15:58:58 +0200 Subject: [PATCH] Make playtime message more clear if a player was in the lobby during a bot restart --- BanchoMultiplayerBot/Behaviour/FunCommandsBehaviour.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/BanchoMultiplayerBot/Behaviour/FunCommandsBehaviour.cs b/BanchoMultiplayerBot/Behaviour/FunCommandsBehaviour.cs index eb7c964..3e151bf 100644 --- a/BanchoMultiplayerBot/Behaviour/FunCommandsBehaviour.cs +++ b/BanchoMultiplayerBot/Behaviour/FunCommandsBehaviour.cs @@ -55,7 +55,9 @@ private async void OnUserMessage(IPrivateIrcMessage msg) var totalPlaytime = TimeSpan.FromSeconds(user.Playtime) + currentPlaytime; // We add current play-time since it's only appended after the player disconnects. _lobby.SendMessage( - $"{msg.Sender} has been here for {currentPlaytime:h' hours 'm' minutes 's' seconds'} ({totalPlaytime:d' days 'h' hours 'm' minutes 's' seconds'} in total)"); + _lobby.Bot.StartTime.AddMinutes(2) >= player.JoinTime + ? $"{msg.Sender} has been here since last bot restart, {currentPlaytime:h' hours 'm' minutes 's' seconds'} ({totalPlaytime:d' days 'h' hours 'm' minutes 's' seconds'} in total)" + : $"{msg.Sender} has been here for {currentPlaytime:h' hours 'm' minutes 's' seconds'} ({totalPlaytime:d' days 'h' hours 'm' minutes 's' seconds'} in total)"); } if (msg.Content.ToLower().Equals("!playstats"))