Module |
|
Header |
/Engine/Source/Runtime/Engine/Classes/GameFramework/GameMode.h |
Include |
#include "GameFramework/GameMode.h" |
class AGameMode : public AGameModeBase
GameMode is a subclass of GameModeBase that behaves like a multiplayer match-based game. It has default behavior for picking spawn points and match state. If you want a simpler base, inherit from GameModeBase instead.
Name | Description | ||
---|---|---|---|
|
uint32: 1 |
bDelayedStart |
Whether the game should immediately start when the first player logs in. |
|
bool |
bHandleDedicatedServerReplays |
If true, dedicated servers will record replays when HandleMatchHasStarted/HandleMatchHasStopped is called |
|
TSubclassOf< cl... |
EngineMessageClass |
Contains strings describing localized game agnostic messages. |
|
InactivePlayerArray |
PlayerStates of players who have disconnected from the server (saved in case they reconnect) |
|
|
float |
InactivePlayerStateLifeSpan |
Time a playerstate will stick around in an inactive state after a player logout |
|
MatchState |
What match state we are currently in |
|
|
int32 |
MaxInactivePlayers |
The maximum number of inactive players before we kick the oldest ones out |
|
float |
MinRespawnDelay |
Minimum time before player can respawn after dying. |
|
int32 |
NumBots |
Number of non-human players (AI controlled but participating as a player). |
|
int32 |
NumPlayers |
Current number of human players. |
|
int32 |
NumSpectators |
Current number of spectators. |
|
int32 |
NumTravellingPlayers |
Number of players that are still traveling from a previous map |
Name | Description | |
---|---|---|
|
AGameMode ( |
Name | Description | ||
---|---|---|---|
|
void |
AbortMatch() |
Report that a match has failed due to unrecoverable error |
|
void |
AddInactivePlayer ( |
Add PlayerState to the inactive list, remove from the active list |
|
void |
Broadcast |
Broadcast a string to all players. |
|
void |
BroadcastLocalized ( |
Broadcast a localized message to all players. |
|
void |
EndMatch() |
Transition from InProgress to WaitingPostMatch. |
|
bool |
FindInactivePlayer ( |
Attempt to find and associate an inactive PlayerState with entering PC. |
|
GetMatchState() |
Returns the current match state, this is an accessor to protect the state machine flow |
|
|
GetNetworkNumber() |
Get local address |
|
|
bool |
GetTravelType() |
Return true if we want to travel_absolute, used by RestartGame by default |
|
void |
HandleDisconnect ( |
Handles when a player is disconnected, before the session does |
|
void |
HandleLeavingMap() |
Called when the match transitions to LeavingMap |
|
void |
HandleMatchAborted() |
Called when the match transitions to Aborted |
|
void |
HandleMatchHasEnded() |
Called when the map transitions to WaitingPostMatch |
|
void |
HandleMatchHasStarted() |
Called when the state transitions to InProgress |
|
void |
HandleMatchIsWaitingToStart() |
Called when the state transitions to WaitingToStart |
|
void |
HandleStartingNewPlayer_Implementation ( |
|
|
bool |
IsMatchInProgress() |
Returns true if the match state is InProgress or other gameplay state |
|
void |
K2_OnSetMatchState ( |
Implementable event to respond to match state changes |
|
void |
NotifyPendingConnectionLost ( |
Called when a connection closes before getting to PostLogin() |
|
void |
OnMatchStateSet() |
Overridable virtual function to dispatch the appropriate transition functions before GameState and Blueprints get SetMatchState calls. |
|
void |
OverridePlayerState ( |
Override PC's PlayerState with the values in OldPlayerState as part of the inactive player handling |
|
bool |
PlayerCanRestart_Implementation ( |
|
|
void |
PlayerSwitchedToSpectatorOnly ( |
Will remove the controller from the correct count then add them to the spectator count. |
|
void |
PostCommitMapChange() |
Called from CommitMapChange after unloading previous level and loading new level+sublevels. |
|
void |
PreCommitMapChange |
Called from CommitMapChange before unloading previous level. Used for asynchronous level streaming |
|
bool |
ReadyToEndMatch() |
Returns true if ready to End Match. Games should override this |
|
bool |
ReadyToStartMatch() |
Returns true if ready to Start Match. Games should override this |
|
void |
RemovePlayerControllerFromPlayerCount ( |
Removes the passed in player controller from the correct count for player/spectator/tranistioning |
|
void |
RestartGame() |
Restart the game, by default travel to the current map |
|
void |
Say ( |
Exec command to broadcast a string to all players |
|
void |
SetMatchState ( |
Updates the match state and calls the appropriate transition functions |
|
void |
SetSeamlessTravelViewTarget ( |
SetViewTarget of player control on server change |
|
void |
StartMatch() |
Transition from WaitingToStart to InProgress. |
Name | Description | ||
---|---|---|---|
|
bool |
CanServerTravel ( |
Returns true if allowed to server travel |
|
int32 |
GetNumPlayers() |
Returns number of active human players, excluding spectators |
|
int32 |
GetNumSpectators() |
Returns number of human players currently spectating |
|
void |
HandleSeamlessTravelPlayer ( |
Handles reinitializing players that remained through a seamless level transition called from C++ for players that finished loading after the server |
|
bool |
HasMatchEnded() |
Returns true if the match state is WaitingPostMatch or later |
|
bool |
HasMatchStarted() |
Returns true if the match start callbacks have been called |
|
void |
InitGame |
Initialize the game. |
|
void |
InitSeamlessTravelPlayer ( |
Handles initializing a seamless travel player, handles logic similar to InitNewPlayer |
|
bool |
IsHandlingReplays() |
Returns true if replays will start/stop during gameplay starting/stopping |
|
void |
Logout ( |
Called when a Controller with a PlayerState leaves the game or is destroyed |
|
void |
PostLogin ( |
Called after a successful login. |
|
void |
PostSeamlessTravel() |
Called after a seamless level transition has been completed on the new GameMode. |
|
bool |
SpawnPlayerFromSimulate ( |
Used in the editor to spawn a PIE player after the game has already started |
|
void |
StartPlay() |
Transitions to calls BeginPlay on actors. |
|
void |
StartToLeaveMap() |
Start the transition out of the current map. |
Name | Description | ||
---|---|---|---|
|
void |
Tick ( |
Function called every frame on this Actor. |