The XMage server reads all of its runtime settings from a single XML file at startup. Understanding each attribute lets you tune connection capacity, enforce player registration, integrate email, and control how many AI opponents the server will host simultaneously.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/magefree/mage/llms.txt
Use this file to discover all available pages before exploring further.
Config File Location
By default the server looks for the config file atconfig/config.xml relative to its working directory (the folder that contains the server JAR). You can override this path with the JVM system property:
xmage.config.path.
Complete <server> Element
The entire configuration lives inside a single <server> element. The following block mirrors the default values that ship with the XMage repository:
Attribute Reference
Network
IP address or domain name the server socket binds to. Use
0.0.0.0 to listen on all available network interfaces. For a public server, set this to the externally reachable IP or hostname (e.g. xmage.mydomain.com) so clients can identify the server correctly.Human-readable display name shown to connecting clients in the server browser.
TCP port for the primary server socket. Clients connect to this port first. Open this port in your firewall.
Port for the secondary (callback) socket used by the JBoss Remoting bisocket transport for server-to-client callbacks. Set to
-1 to let the OS pick an arbitrary available port automatically.Threading and Connection Queuing
Maximum number of pending (not yet accepted) incoming connections held in the OS queue. When this queue fills up, new connection attempts are rejected. Corresponds to the JBoss Remoting
backlogSize connector attribute; JBoss default is 200.Number of threads listening on the server socket for new connections. JBoss default is
1; XMage ships with 2.Maximum number of server worker threads that can exist at any one time. Each active client request occupies a worker thread. JBoss default is
300.Sizing
maxPoolSize: Idle worker threads are reclaimed after a 5-minute timeout, but if all worker threads are busy, new clients freeze in the connection dialog until one becomes free or backlogSize overflows. A good rule of thumb is maxPoolSize ≥ expected simultaneous active connections × 20.Client heartbeat lease period in milliseconds. Setting this to a value greater than
0 enables server-side detection of dead clients. The server will consider a client dead if it hasn’t sent a heartbeat within this window.Timeout in milliseconds for socket write operations. Any write that doesn’t complete within this period causes the connection to be dropped.
Game Limits
Maximum number of games that can run simultaneously on this server. Attempts to start additional games beyond this limit will be queued or rejected.
Number of seconds a player may be idle before the server automatically concedes the game on their behalf. Set higher for casual servers with slower players.
Maximum number of active workable AI opponents (
Computer - mad and Computer - monte carlo) the server will permit simultaneously. Draft bots (Computer - draftbot) are excluded from this count and are always unlimited.When
true, enables the game save and replay system. This feature is noted as not fully working in the current codebase; leave false unless you are developing the save/replay subsystem.Username and Password Constraints
Minimum number of characters allowed in a player’s username.
Maximum number of characters allowed in a player’s username.
A Java regular expression. Any character matching this pattern is considered invalid in a username. The default rejects everything except lowercase letters, digits, and underscores.
Minimum password length enforced at registration (only relevant when
authenticationActivated="true").Maximum password length enforced at registration.
Authentication
When
true, players must register an account and log in before they can join the server. When false, anyone can connect with any username without a password.Mail Settings
These attributes are only consulted whenauthenticationActivated="true". They control how the server sends account-verification and password-reset emails.
Google account integration — not currently supported. Leave empty.
API key from your Mailgun account (e.g.
key-12121111...). Used when mailUser is empty — in that case XMage uses the Mailgun HTTP API instead of a native SMTP server.Mailgun sending domain associated with the API key above.
Hostname of the SMTP server used when
mailUser is set (native SMTP path).Port of the SMTP server (e.g.
587 for STARTTLS, 465 for SMTPS).Username for SMTP authentication. When non-empty, XMage uses native SMTP; when empty, XMage falls back to Mailgun.
Password for the SMTP account specified in
mailUser.The
From: address on all outgoing mail (e.g. noreply@xmage.mydomain.com).Enabling Authentication
To require players to register before connecting, setauthenticationActivated="true" and configure at least one mail delivery path so that the server can send verification emails.
Using SMTP (recommended for self-hosted mail):
JVM Launch Flags
Several runtime behaviours are controlled by JVM system properties (-Dkey=value) rather than config.xml. These are parsed in Main.java before the config file is read and have the highest precedence.
| Property | Argument equivalent | Purpose |
|---|---|---|
-Dxmage.testMode=true | -testMode=true | Enable test/cheat mode: fast game buttons, no deck validation, simplified login, debugger-safe ping disabling |
-Dxmage.detailsMode=true | -detailsMode=true | Emit additional server-side detail logs |
-Dxmage.adminPassword=<pw> | -adminPassword=<pw> | Set the admin console password at launch time |
-Dxmage.config.path=<path> | (property only) | Override the default config/config.xml path |
In a developer build (where
MageVersion.isDeveloperBuild() returns true), test mode is enabled by default even without the flag. Always set -Dxmage.testMode=false explicitly in production deployments built from source.