Dedicated server
Build, run and package MowoServer, the headless authoritative server that hosts a session with no player on the host machine.
MowoServer is the headless dedicated server. It loads a scene, runs the full runtime simulation with no window and no renderer, and hosts through the same FNetSession layer a listen server uses, with no host pawn. Listen-server co-op stays the default for shipped games; the dedicated server is the option for standalone hosting, and it is the process multiplayer Play in Editor starts in Dedicated Server net mode.
What the server does
- Open project
- Load scene
- Init game mode
- Host session
- Tick at --tickrate
- It opens the project (or the cooked package's manifest) and reads the start scene, the game mode class and the
platform.*settings. - It loads the
--mapscene, or the project's start scene, or an empty world when neither is set. - With a game mode, it initializes that
AGameModeon the actor world without a local player. Each player who joins is spawned throughAGameMode::RestartPlayer; without a game mode, joining players get bare replicated pawns. - It hosts the session with
spawnHostPawnoff, relevancy off, no lobby or rich presence, and no host-wide uplink cap (only the per-client budget applies). - Every tick it runs the scene's runtime systems, including
ReplicationManager, at--tickrate. The server tick for lag compensation follows the same rate.
Build and run
Build the MowoServer target, then start it with a project and a scene:
./mbt.cmd build -t MowoServer
MowoServer.exe --project=MyGame.mproject --map=Content/Maps/Level01.mmap --port=7777 --maxclients=4| Option | Default | Meaning |
|---|---|---|
--project <path> | discovered | Project to open. Without it the server looks for Game.mproject at the package root, then for a .mproject in the working or executable directory. |
--map <scene> | project start scene | Scene to load and simulate |
--gamemode <class> | project game mode | AGameMode class to initialize |
--port <n> | 7777 | Listen port |
--maxclients <n> | 4 | Connection cap (the session allows this many clients) |
--tickrate <hz> | 60 | Frame cap and fixed server tick |
--appid <id> | none | Steam App ID for ticket validation |
--ticket-key <hex>, --ticket-key-file <path> | none | Encrypted app ticket key |
--travel-after <s>, --travel-to <scene> | none | Travel to another scene after this many seconds |
Options parse through the engine command line, so --port 7777 and --port=7777 both work. Ctrl+C, SIGTERM or closing the console stops the server gracefully: clients see the session close rather than a timeout, and the process exits with code 0. That makes it a well-behaved citizen under systemd, containers or another supervisor.
The server writes its log to an unbuffered stdout, so a supervising process sees lines as they happen.
Authenticate players
When both --appid and a ticket key are given, the server requires an encrypted Steam app ticket from every client. An unauthenticated peer's traffic never reaches the simulation, and a peer that presents no valid ticket within 15 seconds is dropped. Without them, the server logs that ticket validation is disabled and accepts every connection. See Online platforms for the client side.
Steam game server
With platform.steamEnabled on in the project, the server logs on anonymously as a Steam game server on the session port, with the query port one above it, and listens on both ENet and Steam P2P. Plugins load on the server too, except those that opt out: the Discord and Mowo Online plugins are client-only Engine/Plugins/DiscordPlatform/DiscordPlatform.mplugin.
Package the server
./mbt.cmd package --target Server--target Server produces a headless server package instead of the branded player. A packaged server mounts the same encrypted, signed content as the game, carries its manifest as Game.mproject at the package root, and reports crashes through the game's crash settings. See Shipping and the mbt CLI reference.
Related
- Sessions and hosting for the session layer the server hosts through.
- Transport and encryption for the transports it listens on.
- Play in Editor for multiplayer PIE against a server process.
Engine sources
This page describes behavior implemented in these files of the engine repository, checked against commit 6caf55861.
- Engine/Source/Runtime/Networking/Public/Networking/PlatformInit.h
- Engine/Plugins/DiscordPlatform/DiscordPlatform.mplugin
- Engine/Plugins/MowoOnlinePlatform/MowoOnlinePlatform.mplugin