![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <GameModeBase.h>
Public Member Functions | |
| DECLARE_EVENT_OneParam (AGameModeBase, FGameModeInitializedEvent, AGameModeBase *) | |
| DECLARE_EVENT_ThreeParams (AGameModeBase, FGameModePreLoginEvent, AGameModeBase *, const FUniqueNetIdRepl &, FString &) | |
| DECLARE_EVENT_TwoParams (AGameModeBase, FGameModePostLoginEvent, AGameModeBase *, APlayerController *) | |
| DECLARE_EVENT_TwoParams (AGameModeBase, FGameModeLogoutEvent, AGameModeBase *, AController *) | |
| DECLARE_EVENT_OneParam (AGameModeBase, FGameModeMatchStateSetEvent, FName) | |
Static Public Member Functions | |
| static FGameModeInitializedEvent & | OnGameModeInitializedEvent () |
| static FGameModePreLoginEvent & | OnGameModePreLoginEvent () |
| static FGameModePostLoginEvent & | OnGameModePostLoginEvent () |
| static FGameModeLogoutEvent & | OnGameModeLogoutEvent () |
| static FGameModeMatchStateSetEvent & | OnGameModeMatchStateSetEvent () |
The GameModeBase defines the game being played. It governs the game rules, scoring, what actors are allowed to exist in this game type, and who may enter the game.
It is only instanced on the server and will never exist on the client.
A GameModeBase actor is instantiated when the level is initialized for gameplay in C++ UGameEngine::LoadMap().
The class of this GameMode actor is determined by (in order) either the URL ?game=xxx, the GameMode Override value set in the World Settings, or the DefaultGameMode entry set in the game's Project Settings.
| FGameModeEvents::DECLARE_EVENT_OneParam | ( | AGameModeBase | , |
| FGameModeInitializedEvent | , | ||
| AGameModeBase * | |||
| ) |
GameMode initialization has occurred
| GameMode | the game mode actor that has been initialized |
| FGameModeEvents::DECLARE_EVENT_OneParam | ( | AGameModeBase | , |
| FGameModeMatchStateSetEvent | , | ||
| FName | |||
| ) |
Match state has changed via SetMatchState()
| MatchState | new match state |
| FGameModeEvents::DECLARE_EVENT_ThreeParams | ( | AGameModeBase | , |
| FGameModePreLoginEvent | , | ||
| AGameModeBase * | , | ||
| const FUniqueNetIdRepl & | , | ||
| FString & | |||
| ) |
Client pre login event, triggered when a client first contacts a server
| GameMode | the game mode actor that has been initialized |
| NewPlayer | the unique id of the player attempting to join |
| ErrorMessage | current state of any error messages, setting this value non empty will reject the player |
| FGameModeEvents::DECLARE_EVENT_TwoParams | ( | AGameModeBase | , |
| FGameModeLogoutEvent | , | ||
| AGameModeBase * | , | ||
| AController * | |||
| ) |
Logout event, triggered when a player leaves the game as well as during non-seamless ServerTravel
Note that this is called before performing any cleanup of the specified AController
| FGameModeEvents::DECLARE_EVENT_TwoParams | ( | AGameModeBase | , |
| FGameModePostLoginEvent | , | ||
| AGameModeBase * | , | ||
| APlayerController * | |||
| ) |
Post login event, triggered when a player joins the game as well as after non-seamless ServerTravel
This is called after the player has finished initialization
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
static |
|
static |
|
static |
|
static |
|
static |