Dedicated Server (Agones & Server Data)¶
Overview¶
AMIPDefaultServerGameMode is the dedicated game mode: on BeginPlay it waits for Agones (UAgonesSubsystem) GameServer allocation, then applies annotations to UMIPServerDataSubsystem. UMIPServerDataSubsystem is a GameInstance subsystem that exists only on dedicated servers, exposing environment-driven FMIPServerData / FMIPServerSecretData (from Kubernetes/Agones annotations) for map routing, JWT, and other backend-coordinated values.
All paths below are relative to Plugins/ModularInventoryPlus/Source/ModularInventoryPlus/.
Key Classes & Files¶
| Class | File |
|---|---|
AMIPDefaultServerGameMode |
Public/DefaultServer/MIPDefaultServerGameMode.h |
UMIPServerDataSubsystem |
Public/ServerData/MIPServerDataSubsystem.h |
FMIPServerData, FMIPMapData, secrets |
Public/ServerData/MIPServerDataTypes.h |
AMIPDefaultServerGameMode¶
- Agones:
OnGameServer,OnGameServerAllocated→SetValuesFromAnnotationson server data subsystem. - Blueprint:
GetMapDataDataTablenative event for map metadata.
UMIPServerDataSubsystem¶
- API:
SetValuesFromAnnotations,GetServerData,GetSecretServerData, staticGetEnvVariable. - Scope:
ShouldCreateSubsystemlimits to dedicated server.
Agones Annotations¶
SetValuesFromAnnotations is called at Agones allocation time. The following annotation keys (defined in MIPServerDataStatics) are read:
| Annotation key | Format | Purpose |
|---|---|---|
SESSION_ID |
string | Identifies the session for backend coordination |
MAP |
string | Map name the server should load |
MODE |
string | Game mode override |
JWT_TOKEN |
string | Server's own auth token for backend Socket.IO |
JWT_PUBLIC_KEY_PEM_B64 |
base64(UTF-8 PEM) | RS256 public key for local player join JWT verification |
JWT_PUBLIC_KEY_PEM_B64 is base64-decoded and passed to UMIPJwtSubsystem::InitializePlayerJwtPublicKey. When present, the game server verifies every player join JWT signature locally (without a network round-trip) in addition to the backend single-use check. Omitting this annotation disables local RS256 verification; the join flow falls back to passthrough for non-RS256 tokens (dev / PIE mode).
See JWT for the full verification behavior table.
Integration¶
- JWT — public key / secrets from annotations.
- Minimap —
FMIPMapDatafor portal travel. - Server Deployment — Kubernetes/Agones context (ops docs).