From d926901ffaa1a88e21a8d9644978bcb127117b63 Mon Sep 17 00:00:00 2001 From: RaidMax Date: Thu, 28 Apr 2022 10:35:01 -0500 Subject: [PATCH] reduce warning logs for connecting bots on live radar --- Plugins/LiveRadar/Plugin.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Plugins/LiveRadar/Plugin.cs b/Plugins/LiveRadar/Plugin.cs index eb7f42a5..78682fb1 100644 --- a/Plugins/LiveRadar/Plugin.cs +++ b/Plugins/LiveRadar/Plugin.cs @@ -77,7 +77,15 @@ namespace LiveRadar lock (lockObject) { - generatedBotGuid = _botGuidLookups.ContainsKey(botKey) + var hasBotKey = _botGuidLookups.ContainsKey(botKey); + + if (!hasBotKey && ((string)E.Extra).IsBotGuid()) + { + // edge case where the bot guid has not been registered yet + return Task.CompletedTask; + } + + generatedBotGuid = hasBotKey ? _botGuidLookups[botKey] : (E.Extra.ToString() ?? "0").ConvertGuidToLong(NumberStyles.HexNumber); }