Ctrl+K

Running the Server

Startup Sequence

GameServer.main()
  ├─ Server.load()                    Reads Server.toml — hostname, ports, DB credentials
  ├─ Config.load()                    Calls fromIni(PropertiesParser) for each core config section
  ├─ ConfigsController.loadAll()      Loads all Engine module configs via AbstractConfigs.loadConfigs()
  ├─ L2DatabaseFactory.getInstance()  Initialises c3p0 connection pool
  ├─ GeoEngineManager.load()          Loads geodata blocks from disk
  ├─ [data tables]                    Items, NPCs, skills, spawns — Parser → Repository for each
  ├─ ScriptEngine.load()              Quest and NPC handlers from scripts/
  ├─ L2jhServerMods.checkl2jdrmods()  Initialises Engine modules that are enabled in config
  └─ GameServer network listener      Opens port 7777 — server is accepting connections

Recommended JVM Flags

java \
  -Xms2g \
  -Xmx4g \
  -XX:+UseZGC \
  -XX:+ZGenerational \
  -XX:ZAllocationSpikeTolerance=5 \
  -cp "bin/*:lib/*" \
  l2r.gameserver.GameServer
FlagReason
-XX:+UseZGCZ Garbage Collector — concurrent, low-latency
-XX:+ZGenerationalGenerational ZGC (Java 21+) — better throughput for short-lived objects
-XX:ZAllocationSpikeTolerance=5Tolerates burst allocation during large raid events without GC stalling
-Xmx4gIncrease to 6–8 GB if running 500+ players with all Engine modules enabled

Windows — DarkRiseLauncher

On Windows the recommended way to start the server is DarkRiseLauncher.exe, included in the dist/ output folder. It manages the Java path, JVM flags, database checks and both LoginServer + GameServer processes from a single GUI.

launcher_config.json

Located next to DarkRiseLauncher.exe. Edit before first run:

{
  "MySqlBinPath":  "C:\\xampp\\mysql\\bin",   // path to mysqldump / mysql.exe
  "MySqlHost":     "localhost",
  "MySqlPort":     3306,
  "LoginDbName":   "l2jdrgs",
  "LoginDbUser":   "root",
  "LoginDbPassword": "",
  "GameDbName":    "l2jdrgs",
  "GameDbUser":    "root",
  "GameDbPassword": "",

  "JavaPath":      "C:\\Program Files\\Java\\jdk-25.0.2\\bin\\java.exe",
  "JavaParams":    "-Xms512m -Xmx6G",          // JVM heap — adjust to your RAM

  "LoginServerPath": "C:\\server\\login",       // folder containing login/bin/
  "GameServerPath":  "C:\\server\\game",        // folder containing game/bin/
  "LibsPath":        "C:\\server\\libs",
  "SqlPath":         "C:\\server\\sql",

  "IsConfigured":              true,
  "IsDatabaseInstalled":       true,
  "IsLoginDbInstalled":        true,
  "IsGameDbInstalled":         true,
  "IsCustomTablesInstalled":   false
}
KeyDescription
JavaPathFull path to java.exe — must be JDK 21+
JavaParamsJVM flags passed at startup (-Xms / -Xmx etc.)
LoginServerPath / GameServerPathRoot folders of each server (contain bin/, libs/, config/)
MySqlBinPathRequired only if using the Launcher's built-in DB install / backup feature
Is*InstalledFlags tracked by Launcher to skip repeated DB install steps

Manual start (no Launcher)

java -Xms2g -Xmx6g -XX:+UseZGC -XX:+ZGenerational ^
     -XX:ZAllocationSpikeTolerance=5 ^
     -cp "bin\*;libs\*" l2r.gameserver.GameServer
pause

Expected Log Output

INFO  TomlConfigLoader   - Loaded TOML config: Server.toml (12 keys)
INFO  TomlConfigLoader   - Loaded TOML config: Rates.toml (18 keys)
INFO  ConfigsController  - Loaded PremiumServiceConfigs
INFO  L2DatabaseFactory  - Connection pool ready (size: 10)
INFO  ItemParser         - Loaded 4827 item templates
INFO  NpcParser          - Loaded 6193 NPC templates
INFO  SkillParser        - Loaded 2041 skills
INFO  SpawnTable         - Loaded 18462 spawn entries
INFO  GeoEngineManager   - Geodata loaded (regions: 176)
INFO  L2jhServerMods     - Premium System: Enabled.
INFO  L2jhServerMods     - Backup Manager: Enabled.
INFO  GameServer         - Server started on 0.0.0.0:7777

Graceful Shutdown

# SIGTERM or Ctrl+C triggers the JVM shutdown hook:
Shutdown.getInstance().run()
  ├─ Saves all online player data to DB
  ├─ Saves siege / olympiad state
  ├─ Closes connection pool
  └─ Disconnects from LoginServer

In-game GM command:

//admin restart 60   ← 60-second countdown with announce, then restart