Sein Match Subsystem
Class · USeinMatchSubsystem : USeinSystemHostSubsystem
Parent: Sein System Host Subsystem
#include "Match/SeinMatchSubsystem.h"
The match: players and their starting resources, factions, teams, the Starting -> Playing -> Ended flow, results and votes.
C++ members (16)
bool BuildMatch(const FSeinMatchSettings& Settings, int64 Seed, FGuid& OutChecksum, FString& OutError);Build this world’s match at tick zero: install the seed, create the match entity and the Neutral player, install the settings (Lobby -> Starting), then run the Match Builder. On success the world is Built and OutChecksum is the tick-zero checksum peers compare before they start. A failed build leaves the world Failed.static bool ValidateMatchSettings(const FSeinMatchSettings& Settings, FString& OutError);False with a reason when slots are out of range or repeated, an extension is invalid, or the starting-resource rules name a resource outside the catalog.void RegisterPlayer(FSeinPlayerID PlayerID, FSeinFactionID FactionID, uint8 TeamID = 0);Register a player with catalog, faction-kit and match-rule starting resources, and seed its team’s diplomacy.void RegisterFaction(USeinFaction* Faction);Register one faction during a match build.void RegisterFactionsFromSettings();Load and register every faction listed in the plugin settings, during a match build.void DefeatPlayer(FSeinPlayerID PlayerID, FGameplayTag Reason);Defeat a player that is still playing, with a reason tag (by convention under MyGame.Defeat). A decided result stays; a defeat after the match ended does nothing. The team rule runs at the end of the tick.void EndMatch(TConstArrayView<FSeinPlayerID> Winners, FGameplayTag Reason);End the match. Winners are victorious and every other player still playing is defeated; with no winners, every player still playing draws. Decided results stay. The world stops after this tick.void AbortMatch(FGameplayTag Reason);End the match with no results: the administrator’s Abort Match. Empty records SeinARTS.Match.End.Aborted.TArray<FSeinPlayerID> GetWinners() const;Every player that won, in ascending order.FGameplayTag GetEndReason() const;Why the match ended; empty while it plays.void ApplyTeamRule();End When One Team Remains: run by the match end system at the end of each tick.void StartVote(FGameplayTag VoteType, ESeinVoteResolution Resolution, int32 RequiredThreshold, int32 ExpiresInTicks, FSeinPlayerID Initiator);Open a vote; a vote of the same type already open is kept. ExpiresInTicks <= 0 never expires.void CastVote(FGameplayTag VoteType, FSeinPlayerID Voter, int32 VoteValue);Cast or change a vote.ESeinVoteStatus GetVoteStatus(FGameplayTag VoteType) const;TArray<FSeinVoteState> GetActiveVotes() const;void TickMatchFlow();Advance Starting -> Playing and expire votes. Run by the match flow system each PreTick.