]> git.deb.at Git - rhonda/impostor.git/commitdiff
Move remaining Color checks to ColorLimits
authorminiduikboot <mini@duikbo.at>
Sun, 28 Apr 2024 15:00:30 +0000 (17:00 +0200)
committerminiduikboot <mini@duikbo.at>
Sun, 28 Apr 2024 18:50:41 +0000 (20:50 +0200)
Some mods add custom colors and still use the standard vanilla SetColor
RPC, which leads to issues with this check.

src/Impostor.Server/Net/Inner/Objects/InnerPlayerControl.cs

index 9cfe037449a42d084ea5bcccf23a8e64c16ca1a2..37dffe57adfbca674542b6b7a8e3287a7d4c6630 100644 (file)
@@ -688,7 +688,7 @@ namespace Impostor.Server.Net.Inner.Objects
 
             if ((byte)color > ColorsCount)
             {
-                if (await sender.Client.ReportCheatAsync(RpcCalls.CheckColor, CheatCategory.ProtocolExtension, "Client sent invalid color"))
+                if (await sender.Client.ReportCheatAsync(RpcCalls.CheckColor, CheatCategory.ColorLimits, "Client sent invalid color"))
                 {
                     return false;
                 }
@@ -736,7 +736,7 @@ namespace Impostor.Server.Net.Inner.Objects
 
                         if (colorOffset == ColorsCount)
                         {
-                            if (await sender.Client.ReportCheatAsync(RpcCalls.SetColor, CheatCategory.GameFlow, "Client sent SetColor but all colors are already in use"))
+                            if (await sender.Client.ReportCheatAsync(RpcCalls.SetColor, CheatCategory.ColorLimits, "Client sent SetColor but all colors are already in use"))
                             {
                                 await SetColorAsync(expected);
                                 return false;
@@ -746,7 +746,7 @@ namespace Impostor.Server.Net.Inner.Objects
 
                     if (color != expected)
                     {
-                        if (await sender.Client.ReportCheatAsync(RpcCalls.SetColor, CheatCategory.GameFlow, "Client sent SetColor with incorrect color"))
+                        if (await sender.Client.ReportCheatAsync(RpcCalls.SetColor, CheatCategory.ColorLimits, "Client sent SetColor with incorrect color"))
                         {
                             await SetColorAsync(expected);
                             return false;