Add scene param to forbidden scene log statement

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.
This commit is contained in:
miniduikboot committed 2024-08-20 17:18:00 +02:00
1 parent 35c66cda5f
commit 066eca09ee
1 file changed
+3 -2
+3 -2
View 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;
}