Skip to main content
Sakuya AC includes a built-in anti-cheat system that monitors player aircraft states to detect and report suspicious behavior, specifically health hacking.

How It Works

The anti-cheat system monitors each player’s aircraft health (life) in real-time. When a player’s health increases without a legitimate repair action, the system flags this as potential cheating.

Detection Logic

The health hack detection runs on every FSNETCMD_AIRPLANESTATE packet:
if player.aircraft.prev_life < player.aircraft.life and player.aircraft.prev_life != -1 and not player.aircraft.just_repaired:
    cheatingMsg = YSchat.message(f"{HEALTH_HACK_MESSAGE} by {player.username}")
    warning(f"Health hack detected for {player.username}, Connected from {player.ip}")
    message_to_server.append(cheatingMsg)
Detection triggers when:
  • Previous health is less than current health (health increased)
  • Previous health is not -1 (player has spawned)
  • Aircraft was not just repaired (legitimate health increase)

What Happens on Detection

  1. A warning message is logged to the server console
  2. A broadcast message is sent to all players on the server
  3. The player’s IP address is logged for admin review
The system does not automatically kick or ban players. Server administrators must review detections and take action manually.

Configuration

Configure the anti-cheat message in config.py:
# Will appear as message + player name
# eg. Detected health hack by <player name>
HEALTH_HACK_MESSAGE = "Detected for health hack"

Example Output

When a health hack is detected, all players will see:
Detected for health hack by PlayerUsername

Technical Details

The aircraft state tracking updates with every flight data packet, typically multiple times per second. This ensures rapid detection of health anomalies.

State Tracking

The proxy tracks:
  • player.aircraft.prev_life - Previous health value
  • player.aircraft.life - Current health value
  • player.aircraft.just_repaired - Flag set when weapon config changes (repair)

Legitimate Health Increases

The system accounts for legitimate health increases: Weapon Config Changes: When a player repairs/changes loadout, the on_weapon_config hook sets just_repaired = True, preventing false positives.
elif packet_type == "FSNETCMD_WEAPONCONFIG":
    # Triggers plugin hook that sets just_repaired flag
    pass

Logging

Detections are logged with WARNING level:
WARNING [proxy.py:195]: Health hack detected for PlayerName, Connected from 192.168.1.100
For detailed anti-cheat logging, set LOGGING_LEVEL = DEBUG in config.py during troubleshooting.
  • The anti-cheat system runs independently of other proxy features
  • Works alongside all plugins without interference
  • Compatible with ViaVersion and Discord integration

Build docs developers (and LLMs) love