From: miniduikboot Date: Wed, 13 Mar 2024 18:23:56 +0000 (+0100) Subject: Check AC config in SetName/Color checks X-Git-Tag: v1.9.2~7^2~2 X-Git-Url: https://git.deb.at/?a=commitdiff_plain;h=ba9eeb5bb4e45bea6dcd84b53c62cb79d1623f16;p=rhonda%2Fimpostor.git Check AC config in SetName/Color checks Previously this was not done causing these checks to be unconditionally enabled --- diff --git a/src/Impostor.Server/Net/Inner/Objects/InnerPlayerControl.cs b/src/Impostor.Server/Net/Inner/Objects/InnerPlayerControl.cs index 958d8a9..cd9af28 100644 --- a/src/Impostor.Server/Net/Inner/Objects/InnerPlayerControl.cs +++ b/src/Impostor.Server/Net/Inner/Objects/InnerPlayerControl.cs @@ -647,9 +647,11 @@ namespace Impostor.Server.Net.Inner.Objects if (name != expected) { - _logger.LogWarning($"Client sent {nameof(RpcCalls.SetName)} with incorrect name"); - await SetNameAsync(expected); - return false; + if (await sender.Client.ReportCheatAsync(RpcCalls.SetName, CheatCategory.GameFlow, "Client sent SetName with incorrect name")) + { + await SetNameAsync(expected); + return false; + } } } else @@ -713,8 +715,10 @@ namespace Impostor.Server.Net.Inner.Objects { if (!RequestedColorId.Any()) { - _logger.LogWarning($"Client sent {nameof(RpcCalls.SetColor)} for a player that didn't request it"); - return false; + if (await sender.Client.ReportCheatAsync(RpcCalls.SetColor, CheatCategory.GameFlow, "Client sent SetColor for a player that didn't request it")) + { + return false; + } } var expected = RequestedColorId.Dequeue(); @@ -726,9 +730,11 @@ namespace Impostor.Server.Net.Inner.Objects if (color != expected) { - _logger.LogWarning($"Client sent {nameof(RpcCalls.SetColor)} with incorrect color"); - await SetColorAsync(expected); - return false; + if (await sender.Client.ReportCheatAsync(RpcCalls.SetColor, CheatCategory.GameFlow, "Client sent SetColor with incorrect color")) + { + await SetColorAsync(expected); + return false; + } } }