A session is one game. One player hosts it and the others hold seats, up to 16 in all.
A player hosts a session and reads out its join code, or a match makes
one. A player holds one seat at a time: hosting or joining another session gives up the one held.
When the host leaves, the player seated longest becomes the host.
Scope: sessions belong to one game; a seat belongs to a player.
Multiplayer → Sessions lists the Live Sessions and the Session History. Each
session’s details show its host and Host changes, its Connection, Join code,
Participants, and the Relay credentials drawn by its players. Multiplayer settings
on the same page set the seat count, timeouts and maximum age; see
Multiplayer. Host a session, and show its code.A friend’s game joins with the code; letter case does not matter.Follow the session, and leave it.After the game restarts, find the seat the player still holds:To connect the players, see Connecting players. Host a session, and show its code. The examples run in your game instance, which outlives the
level changes that bring the players together.A friend’s game joins with the code; letter case does not matter.Follow the session, and leave it.After the game restarts, find the seat the player still holds:Every call returns an FFlockRequestHandle; its Cancel() stops the request on its way. A
call on a session that has ended is refused (Validation) without a request.In Blueprint, the calls are nodes under Flock | Multiplayer: Flock Host Session,
Flock Join Session and Flock Get Session (On Success with the session, On Failure with
the error), Flock Get My Session (On Session, On No Session, On Failure), and Flock Leave
Session, Flock End Session and Flock Make Session Host. Max Players left at 0 takes
the game’s setting. Bind the session’s On Players Changed, On Host Changed and On
Ended events on the session object.To connect the players, see Connecting players.
Game versions
A session takes only players on the host’s Game Version unless the host passes
sameVersionOnly: false (Unreal: bSameVersionOnly false). A player on another build is refused
with MultiplayerVersionMismatch; ask them to update.
When a player goes quiet
The SDK sends a heartbeat every 20 seconds while the game runs, so a playing player never times
out. What happens when the game stops running (where a cell gives two names, the first is Unity’s
and the second Unreal’s):
When a session ends
Ended (OnEnded on Unreal) is raised once with the reason. On Unity the reason is a
FlockMultiplayerSessionEndReason; on Unreal it is a string, compared with the constants of
FlockMultiplayerSessionEndReasons, which carry the same names (FlockMultiplayerSessionEndReasons::EndedByHost
is ended_by_host). The server can add reasons, so keep a default:
Ended (OnEnded) is not raised when the game quits.
Errors
Each code is a FlockErrorCode on Unity and an EFlockErrorCode on Unreal, with the same name,
and the error carries a hint naming the fix.