> 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/bridgeserver/bridgeserver-ini.md).

# BridgeServer.ini

Every BridgeServer setting lives in one INI section.

## File Location

```
BridgeServer/BridgeServer.ini
```

Read once at startup. Restart BridgeServer after any change.

## Full File

```ini
[BridgeServerInfo]
IngestPortTCP = 55980
HttpPort = 55981
MaxIpConnection = 10
SharedKey =
DiscordWebhookUrl =
DiscordRelayAll = 1
MuDbODBC = MuOnline
MuDbRefreshSeconds = 60
LicenseKey = PUT-YOUR-LICENSE-KEY-HERE
```

## Settings

| Key                  | Type                    | Default | Effect                                                                                                                                                                                                                                                 |
| -------------------- | ----------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `IngestPortTCP`      | port                    | `55980` | Where GameServers push events. Must match `Port` in the [Bridge plugin config](/docs/data/plugins/bridge.md). **Keep this private**                                                                                                                    |
| `HttpPort`           | port                    | `55981` | The read-only [HTTP API](/docs/bridgeserver/api.md) for your website, bots and dashboards                                                                                                                                                              |
| `MaxIpConnection`    | int                     | `0`     | Maximum simultaneous ingest connections per source IP. `0` **blocks every ingest connection** - never use it. The shipped template uses `10`; if the key is missing from the file the parser also defaults to `0` and no GameServer can publish events |
| `SharedKey`          | string (up to 32 chars) | empty   | Key a GameServer must present to publish events. Empty = accept any GameServer, which is fine on localhost and nowhere else                                                                                                                            |
| `DiscordWebhookUrl`  | URL                     | empty   | Discord webhook for the built-in announce relay. Empty = relay disabled                                                                                                                                                                                |
| `DiscordRelayAll`    | 0/1                     | `1`     | `1` = mirror **every** event to the webhook (demonstration mode). `0` = announcement-worthy events only                                                                                                                                                |
| `MuDbODBC`           | DSN name                | empty   | ODBC data source for the game database, used for rankings and profiles. Empty = those endpoints return 503                                                                                                                                             |
| `MuDbUSER`           | string                  | empty   | SQL username, only for data sources that are not using Windows authentication                                                                                                                                                                          |
| `MuDbPASS`           | string                  | empty   | SQL password, only for data sources that are not using Windows authentication                                                                                                                                                                          |
| `MuDbRefreshSeconds` | int                     | `60`    | How often ranking caches are rebuilt from the database                                                                                                                                                                                                 |
| `LicenseKey`         | string                  | -       | The same license key as your other AXIOM servers                                                                                                                                                                                                       |

## Database Access

`MuDbODBC` follows the same pattern as `DataServerODBC` in [DataServer.ini](/docs/dataserver/dataserver-ini.md): create a System DSN on the machine running BridgeServer and name it here. Authentication normally comes from the data source itself (Windows authentication), which is why `MuDbUSER` and `MuDbPASS` are usually left empty.

Access is read-only. BridgeServer issues queries for rankings, character and guild profiles, castle siege state and population counts, and never writes.

{% hint style="warning" %}
Point BridgeServer at a read-only SQL login if your setup allows it. Nothing in BridgeServer needs write access, and a least-privilege login makes that guarantee structural rather than a promise.
{% endhint %}

## Ranking Cache

Ranking lists are rebuilt on a timer and served from memory, so ranking requests never queue behind your game traffic. `MuDbRefreshSeconds = 60` means rankings can be up to a minute stale, which is almost always the right trade. Character, guild and siege lookups are answered live because they are keyed by name and cheap.

Lowering this to a few seconds puts real load on the game database. Raising it costs nothing but freshness.

## Examples

{% tabs %}
{% tab title="Localhost development" %}

```ini
[BridgeServerInfo]
IngestPortTCP = 55980
HttpPort = 55981
MaxIpConnection = 10
SharedKey =
DiscordWebhookUrl = https://discord.com/api/webhooks/...
DiscordRelayAll = 1
MuDbODBC = MuOnline
MuDbRefreshSeconds = 60
LicenseKey = ...
```

No shared key, every event mirrored to a test channel.
{% endtab %}

{% tab title="Production" %}

```ini
[BridgeServerInfo]
IngestPortTCP = 55980
HttpPort = 55981
MaxIpConnection = 4
SharedKey = a-long-random-string
DiscordWebhookUrl = https://discord.com/api/webhooks/...
DiscordRelayAll = 0
MuDbODBC = MuOnlineReadOnly
MuDbRefreshSeconds = 60
LicenseKey = ...
```

Keyed ingest, announcements only, read-only database login.
{% endtab %}

{% tab title="API only, no Discord" %}

```ini
[BridgeServerInfo]
IngestPortTCP = 55980
HttpPort = 55981
MaxIpConnection = 4
SharedKey = a-long-random-string
DiscordWebhookUrl =
DiscordRelayAll = 0
MuDbODBC = MuOnlineReadOnly
MuDbRefreshSeconds = 60
LicenseKey = ...
```

Your own bot reads the [API](/docs/bridgeserver/api.md) and does the routing.
{% endtab %}
{% endtabs %}

## Network Exposure

* **Ingest port**: GameServers only. On a single-host setup keep it on `127.0.0.1`; across hosts, restrict it at the firewall to your GameServer addresses.
* **HTTP port**: read-only, but it does publish player names, locations and chat. Put it behind a reverse proxy if you want TLS, caching or rate limiting - BridgeServer does none of those itself.

## Common Issues

* **BridgeServer exits immediately** - `LicenseKey` missing or invalid, or the `axiom-bridge` module is not on the license
* **A port fails to bind** - another process already holds `IngestPortTCP` or `HttpPort`
* **GameServer connects and is dropped** - `SharedKey` here and `Key` in the plugin config are not identical
* **GameServers cannot publish events at all** - `MaxIpConnection` is `0` or missing from the file
* **Rankings return 503** - `MuDbODBC` is empty, the DSN does not exist on this machine, or the first refresh has not finished
* **Database connects but rankings are empty** - the DSN points at the wrong database, or the login cannot read the game tables
* **Discord is flooded** - `DiscordRelayAll = 1`; set it to `0` for announcements only

## Related

* [BridgeServer overview](/docs/bridgeserver/bridgeserver.md)
* [HTTP API](/docs/bridgeserver/api.md)
* [Bridge Config.xml](/docs/data/plugins/bridge.md) - GameServer side
