mirror of
https://github.com/Impostor/Impostor.git
synced 2026-10-19 15:51:42 +00:00
Send DisconnectReason.Hacking to other players when disconnecting for cheating
Base game doesn't have a specific message for it so it results in a generic "left the game due to error" but it's still better than the default "left the game". This also allows client side mods to fix the message.
This commit is contained in:
1 parent
6c91280125
commit
a0f0a65cbf
1 file changed
+7
-2
@@ -86,9 +86,14 @@ namespace Impostor.Server.Net
|
||||
|
||||
_logger.LogWarning("Client {Name} ({Id}) was caught cheating: [{SupportCode}] [{Context}-{Category}] {Message}", Name, Id, supportCode, context.Name, category, message);
|
||||
|
||||
if (_antiCheatConfig.BanIpFromGame)
|
||||
if (Player is { } player)
|
||||
{
|
||||
Player?.Game.BanIp(Connection.EndPoint.Address);
|
||||
if (_antiCheatConfig.BanIpFromGame)
|
||||
{
|
||||
player.Game.BanIp(Connection.EndPoint.Address);
|
||||
}
|
||||
|
||||
await player.Game.HandleRemovePlayer(Id, DisconnectReason.Hacking);
|
||||
}
|
||||
|
||||
var disconnectMessage =
|
||||
|
||||
Reference in new issue
Block a user