Module |
|
Header |
/Engine/Source/Runtime/Engine/Classes/GameFramework/GameStateBase.h |
Include |
#include "GameFramework/GameStateBase.h" |
class AGameStateBase : public AInfo
GameStateBase is a class that manages the game's global state, and is spawned by GameModeBase. It exists on both the client and the server and is fully replicated.
Name | Description | ||
---|---|---|---|
|
TObjectPtr< AGa... |
AuthorityGameMode |
Instance of the current game mode, exists only on the server. |
|
bool |
bReplicatedHasBegunPlay |
Replicated when GameModeBase->StartPlay has been called so the client will also start play |
|
TSubclassOf< AG... |
GameModeClass |
Class of the server's game mode, assigned by GameModeBase. |
|
uint32 |
NumServerWorldTimeSecondsDeltas |
The number of server world time deltas accumulated in SumServerWorldTimeSecondsDelta - used for computing the mean |
|
PlayerArray |
Array of all PlayerStates, maintained on both server and clients (PlayerStates are always relevant) |
|
|
double |
ReplicatedWorldTimeSecondsDouble |
|
|
float |
ServerWorldTimeSecondsDelta |
The difference from the local world's TimeSeconds and the server world's TimeSeconds. |
|
float |
ServerWorldTimeSecondsUpdateFrequency |
Frequency that the server updates the replicated TimeSeconds from the world. |
|
TSubclassOf< AS... |
SpectatorClass |
Class used by spectators, assigned by GameModeBase. |
|
double |
SumServerWorldTimeSecondsDelta |
Cumulative sum of computed server world time deltas for smoothed-averaging |
|
TimerHandle_UpdateServerTimeSeconds |
Handle for efficient management of the UpdateServerTimeSeconds timer |
Name | Description | |
---|---|---|
|
AGameStateBase ( |
Name | Description | ||
---|---|---|---|
|
void |
AddPlayerState ( |
Add PlayerState to the PlayerArray |
|
void |
AsyncPackageLoaded ( |
Allow game states to react to asset packages being loaded asynchronously |
|
const AGameM... |
GetDefaultGameMode() |
Helper to return the default object of the GameModeBase class corresponding to this GameState. |
|
const T *... |
GetDefaultGameMode() |
Helper template to returns the GameModeBase default object cast to the right type |
|
float |
GetPlayerRespawnDelay ( |
Returns how much time needs to be spent before a player can respawn |
|
float |
GetPlayerStartTime ( |
Returns the time that should be used as when a player started |
|
APlayerState... |
GetPlayerStateFromUniqueNetId ( |
Returns the player state for a specified unique player Id |
|
double |
GetServerWorldTimeSeconds() |
Returns the simulated TimeSeconds on the server, will be synchronized on client and server |
|
void |
HandleBeginPlay() |
Called by game mode to set the started play bool |
|
bool |
HasBegunPlay() |
Returns true if the world has started play (called BeginPlay on actors) |
|
bool |
HasMatchEnded() |
Returns true if the match can be considered ended. Defaults to false. |
|
bool |
HasMatchStarted() |
Returns true if the world has started match (called MatchStarted callbacks) |
|
void |
OnRep_GameModeClass() |
GameModeBase class notification callback. |
|
void |
OnRep_ReplicatedHasBegunPlay() |
By default calls BeginPlay and StartMatch |
|
void |
OnRep_ReplicatedWorldTimeSecondsDouble() |
Allows clients to calculate ServerWorldTimeSecondsDelta |
|
void |
OnRep_SpectatorClass() |
Callback when we receive the spectator class |
|
void |
ReceivedGameModeClass() |
Called when the GameClass property is set (at startup for the server, after the variable has been replicated on clients) |
|
void |
ReceivedSpectatorClass() |
Called when the SpectatorClass property is set (at startup for the server, after the variable has been replicated on clients) |
|
void |
RemovePlayerState ( |
Remove PlayerState from the PlayerArray. |
|
void |
SeamlessTravelTransitionCheckpoint ( |
Called during seamless travel transition twice (once when the transition map is loaded, once when destination map is loaded) |
|
void |
UpdateServerTimeSeconds() |
Called periodically to update ReplicatedWorldTimeSecondsDouble |
Name | Description | ||
---|---|---|---|
|
void |
PostInitializeComponents() |
Allow actors to initialize themselves on the C++ side after all of their components have been initialized, only called during gameplay |
Name | Description | ||
---|---|---|---|
|
void |
GetLifetimeReplicatedProps ( |
Returns the properties used for network replication, this needs to be overridden by all actor classes with native replicated properties |
Name | Description | ||
---|---|---|---|
|
float |
ReplicatedWorldTimeSeconds |
ReplicatedWorldTimeSeconds is deprecated. Use ReplicatedWorldTimeSecondsDouble. |
Name | Description | ||
---|---|---|---|
|
void |
OnRep_ReplicatedWorldTimeSeconds() |
OnRep_ReplicatedWorldTimeSeconds() is deprecated. Use OnRep_ReplicatedWorldTimeSecondsDouble(). |