]> git.deb.at Git - rhonda/impostor.git/commit
Refactor SetColor anticheat
authorminiduikboot <mini@duikbo.at>
Sun, 7 Jul 2024 21:33:02 +0000 (23:33 +0200)
committerminiduikboot <mini@duikbo.at>
Fri, 23 Aug 2024 16:04:52 +0000 (18:04 +0200)
commit2ddbb8891c805cc3e90fb653e83160bafb3b7f91
treed4c00bcd731d156480200b845b1710c92866904d
parent8c52b13af434b468a862ccdc9acc32481f036034
Refactor SetColor anticheat

One issue with the ColorLimits checks is that it didn't account for mods
that add extra colors, this is fixed by checking if the route followed
is plausible instead of mimicking client logic and only accepting a
single answer that it expected. A false negative is possible where the
host decides to wrap back to the front but there are still custom colors
available at the end of the list. This is acceptable because Impostor
doesn't currently know the amount of colors available and this issue
isn't major enough to ask all mod authors to declare their custom color
amount to the server.

As extra colors should now be handled by this code, it makes sense to
change the category of the unknown colors check to ProtocolExtensions.
For these mods an exemption of the ColorLimits category is no longer
necessary.

Note that mods that allow duplicate colors that do not use a custom rpc
to set colors can only be supported by disabling the ColorLimits
category, this was already the case and I don't think it can be unified
with the existing check.
src/Impostor.Server/Net/Inner/Objects/InnerPlayerControl.cs
src/Impostor.Server/Net/State/Game.cs