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
{
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();
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;
+ }
}
}