Overview
The LoginServer handles player authentication, account management, and maintains the list of available game servers. Players connect to the LoginServer first, authenticate, then are redirected to the selected GameServer.Architecture
Network Configuration
Editlogin/config/Server.ini to configure LoginServer networking:
From
login/config/Server.ini:19-32, these settings control both client and GameServer connections.Port Configuration
| Port | Protocol | Purpose | Configurable |
|---|---|---|---|
| 2106 | TCP | Player client authentication | Yes (LoginserverPort) |
| 9014 | TCP | GameServer registration | Yes (LoginPort) |
Security Configuration
Failed Login Protection
Protect against brute-force attacks:Flood Protection
Defend against connection flooding:From
login/config/Server.ini:52-78, these settings prevent connection exhaustion attacks.Account Management
Auto Account Creation
Allow automatic account creation on first login:Manual Account Creation
IfAutoCreateAccounts = False, create accounts manually:
Game Server Registration
GameServers must be registered with the LoginServer before they can accept players.Register GameServer
- Automatic Registration
- Manual Registration
If The GameServer will:
AcceptNewGameServer = True, start the GameServer and it will automatically register.- Connect to LoginServer on port 9014
- Request server ID (from
game/config/Server.ini:42) - Receive hexid authentication key
- Save to
game/config/hexid.txt
Verify Registration
Check the database:You should see your registered GameServer with:
server_id: Your server IDhexid: Authentication keyhost: GameServer IP binding
Thread Configuration
Optimize LoginServer thread pools inlogin/config/Threads.ini:
LoginServer requires fewer threads than GameServer since it only handles authentication, not game logic.
Startup Configuration
Starting the LoginServer
- Linux
- Windows
LoginServerTask.sh at login/LoginServerTask.sh:8 handles:- Automatic restart on crash
- Log rotation
- JVM configuration from
java.cfg
JVM Configuration
Editlogin/java.cfg to adjust memory settings:
LoginServer requires minimal memory compared to GameServer. Default settings (128-256MB) are sufficient for most servers.
Scheduled Restart
Configure automatic LoginServer restarts:LoginServer restarts are typically coordinated with GameServer maintenance windows.
Health Checks
Verify LoginServer is running correctly:Check Server Process
Monitor Logs
Test Connectivity
Verify GameServer Connection
Check if GameServer is connected:Server List Configuration
The LoginServer presents a list of available GameServers to authenticated players. Configuration is split between LoginServer and GameServer.LoginServer Side
Inlogin/config/Server.ini:
GameServer Side
Ingame/config/Server.ini:
Configuration Files Summary
Key configuration files inlogin/config/:
| File | Purpose |
|---|---|
Server.ini | Core server settings, ports, security |
Database.ini | Database connection configuration |
Threads.ini | Thread pool settings |
Interface.ini | Interface configuration |
Troubleshooting
LoginServer Won’t Start
-
Check Java version:
-
Verify database connection:
-
Check port availability:
-
Review logs:
GameServer Can’t Register
Error: “Connection refused” to LoginServer-
Verify LoginServer is running:
-
Check LoginServer port is listening:
-
Verify
game/config/Server.inihas correct LoginServer address: -
Check
login/config/Server.iniallows registration:
Clients Can’t Connect
Error: “Cannot connect to LoginServer”-
Check LoginServer is running:
-
Verify firewall allows port 2106:
-
Check client configuration:
- Ensure client is pointed to correct LoginServer IP
- Verify protocol version matches (
AllowedProtocolRevisionsin GameServer)
Failed Login Attempts
Error: “Account is banned” or “Invalid password”-
Check account in database:
-
Check IP ban:
-
Reset ban counter:
- Wait for
LoginBlockAfterBanduration (default 15 minutes) - Or restart LoginServer to clear temporary bans
- Wait for
Production Checklist
Before going live:- Set
AutoCreateAccounts = Falsefor security - Configure proper
LoginTryBeforeBanand flood protection - Enable
ShowLicence = Truewith your server terms - Set
AcceptNewGameServer = Falseafter registration - Configure database backups
- Set up monitoring for ports 2106 and 9014
- Test authentication from external network
- Verify GameServer registration and connectivity
- Configure firewall rules
- Set up log rotation
Next Steps
With the LoginServer configured:- Configure the GameServer
- Review all configuration files
- Test the complete authentication flow