| **BanIpFromGame** | `true` | When anticheat is enabled and a player is caught hacking, they will be kicked from the server. If this value is set to `true`, the player will be banned instead and will not be able to rejoin that specific game. |
| **AllowCheatingHosts** | `"Never"` | Configure whether hosts are allowed to cheat. "Never" forbids it, "Always" allows it. "IfRequested" allows hosts to cheat if they connect with the DisableServerAuthorityFlag set. |
| **EnableGameFlowChecks** | `true` | Enable checks that check if certain actions are done in the appropriate order or at the appropriate moment in the game. This includes changing cosmetics while in game or murdering too fast. |
+| **EnableInvalidObjectChecks** | `true` | Enables checks that check if network objects are spawned properly. Disabling this option also implies disabling EnableRoleChecks. |
| **EnableMustBeHostChecks** | `true` | Enables checks that check if players are the host before they can do actions that require them to be host of the game. This includes starting the game and spawning objects. |
| **EnableColorLimitChecks** | `true` | Enables checks that checks if players request colors that are already in use. |
-| **EnableInvalidObjectChecks** | `true` | Enables checks that check if network objects are spawned properly. |
| **EnableNameLimitChecks** | `true` | Enables checks that checks if player names have a length that is possible to set using the user interface. |
| **EnableOwnershipChecks** | `true` | Enables checks that check if players are allowed to perform a certain action on themself or another player. |
| **EnableRoleChecks** | `true` | Enables checks that check if players have the correct role when performing certain role abilities like venting or murdering. |
-namespace Impostor.Api.Config
+namespace Impostor.Api.Config
{
public class AntiCheatConfig
{
public bool EnableMustBeHostChecks { get; set; } = true;
+ public bool EnableInvalidObjectChecks { get; set; } = true;
+
public bool EnableColorLimitChecks { get; set; } = true;
public bool EnableNameLimitChecks { get; set; } = true;
public bool EnableTargetChecks { get; set; } = true;
- public bool EnableInvalidObjectChecks { get; set; } = true;
-
public bool ForbidProtocolExtensions { get; set; } = true;
}
}
/// Visible to all players.
/// </summary>
/// <param name="name">A name for the player.</param>
+ /// <exception cref="ImpostorProtocolException">Thrown when player doesn't have a PlayerInfo.</exception>
/// <returns>Task that must be awaited.</returns>
ValueTask SetNameAsync(string name);
/// Visible to all players.
/// </summary>
/// <param name="colorType">A color for the player.</param>
+ /// <exception cref="ImpostorProtocolException">Thrown when player doesn't have a PlayerInfo.</exception>
/// <returns>Task that must be awaited.</returns>
ValueTask SetColorAsync(ColorType colorType);
/// Visible to all players.
/// </summary>
/// <param name="hatId">An hat for the player.</param>
+ /// <exception cref="ImpostorProtocolException">Thrown when player doesn't have a PlayerInfo.</exception>
/// <returns>Task that must be awaited.</returns>
ValueTask SetHatAsync(string hatId);
/// Visible to all players.
/// </summary>
/// <param name="petId">A pet for the player.</param>
+ /// <exception cref="ImpostorProtocolException">Thrown when player doesn't have a PlayerInfo.</exception>
/// <returns>Task that must be awaited.</returns>
ValueTask SetPetAsync(string petId);
/// Visible to all players.
/// </summary>
/// <param name="skinId">A skin for the player.</param>
+ /// <exception cref="ImpostorProtocolException">Thrown when player doesn't have a PlayerInfo.</exception>
/// <returns>Task that must be awaited.</returns>
ValueTask SetSkinAsync(string skinId);
/// <exception cref="ImpostorProtocolException">Thrown when player is not the impostor.</exception>
/// <exception cref="ImpostorProtocolException">Thrown when player is dead.</exception>
/// <exception cref="ImpostorProtocolException">Thrown when target is dead.</exception>
+ /// <exception cref="ImpostorProtocolException">Thrown when player or target player doesn't have a PlayerInfo.</exception>
/// <returns>Task that must be awaited.</returns>
ValueTask MurderPlayerAsync(IInnerPlayerControl target, MurderResultFlags result);
/// <exception cref="ImpostorProtocolException">Thrown when player is not the impostor.</exception>
/// <exception cref="ImpostorProtocolException">Thrown when player is dead.</exception>
/// <exception cref="ImpostorProtocolException">Thrown when target is dead.</exception>
+ /// <exception cref="ImpostorProtocolException">Thrown when player or target player doesn't have a PlayerInfo.</exception>
/// <returns>Task that must be awaited.</returns>
[Obsolete("Please switch to version with the MurderResultFlags argument")]
ValueTask MurderPlayerAsync(IInnerPlayerControl target);
/// </summary>
/// <param name="target">Target player to protect.</param>
/// <exception cref="ImpostorProtocolException">Thrown when target is dead.</exception>
+ /// <exception cref="ImpostorProtocolException">Thrown when player or target player doesn't have a PlayerInfo.</exception>
/// <returns>Task that must be awaited.</returns>
ValueTask ProtectPlayerAsync(IInnerPlayerControl target);
/// Visible to all players.
/// </summary>
/// <exception cref="ImpostorProtocolException">Thrown if player to be exiled is already dead.</exception>
+ /// <exception cref="ImpostorProtocolException">Thrown when player or target player doesn't have a PlayerInfo.</exception>
/// <returns>Task that must be awaited.</returns>
ValueTask ExileAsync();
{
CheatCategory.ProtocolExtension => _antiCheatConfig.ForbidProtocolExtensions,
CheatCategory.GameFlow => _antiCheatConfig.EnableGameFlowChecks,
+ CheatCategory.InvalidObject => _antiCheatConfig.EnableInvalidObjectChecks,
CheatCategory.MustBeHost => _antiCheatConfig.EnableMustBeHostChecks,
CheatCategory.ColorLimits => _antiCheatConfig.EnableColorLimitChecks,
CheatCategory.NameLimits => _antiCheatConfig.EnableNameLimitChecks,
CheatCategory.Ownership => _antiCheatConfig.EnableOwnershipChecks,
CheatCategory.Role => _antiCheatConfig.EnableRoleChecks,
CheatCategory.Target => _antiCheatConfig.EnableTargetChecks,
- CheatCategory.InvalidObject => _antiCheatConfig.EnableInvalidObjectChecks,
CheatCategory.Other => true,
_ => LogUnknownCategory(category),
};