Overview

Data\ServerMap.xml lists every GameServer (sub server), one <Server ... /> line per sub. This file is read by:

  • ConnectServer: to send the server list to the client (reloaded every ServerListReloadSeconds seconds, so edits do not require restarting ConnectServer).
  • Each GameServer: it finds its own line using the ServerCode written in GameServer.conf. GameServer only reads the file at startup, so after editing a sub's line, restart that sub.
In this file you must not write comments inside a tag (between < and />). Only write comments outside tags.

Attributes of <Server>

Attribute Example Meaning
ServerIndex 0 Index used by ConnectServer when the client selects a server. Set it equal to ServerCode.
ServerCode 0 Unique code of the GameServer; it must match the ServerCode in that sub's GameServer.conf. Server group = ServerCode / 20 (0-19 = group 1, 20-39 = group 2...), and the sub's number within the group = ServerCode % 20. The group name players see comes from the client's server list file, not from this file.
ServerName "Sub-NonPvp" Name used in the ConnectServer log; it is not shown to players. (Special subs are recognized by ServerName in GameServer.conf, not here.)
ServerPort 55521 TCP port the GameServer listens on and the client connects to. Open this port on the firewall / modem. Each sub needs a different port.
ServerIP "203.0.113.10" IP the client connects to (the public IP for players outside your network). This is the address sent to players; you must change it to your server's IP (the sample value here is for illustration only).
Display 1 1 = shown in the client's server selection list; 0 = hidden (special subs reachable only by moving in-game: Event, Siege, ArkaWar...).
DefaultWorld 0 Map where the character is placed when the character's saved map does not belong to this sub and the character class's starting map does not belong to this sub either (see MapList.xml for map numbers).
DefaultX, DefaultY 75, 75 X, Y coordinates (0 - 255) on DefaultWorld.
ServerType 1 The sub's PvP rule, and also the label shown in the client's server list: 0 = PvP (PK allowed), 1 = Non-PvP (PK banned on the whole sub), 2 = Gold PvP, 3 = Gold Non-PvP.

Sample file in the package

ServerCode ServerName Port Display ServerType Meaning
0 Sub-NonPvp 55521 1 1 Non-PvP sub, group 1
1 Sub-Pvp 55522 1 0 PvP sub, group 1
2 Sub-VIP 55523 1 2 Gold PvP sub, group 1
17 ArkaWar 55937 0 0 Arka War, hidden
18 Event 55938 0 0 Event, hidden
19 Siege 55939 0 0 Castle Siege, hidden
20 - 22, 37 - 39 (same as group 1) 55541 - 55543, 55957 - 55959 - - Same set of subs for group 2 (code = group 1 code + 20)
100 BattleCore 55604 1 0 [NEEDS CHECK: the BattleCore line has no GameServer folder in the package; its purpose and whether it should be kept]

You are not required to use group 2: delete lines 20 - 39 if you run only one group, or use group 2 for a second set of servers (see Multiple servers on one machine).

Sub types

PvP and Non-PvP

  • ServerType="0": PvP sub, players can fight each other (PK). To allow PK you also need PVPEnabled="1" in Data\Character\PKSystem.xml (the <CharacterPK ... /> line); if set to 0, no sub allows PK.
  • ServerType="1" (or 3): Non-PvP sub, GameServer automatically bans PK across the whole sub even if PVPEnabled is 1 (on other subs PK works normally).
  • The PvP / Non-PvP / Gold label shown next to the server name in the client comes from this attribute.

Gold / VIP

  • ServerType="2" (Gold PvP) or "3" (Gold Non-PvP): the sub is only for accounts with unexpired VIP. Accounts with expired VIP or outside the allowed level range are rejected when selecting the server (returned to the server list) and kicked if already playing. Admin accounts can always enter.
  • The VIP level limits for each sub are set in Data\VIPSystem.xml, in the <VIPServers> section:
    <VIPServers RatesChangeMessage="1">
    	<Server Code="2" VipMin="1" VipMax="15" />
    </VIPServers>
    Code is the sub's ServerCode; VipMin / VipMax are the VIP levels allowed in (-1 or omitted = no limit on that end). If a Gold sub has no line here, every unexpired VIP can enter. A non-Gold sub can also be VIP-only if it has VipMin / VipMax here.
  • AccessType in the same tag: -2 = everyone can enter and VIP benefits are not applied; -1 = everyone can enter, VIP still receives benefits (default for subs not listed); 0 - 99 = only VIP from that level up (the old way, equivalent to VipMin).
  • If you want the VIP sub to have its own data (monster spawns, different drops), use DataPath in that sub's GameServer.conf (see GameServer).
In the package's sample VIPSystem.xml, the <VIPServers> line is set to Code="12", which does not match any sub in the sample ServerMap.xml. Change Code to the real ServerCode of your Gold / VIP sub.

Castle Siege

The sub that runs Castle Siege. Setup: folder 5.GameServer_Siege, ServerName = "Siege" and ServerType = 1 in GameServer.conf; the sample ServerMap line is ServerCode="19" with Display="0" (hidden from the list, players get there by moving in-game). The name "Siege" is the condition that identifies the Castle Siege sub.

Event

The sub that runs map events (Event Map). Setup: ServerName = "Event" and ServerType = 2 in GameServer.conf; the sample ServerMap line is ServerCode="18", Display="0". Reloading and starting Event Map only happens on the sub named "Event".

Arka War

The sub that runs Arka War. Setup: ServerName = "ArkaWar" and ServerType = 3 in GameServer.conf; the sample ServerMap line is ServerCode="17", Display="0".

The three subs Siege / Event / ArkaWar are recognized by ServerName in GameServer.conf (case-insensitive), so do not change these 3 names. Each type should have only one sub per group.

Reset / Non-Reset server

This is a game-wide setting, located in Data\Common.ini, section [Gerenal]:

Key Value Meaning
ResetServer 1 Reset server: characters can be reset (back to level 1, keeping master level). While the normal level has not reached LevelNormalMax, the character only receives normal EXP, not master EXP.
ResetServer 0 Non-Reset server: the reset feature is turned off (the reset web page and scripts cannot increase the reset count). The sample package uses 0.

This key applies to the GameServers that read the same Common.ini file. [NEEDS CHECK: whether ResetServer can be set differently per sub using a separate DataPath + separate Common.ini]

Procedure for adding / changing a sub

  1. Add or edit the line in ServerMap.xml (ServerCode, port, IP, type).
  2. Write the same ServerCode into the sub's GameServer.conf.
  3. Set ServerIP to the public IP and open ServerPort on the firewall.
  4. Restart the sub's GameServer (ConnectServer reloads the list by itself after at most ServerListReloadSeconds seconds, only when a player requests the list).