> 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/experiencetable/gamemaster.md).

# GameMaster.xml & CtlCode

GM setup - GameMaster.xml command levels and the Character.CtlCode database column

Making someone a Game Master involves **two independent switches**. They do different things, neither implies the other, and mixing them up is the usual cause of "my GM has no commands" or "my GM cannot use skills".

| Switch                         | Where                       | What it grants                                                         |
| ------------------------------ | --------------------------- | ---------------------------------------------------------------------- |
| `Level` in `GameMaster.xml`    | Config file, GameServer     | Permission to run slash commands                                       |
| `CtlCode` on the character row | `Character` table, database | In-game GM *status*: aura, monster immunity, trade unlock, name colour |

{% hint style="success" %}
**Short answer:** put `Level="32"` in `GameMaster.xml` and set `CtlCode = 32` on the character row. Never use `CtlCode = 8`.
{% endhint %}

## File Location

```
Data/Util/GameMaster.xml
```

Loaded at GameServer startup. `/reload util` reloads it without a restart, and the new GM list applies at once, even to characters already online. With no GM set up yet, use `reload.util` in the Server Manager's **Commands** tab (or the GameServer window's Reload menu) instead.

## Schema

```xml
<GameMasterList>
    <GameMaster Account="admin" Character="Qubit_ADM" Level="32" />
</GameMasterList>
```

| Attribute   | Type                 | Effect                                                                  |
| ----------- | -------------------- | ----------------------------------------------------------------------- |
| `Account`   | string, max 10 chars | Account name as stored in `MEMB_INFO`. Must match the character's owner |
| `Character` | string, max 10 chars | Character name under that account                                       |
| `Level`     | byte (0-255)         | GM command level. Higher = more privilege                               |

Entries are keyed internally by `Character` name - listing the same character twice keeps only the first row. An entry whose `Account` or `Character` exceeds 10 characters is skipped with a red log line instead of loading.

### What Level actually means

`Level` is an arbitrary number with **no hard-coded tiers**. The only rule the GameServer applies is:

> the character's stored `Level` must be **greater than or equal to** the `GameMaster=` attribute of the command being run ([Command.xml](/docs/data/command-xml.md)).

The value `32` in the shipped file is a convention, not a bitmask, and has nothing to do with `CtlCode = 32` despite looking identical.

| Level | Typical role                                                              |
| ----- | ------------------------------------------------------------------------- |
| `0`   | Not a GM - entry is effectively disabled                                  |
| `1`   | Event host / helper commands (all built-in event commands gate on `>= 1`) |
| `32`  | Full admin - the level used by the stock command gates in Command.xml     |

Commands whose `GameMaster=` is `0` or missing are available to every player.

## Character.CtlCode

`Character.CtlCode` is a `tinyint` **bitmask** column, default `0`. The DataServer only ever reads it (the single writer is the `WZ_DesblocAccount` stored procedure, which clears `CtlCode = 1` once a block expires), so it is safe to edit by hand or with the AXIOM Editor. It is read when the character enters the game - relog to apply.

| Value | Name               | Effect                                                                                                                                                                                                                  |
| ----- | ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `0`   | Normal             | Ordinary player                                                                                                                                                                                                         |
| `1`   | Character blocked  | GameServer drops the connection when the character enters. Character select shows it as blocked. Auto-cleared by `WZ_DesblocAccount` when `bloc_expire` passes                                                          |
| `2`   | Item block         | Cannot pick up, drop or move items (inventory, trade, warehouse). Character select warns about it                                                                                                                       |
| `4`   | For TV             | Client-only spectator camera mode                                                                                                                                                                                       |
| `8`   | **Observer GM**    | GameServer `Authority = 2`: monsters ignore the character. Client marks it a non-attacking GM - **all attacks and all targeted skills are refused client-side**                                                         |
| `16`  | Account item block | Same restriction as `2`                                                                                                                                                                                                 |
| `32`  | **GM**             | GameServer `Authority = 32`: GM aura effect, GM ring support, monsters ignore the character, trade-block bypass, immunity to some player skills, hidden from viewport while invisible. Attacks and skills work normally |
| `128` | Manager move char  | Client-only marker in the character info balloon                                                                                                                                                                        |

Bits combine, but the two GM bits do not: `Authority` is assigned, not accumulated, and `32` wins over `8` when both are set.

{% hint style="danger" %}
**`CtlCode = 8` breaks skills, and that is by design.** It is the observer/TV GM flag. The client's attack check refuses every attack and every targeted skill for a character carrying it, so the character looks fine but nothing casts. If your GM "cannot use any skills", this is why. Use `32`.
{% endhint %}

## The Two Switches Together

| GameMaster.xml | CtlCode | Result                                                                                                                                          |
| -------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| Not listed     | `0`     | Ordinary player                                                                                                                                 |
| `Level="32"`   | `0`     | **All slash commands work.** No GM aura, no monster immunity, no trade unlock - looks and plays like a normal character                         |
| Not listed     | `32`    | GM status, aura and immunities - but **no slash command with `GameMaster>=1` works**. Entering the game registers the character at GM level `0` |
| `Level="32"`   | `32`    | Full GM. **This is the correct setup**                                                                                                          |
| `Level="32"`   | `8`     | Commands work, GM status is the observer kind - cannot attack or cast                                                                           |

## Cross-File Dependencies

| Attribute                    | Related in                                                       |
| ---------------------------- | ---------------------------------------------------------------- |
| `Account`                    | Must exist in the JoinServer / DataServer `MEMB_INFO` table      |
| `Character`                  | Must belong to that account                                      |
| Per-command GM gate          | [Command.xml](/docs/data/command-xml.md) `GameMaster=` attribute |
| Command tuning and cooldowns | [Command.dat](/docs/gameserver/command-dat.md)                   |
| Name-creation word filter    | [DataServer BadSyntax.txt](/docs/dataserver/badsyntax.md)        |

## Common Issues

* **GM cannot use any skills or attack** - `CtlCode` is `8` (or `4`). Set it to `32` and relog
* **GM has no commands** - only `CtlCode` was set. Commands come exclusively from `GameMaster.xml`; add the account/character pair and run `reload.util` in the Server Manager (or `/reload util` as another GM)
* **GM has commands but no aura/immunity** - only `GameMaster.xml` was set. Set `CtlCode = 32` on the character row and relog
* **Command still denied after editing the XML** - `Level` is below the command's `GameMaster=` value, the `Account` does not match the character's real owner, or the file was not reloaded yet. Run `/reload util` (or `reload.util` in the Server Manager)
* **Character cannot log in at all** - `CtlCode` bit `1` is set
* **Character cannot touch items** - `CtlCode` bit `2` or `16` is set
* **Duplicate character names** - only the first entry for a given character name is stored, even across accounts
* **Test GMs shipped to production** - v1.0.7 ships an empty GameMasterList. If you inherited an older file, strip its stock `admin` / `test` rows before release
