> For the complete documentation index, see [llms.txt](https://axiomemu.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://axiomemu.gitbook.io/docs/data/mapserverinfo.md).

# MapServerInfo.xml

Tells each GameServer which maps it is authoritative for in a deployment where multiple GameServer processes split the world. Used by global-broadcast and cross-server transfer code paths.

## File Location

```
Data/MapServerInfo.xml
```

Loaded once at GameServer startup. Changes require a restart.

## Schema

```xml
<MapServerInfo>
    <Server Code="..." Group="..." Init="..." Ip="..." Port="..." />
    <ServerMapping ServerCode="..." NotMoveOption="..."
                   NextMap="..." NextServerCode="..." />
</MapServerInfo>
```

`<Server>` entries register each GameServer instance. `<ServerMapping>` entries are optional per-map overrides that adjust routing for a specific map on a specific server. Most installations only need `<Server>` rows.

## Server Attributes

| Attribute | Type        | Range   | Default      | Effect                                                                                                                                                                                                                                                                                                                                   |
| --------- | ----------- | ------- | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Code`    | int         | 0-N     | *(required)* | GameServer `ServerCode` (matches Common.dat `ServerCode` and ConnectServer `ServerList.xml` `<Server Code>`)                                                                                                                                                                                                                             |
| `Group`   | int         | 0 to 19 | *(required)* | Map-server group this instance belongs to. Servers in the same group are treated as siblings for cross-server routing and global broadcasts. Up to 20 groups, up to 20 entries per group                                                                                                                                                 |
| `Init`    | -1, 0, or 1 |         | *(required)* | Initial ownership mode for every map on this server before any `<ServerMapping>` override: `1` = this server owns all maps (standard single-GS setup), `0` = all maps default to "random sibling" routing, `-1` = all maps default to "destination only" (no map is owned here unless explicitly mapped in). Any other value aborts load |
| `Ip`      | string      | IPv4    | *(required)* | IP of that GameServer. The loader strips a single leading `S` if present (`S127.0.0.1` resolves to `127.0.0.1`); bare IPv4 works too                                                                                                                                                                                                     |
| `Port`    | int         | 1-65535 | *(required)* | TCP port of that GameServer                                                                                                                                                                                                                                                                                                              |

## ServerMapping Attributes

Use `<ServerMapping>` rows when you need one server in a group to hand off specific maps to another server in the same group (for example, instanced events hosted on a dedicated process).

| Attribute        | Type   | Effect                                                                                                                                                                   |
| ---------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `ServerCode`     | int    | The `<Server>` row whose map routing this entry modifies. Must already be registered above                                                                               |
| `NotMoveOption`  | 0 or 1 | `0` = route the listed map to `NextServerCode`, `1` = claim the listed map as locally owned on `ServerCode` (regardless of `Init`)                                       |
| `NextMap`        | int    | Map index (must be a valid in-range map number)                                                                                                                          |
| `NextServerCode` | int    | Destination GameServer `Code`. Ignored when `NotMoveOption="1"`. Use `-1` to let the server pick a random sibling that owns the map; `-2` to use the first sibling found |

## Single vs Multi Server

On a **single-GameServer** installation, ship one `<Server>` entry with `Init="1"`. That server owns every map. Most installations run this way.

On a **multi-GameServer** installation, add one `<Server>` row per process. Group IDs let you cluster servers that should share cross-server routing and global notices. All servers still share the same DataServer and JoinServer regardless of grouping.

{% hint style="warning" %}
The file must contain a `<Server>` entry whose `Code` matches this GameServer's own `ServerCode` from [Common.dat](/docs/gameserver/common-dat.md). If it does not, startup aborts with "This GameServerCode doesn't Exist".
{% endhint %}

## Relationship to ConnectServer

ConnectServer's `ServerList.xml` controls what the **client** sees on the server selection screen. `MapServerInfo.xml` controls how GameServer instances **find each other** for global operations. They are independent:

* A GameServer can be listed here and hidden in `ServerList.xml` (rare; used for internal-only maps)
* A GameServer listed in `ServerList.xml` must also appear here if it participates in global broadcasts

## Examples

{% tabs %}
{% tab title="Single GameServer" %}
{% code title="MapServerInfo.xml" %}

```xml
<?xml version="1.0"?>
<MapServerInfo>
    <Server Code="0" Group="0" Init="1" Ip="S127.0.0.1" Port="55901" />
</MapServerInfo>
```

{% endcode %}

One GameServer, one group, runs everything.
{% endtab %}

{% tab title="Two GameServers, one group" %}
{% code title="MapServerInfo.xml" %}

```xml
<?xml version="1.0"?>
<MapServerInfo>
    <Server Code="0" Group="0" Init="1" Ip="S10.0.0.10" Port="55901" />
    <Server Code="1" Group="0" Init="0" Ip="S10.0.0.11" Port="55901" />
</MapServerInfo>
```

{% endcode %}

Code 0 is the group initializer; Code 1 joins the same group. Global notices broadcast from either server reach both.
{% endtab %}

{% tab title="Two groups" %}
{% code title="MapServerInfo.xml" %}

```xml
<?xml version="1.0"?>
<MapServerInfo>
    <Server Code="0" Group="0" Init="1" Ip="S10.0.0.10" Port="55901" />
    <Server Code="1" Group="0" Init="0" Ip="S10.0.0.11" Port="55901" />
    <Server Code="20" Group="1" Init="1" Ip="S10.0.0.20" Port="55902" />
</MapServerInfo>
```

{% endcode %}

Two independent groups. Global broadcasts from Group 0 reach Codes 0 and 1 only; from Group 1 reach Code 20 only.
{% endtab %}
{% endtabs %}

## Cross-File Dependencies

| Attribute                     | Related in                                                                                                                                                                                                                                                              |
| ----------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Code`                        | Must match [Common.dat](/docs/gameserver/common-dat.md) `ServerCode` on that GameServer, and the `<Server Code>` in ConnectServer's [ServerList.xml](/docs/connectserver/serverlist-xml.md)                                                                             |
| `Ip` + `Port`                 | Must be reachable from every other GameServer in the same group for cross-server messaging. Client-facing routing is independent and lives in [ServerList.xml](/docs/connectserver/serverlist-xml.md) and [ConnectServer.ini](/docs/connectserver/connectserver-ini.md) |
| `Group`                       | Used by global notice + post commands (see [Command.dat](/docs/gameserver/command-dat.md))                                                                                                                                                                              |
| `NextMap` / per-map overrides | The map indices listed here must exist in [MapManager.xml](/docs/data/mapmanager.md)                                                                                                                                                                                    |

## Common Issues

* **Global notice from `/gmpost` reaches only one server** - the other server is in a different `Group`, or is missing from this file
* **"No Space to Save SvrInfo" error at startup** - more than 20 `<Server>` entries in a single group. Split across groups (up to 20 groups allowed)
* **Startup fails with "No IpAddress"** - the `Ip` attribute is empty
* **Startup fails with "iInitSetting Value"** - `Init` must be `-1`, `0`, or `1`. Any other value rejects the file
* **Startup fails with "This GameServerCode doesn't Exist"** - no `<Server>` row matches this process's own `ServerCode`
* **Servers do not see each other despite correct IPs** - firewall blocking the inter-server port, or `Ip` contains a leading character other than `S` (the loader strips only `S`)
