]> git.deb.at Git - rhonda/impostor.git/commitdiff
Add scene param to forbidden scene log statement
authorminiduikboot <mini@duikbo.at>
Thu, 8 Aug 2024 19:31:07 +0000 (21:31 +0200)
committerminiduikboot <mini@duikbo.at>
Tue, 20 Aug 2024 15:18:00 +0000 (17:18 +0200)
I'm seeing multiple warnings in my server log about forbidden scene
changes. Unfortunately this warning does not include the actual scene
that was triggering the issue, which makes diagnosis/remediation difficult.

Additionally change this logging call to use names suitable for
structured logging.

src/Impostor.Server/Net/State/Game.Data.cs

index 65632d50ee1771a217ff769d47c77bcc6aac29ba..5f0e56ccd990939e8fa3a510790efbfb6f5ef08f 100644 (file)
@@ -245,9 +245,10 @@ namespace Impostor.Server.Net.State
                         if (scene != "OnlineGame")
                         {
                             _logger.LogWarning(
-                                "Player {0} ({1}) tried to send SceneChangeFlag with disallowed scene.",
+                                "Player {PlayerName} ({ClientId}) tried to send SceneChangeFlag with disallowed scene \"{Scene}\".",
                                 sender.Client.Name,
-                                sender.Client.Id);
+                                sender.Client.Id,
+                                scene);
                             return false;
                         }