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. |
|
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 |
|
|
MaxInactivePlayers |
The maximum number of inactive players before we kick the oldest ones out |
|
|
float |
MinRespawnDelay |
Minimum time before player can respawn after dying. |
|
NumBots |
Number of non-human players (AI controlled but participating as a player). |
|
|
NumPlayers |
Current number of human players. |
|
|
NumSpectators |
Current number of spectators. |
|
|
NumTravellingPlayers |
Number of players that are still traveling from a previous map |
Name | Description | |
---|---|---|
|
AGameMode ( |
Name | Description | ||
---|---|---|---|
|
AbortMatch() |
Report that a match has failed due to unrecoverable error |
|
|
AddInactivePlayer ( |
Add PlayerState to the inactive list, remove from the active list |
|
|
Broadcast |
Broadcast a string to all players. |
|
|
BroadcastLocalized ( |
Broadcast a localized message to all players. |
|
|
EndMatch() |
Transition from InProgress to WaitingPostMatch. |
|
|
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 |
|
|
GetTravelType() |
Return true if we want to travel_absolute, used by RestartGame by default |
|
|
HandleDisconnect ( |
Handles when a player is disconnected, before the session does |
|
|
HandleLeavingMap() |
Called when the match transitions to LeavingMap |
|
|
HandleMatchAborted() |
Called when the match transitions to Aborted |
|
|
HandleMatchHasEnded() |
Called when the map transitions to WaitingPostMatch |
|
|
HandleMatchHasStarted() |
Called when the state transitions to InProgress |
|
|
HandleMatchIsWaitingToStart() |
Called when the state transitions to WaitingToStart |
|
|
HandleStartingNewPlayer_Implementation ( |
||
|
IsMatchInProgress() |
Returns true if the match state is InProgress or other gameplay state |
|
|
K2_OnSetMatchState ( |
Implementable event to respond to match state changes |
|
|
MatineeCancelled() |
Called when this PC is in cinematic mode, and its matinee is canceled by the user. |
|
|
NotifyPendingConnectionLost ( |
Called when a connection closes before getting to PostLogin() |
|
|
OnMatchStateSet() |
Overridable virtual function to dispatch the appropriate transition functions before GameState and Blueprints get SetMatchState calls. |
|
|
OverridePlayerState ( |
Override PC's PlayerState with the values in OldPlayerState as part of the inactive player handling |
|
|
PlayerCanRestart_Implementation ( |
||
|
PlayerSwitchedToSpectatorOnly ( |
Will remove the controller from the correct count then add them to the spectator count. |
|
|
PostCommitMapChange() |
Called from CommitMapChange after unloading previous level and loading new level+sublevels. |
|
|
PreCommitMapChange |
Called from CommitMapChange before unloading previous level. Used for asynchronous level streaming |
|
|
ReadyToEndMatch() |
Returns true if ready to End Match. Games should override this |
|
|
ReadyToStartMatch() |
Returns true if ready to Start Match. Games should override this |
|
|
RemovePlayerControllerFromPlayerCount ( |
Removes the passed in player controller from the correct count for player/spectator/tranistioning |
|
|
RestartGame() |
Restart the game, by default travel to the current map |
|
|
Say ( |
Exec command to broadcast a string to all players |
|
|
SetMatchState ( |
Updates the match state and calls the appropriate transition functions |
|
|
SetSeamlessTravelViewTarget ( |
SetViewTarget of player control on server change |
|
|
StartMatch() |
Transition from WaitingToStart to InProgress. |
Name | Description | ||
---|---|---|---|
|
CanServerTravel |
Returns true if allowed to server travel |
|
|
GetNumPlayers() |
Returns number of active human players, excluding spectators |
|
|
GetNumSpectators() |
Returns number of human players currently spectating |
|
|
HandleSeamlessTravelPlayer ( |
Handles reinitializing players that remained through a seamless level transition called from C++ for players that finished loading after the server |
|
|
HasMatchEnded() |
Returns true if the match state is WaitingPostMatch or later |
|
|
HasMatchStarted() |
Returns true if the match start callbacks have been called |
|
|
InitGame |
Initialize the game. |
|
|
InitSeamlessTravelPlayer ( |
Handles initializing a seamless travel player, handles logic similar to InitNewPlayer |
|
|
IsHandlingReplays() |
Returns true if replays will start/stop during gameplay starting/stopping |
|
|
Logout ( |
Called when a Controller with a PlayerState leaves the game or is destroyed |
|
|
PostLogin ( |
Called after a successful login. |
|
|
PostSeamlessTravel() |
Called after a seamless level transition has been completed on the new GameMode. |
|
|
SpawnPlayerFromSimulate |
Used in the editor to spawn a PIE player after the game has already started |
|
|
StartPlay() |
Transitions to calls BeginPlay on actors. |
|
|
StartToLeaveMap() |
Start the transition out of the current map. |
Name | Description | ||
---|---|---|---|
|
GetDefaultGameClassPath |
Deprecated in favor of PreloadContentForURL on GameInstance |
|
|
TSubclassOf<... |
GetGameModeClass |
Deprecated in favor of OverrideGameModeClass on GameInstance |
|
SendPlayer ( |
SendPlayer is not in use, call ClientTravel directly instead |
|
|
SetBandwidthLimit ( |
AsyncIOBandwidthLimit is no longer configurable |
|
|
StartNewPlayer ( |
StartNewPlayer has been split into InitializeHUDForPlayer and HandleStartingNewPlayer |
|
|
StaticGetFullGameClassName ( |
Deprecated in favor of GetGameModeForName on GameMapsSettings |