Skip to content

Sein Net Relay

Class · ASeinNetRelay : AActor

#include "SeinNetRelay.h"

One player’s connection to the host. The server spawns a relay for every player controller and gives the controller ownership, so a client reaches the server only through its own relay and the server knows which slot sent a message. Only the owner receives it.

Its RPCs carry the turn exchange (a client’s batch up, the assembled turn down), match start and end, resumes from a pause, the state a returning or diverged player loads, desync checksums and the lobby verbs. All are reliable: lockstep cannot lose or reorder a turn.

FSeinPlayerID Slot

Blueprint read-only

The slot this relay’s player plays; Neutral until seated. Set by the server.

void Server_SubmitTurn(int32 Turn, const TArray<uint8>& Part, bool bEnd);

Part of a client’s commands for one turn; bEnd marks the last part. Parts keep each RPC under Unreal’s bunch size limit.

void Client_ReceiveTurn(int32 Turn, const TArray<uint8>& Part, bool bEnd);

Part of one assembled turn, the same bytes for every player; bEnd marks the last part.

void Server_ReportChecksum(int32 Turn, FGuid Checksum);

A client’s state checksum after a check turn.

void Client_BeginMatch(const TArray<uint8>& Settings, int64 Seed);

Build this match: its settings (packed state bytes) and seed.

void Server_ReportReady(const FSeinStateHeader& Header, FGuid Checksum);

The client built its match: its build identity and tick-zero checksum.

void Client_StartMatch();

Every player reported the same tick zero; start ticking.

void Server_ReportFinalChecksum(int32 Tick, FGuid Checksum);

The client’s state checksum at the tick its world ended the match.

void Client_AbortMatch(const FString& Reason);

The match cannot go on (a failed start or a desync under the Abort Match policy).

void Server_RequestPauseControl(int32 Tick, const TArray<uint8>& Command);

A resume from a paused player; Tick is the tick its world paused at. A paused world takes no turns, so this travels outside them.

void Client_PauseControl(int32 Tick, const TArray<uint8>& Command);

A resume every player runs while paused at Tick, in the order the host sends them.

void Client_BeginState(const FSeinStateHeader& Header, int32 Turn, int32 FirstAuthoredTurn, int32 RawSize, int32 CompressedSize);

A state follows in chunks: the host’s build identity, captured after Turn, compressed to CompressedSize bytes. The player authors its own commands again from FirstAuthoredTurn.

void Client_StateChunk(const TArray<uint8>& Bytes);

One compressed chunk of the state the host sends to a returning or resynchronizing player. It follows Client Begin State.

void Server_RequestSlotClaim(int32 SlotIndex, FSeinFactionID Faction);

A client asks the host to give it this slot with this faction. The lobby validates the request.

void Server_RequestSetReady(bool bReady);

A client sets the ready flag on its own slot.

void Server_RequestSetTeam(int32 SlotIndex, uint8 TeamID);

Host only.

void Server_RequestSetSlotState(int32 SlotIndex, ESeinSlotState NewState, FGameplayTag AIProfile);

Host only: open or close a slot, or seat an AI with an optional profile.

void Server_RequestSelectMap(const TSoftObjectPtr<UWorld>& Map);

Host only: pick the map the match travels to.

void Server_RequestKickPlayer(int32 SlotIndex);

Host only.

void Server_RequestLeave();

Leave on purpose: the slot opens at once, without a reconnect grace.

void Client_NotifyKicked(const FString& Reason);

The host removed this player: disconnect and return to the main menu.

void OnRep_Slot();

Runs on the owning client when its slot is assigned, and raises the net subsystem’s local slot changed event.

C++ members (2)
  • void SetSlot(FSeinPlayerID NewSlot); Server: seat the player. Replicates to the owner.
  • bool IsLocal() const; True for the relay of a player on this machine (the listen server’s host or a client’s own).