Skip to main content

Overview

Sakuya AC is configured through the config.py file in the root directory. This file contains all server settings, feature flags, and integration options.
Always backup your config.py before making changes. Invalid configurations may prevent the server from starting.

Logging Configuration

LOGGING_LEVEL
int
default:"INFO"
Sets the verbosity of server logs. Available levels:
  • DEBUG - Detailed information for diagnosing problems
  • INFO - General informational messages (recommended)
  • WARN - Warning messages for potentially harmful situations
  • CRITICAL - Critical errors that may cause server failure
from logging import DEBUG, INFO

# For production
LOGGING_LEVEL = INFO

# For debugging or submitting issues
LOGGING_LEVEL = DEBUG
When submitting bug reports, always use DEBUG level and include the logs.

Server Configuration

SERVER_HOST
str
default:"127.0.0.1"
The IP address or hostname of the native YSFlight server.
# Local server
SERVER_HOST = "127.0.0.1"

# Remote server
SERVER_HOST = "ysf.example.com"
SERVER_PORT
int
default:"7915"
The port where the native YSFlight server is running.
SERVER_PORT = 7915
This is the port of your actual YSFlight server, not the proxy port.
PROXY_PORT
int
default:"9000"
The port where Sakuya AC proxy server will listen for client connections.
PROXY_PORT = 9000
Players should connect to this port instead of the native server port.

YSFlight Version Configuration

YSF_VERSION
int
default:"20150425"
required
The version of your native YSFlight server.
YSF_VERSION = 20150425
This must match your actual YSFlight server version. Mismatched versions will cause connection issues.
Tested with version 20150425. Other versions may work but are not officially supported.
VIA_VERSION
bool
default:"True"
Enables the ViaVersion system to allow newer YSFlight clients to connect to older servers.
# Allow clients from different versions
VIA_VERSION = True

# Strict version matching
VIA_VERSION = False
This feature is experimental. See Version Compatibility for details.

Player Experience

WELCOME_MESSAGE
str
default:"Welcome {username} to the server!"
Message displayed to players when they join. Use {username} as a placeholder for the player’s name.
# Basic welcome
WELCOME_MESSAGE = "Welcome {username} to the server!"

# Custom message
WELCOME_MESSAGE = "Hello {username}! Type /help for commands."

# No username
WELCOME_MESSAGE = "Welcome to our YSFlight server!"
Example output:
Welcome Sakuya to the server!
PREFIX
str
default:"/"
The character or string that prefixes chat commands.
# Slash commands (common)
PREFIX = "/"

# Exclamation commands
PREFIX = "!"

# Custom prefix
PREFIX = "."
With PREFIX = "/", players use commands like:
  • /help
  • /info
  • /spawn

Anti-Cheat Features

G_LIM
float
default:"4"
G-force limit before a player is killed. When abs(g) >= G_LIM, the player’s aircraft is destroyed.
# Realistic limit
G_LIM = 4

# Stricter limit
G_LIM = 3

# Effectively disabled
G_LIM = 100
Set to a high value like 100 to effectively disable the G-limiter.
HEALTH_HACK_MESSAGE
str
default:"Detected for health hack"
Message displayed when health hacking is detected. The player’s name is automatically appended.
HEALTH_HACK_MESSAGE = "Detected for health hack"
# Displays: "Detected for health hack <player name>"

HEALTH_HACK_MESSAGE = "Kicked for invulnerability exploit by"
# Displays: "Kicked for invulnerability exploit by <player name>"

Damage System

SMOKE_PLANE
bool
default:"True"
Enables visual and functional damage effects when aircraft health is low.
# Enable damage effects
SMOKE_PLANE = True

# Disable damage effects
SMOKE_PLANE = False
When enabled and health drops below SMOKE_LIFE:
  • Aircraft emits black smoke
  • Engine breakdown (no afterburner)
  • Missiles cannot be fired
SMOKE_LIFE
float
default:"5"
Health threshold below which smoke and damage effects are applied (only when SMOKE_PLANE = True).
# Smoke at low health
SMOKE_LIFE = 5

# Smoke earlier
SMOKE_LIFE = 10

Discord Integration

DISCORD_ENABLED
bool
default:"False"
Enables Discord chat integration for bidirectional messaging between Discord and in-game chat.
# Enable Discord integration
DISCORD_ENABLED = True

# Disable Discord integration
DISCORD_ENABLED = False
See Discord Integration for setup instructions.
DISCORD_TOKEN
str
default:"DISCORD_BOT_TOKEN"
Your Discord bot token for API authentication.
DISCORD_TOKEN = "MTIzNDU2Nzg5MDEyMzQ1Njc4OQ.GhIjKl.MnOpQrStUvWxYzAbCdEfGhIjKlMnOpQrStUv"
Keep this token secret! Never commit it to public repositories.
Get your token from the Discord Developer Portal.
CHANNEL_ID
int
default:"0"
The Discord channel ID where messages will be synchronized.
CHANNEL_ID = 1234567890123456789
To get a channel ID:
  1. Enable Developer Mode in Discord (User Settings > Advanced)
  2. Right-click the channel
  3. Select “Copy Channel ID”
The bot must have permission to read and send messages in this channel.

Example Configuration

config.py
from logging import DEBUG, WARN, INFO, CRITICAL

# Logging
LOGGING_LEVEL = INFO

# Server
SERVER_HOST = "127.0.0.1"
SERVER_PORT = 7915
PROXY_PORT = 9000

# Player Experience
WELCOME_MESSAGE = "Welcome {username}! Type /help for commands."
PREFIX = "/"

# Version
YSF_VERSION = 20150425
VIA_VERSION = True

# Anti-Cheat
G_LIM = 4
HEALTH_HACK_MESSAGE = "Detected for health hack"

# Damage System
SMOKE_PLANE = True
SMOKE_LIFE = 5

# Discord Integration
DISCORD_ENABLED = True
DISCORD_TOKEN = "your_bot_token_here"
CHANNEL_ID = 1234567890123456789

Troubleshooting

Server won’t start

  • Verify YSF_VERSION matches your YSFlight server
  • Check that PROXY_PORT is not already in use
  • Ensure SERVER_HOST and SERVER_PORT are correct

Discord integration not working

  • Install dependencies: pip install -r requirements.txt
  • Verify bot has Message Content Intent enabled
  • Check that CHANNEL_ID is correct
  • Ensure bot has Read/Send Messages permissions

Players can’t connect

  • Confirm they’re connecting to PROXY_PORT, not SERVER_PORT
  • Check firewall settings for PROXY_PORT
  • Review logs with LOGGING_LEVEL = DEBUG

Build docs developers (and LLMs) love