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.
Properties
Section titled “Properties”FSeinPlayerID Slot
Blueprint read-only
The slot this relay’s player plays; Neutral until seated. Set by the server.
Network functions
Section titled “Network functions”Server Submit Turn
Section titled “Server Submit Turn”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.
Client Receive Turn
Section titled “Client Receive Turn”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.
Server Report Checksum
Section titled “Server Report Checksum”void Server_ReportChecksum(int32 Turn, FGuid Checksum);A client’s state checksum after a check turn.
Client Begin Match
Section titled “Client Begin Match”void Client_BeginMatch(const TArray<uint8>& Settings, int64 Seed);Build this match: its settings (packed state bytes) and seed.
Server Report Ready
Section titled “Server Report Ready”void Server_ReportReady(const FSeinStateHeader& Header, FGuid Checksum);The client built its match: its build identity and tick-zero checksum.
Client Start Match
Section titled “Client Start Match”void Client_StartMatch();Every player reported the same tick zero; start ticking.
Server Report Final Checksum
Section titled “Server Report Final Checksum”void Server_ReportFinalChecksum(int32 Tick, FGuid Checksum);The client’s state checksum at the tick its world ended the match.
Client Abort Match
Section titled “Client Abort Match”void Client_AbortMatch(const FString& Reason);The match cannot go on (a failed start or a desync under the Abort Match policy).
Server Request Pause Control
Section titled “Server Request Pause Control”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.
Client Pause Control
Section titled “Client Pause Control”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.
Client Begin State
Section titled “Client Begin State”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.
Client State Chunk
Section titled “Client State Chunk”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.
Server Request Slot Claim
Section titled “Server Request Slot Claim”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.
Server Request Set Ready
Section titled “Server Request Set Ready”void Server_RequestSetReady(bool bReady);A client sets the ready flag on its own slot.
Server Request Set Team
Section titled “Server Request Set Team”void Server_RequestSetTeam(int32 SlotIndex, uint8 TeamID);Host only.
Server Request Set Slot State
Section titled “Server Request Set Slot State”void Server_RequestSetSlotState(int32 SlotIndex, ESeinSlotState NewState, FGameplayTag AIProfile);Host only: open or close a slot, or seat an AI with an optional profile.
Server Request Select Map
Section titled “Server Request Select Map”void Server_RequestSelectMap(const TSoftObjectPtr<UWorld>& Map);Host only: pick the map the match travels to.
Server Request Kick Player
Section titled “Server Request Kick Player”void Server_RequestKickPlayer(int32 SlotIndex);Host only.
Server Request Leave
Section titled “Server Request Leave”void Server_RequestLeave();Leave on purpose: the slot opens at once, without a reconnect grace.
Client Notify Kicked
Section titled “Client Notify Kicked”void Client_NotifyKicked(const FString& Reason);The host removed this player: disconnect and return to the main menu.
On Rep Slot
Section titled “On Rep Slot”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).