UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FGameModeEvents Class Reference

#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 FGameModeInitializedEventOnGameModeInitializedEvent ()
 
static FGameModePreLoginEventOnGameModePreLoginEvent ()
 
static FGameModePostLoginEventOnGameModePostLoginEvent ()
 
static FGameModeLogoutEventOnGameModeLogoutEvent ()
 
static FGameModeMatchStateSetEventOnGameModeMatchStateSetEvent ()
 

Static Public Attributes

static ENGINE_API FGameModeInitializedEvent GameModeInitializedEvent
 
static ENGINE_API FGameModePreLoginEvent GameModePreLoginEvent
 
static ENGINE_API FGameModePostLoginEvent GameModePostLoginEvent
 
static ENGINE_API FGameModeLogoutEvent GameModeLogoutEvent
 
static ENGINE_API FGameModeMatchStateSetEvent GameModeMatchStateSetEvent
 

Detailed Description

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.

See also
https://docs.unrealengine.com/latest/INT/Gameplay/Framework/GameMode/index.html GameModeBase events, particularly for use by plugins

Member Function Documentation

◆ DECLARE_EVENT_OneParam() [1/2]

FGameModeEvents::DECLARE_EVENT_OneParam ( AGameModeBase  ,
FGameModeInitializedEvent  ,
AGameModeBase *   
)

GameMode initialization has occurred

  • Called at the end of AGameModeBase::InitGame
  • AGameSession has also been initialized
  • Possible some child level initialization hasn't finished
Parameters
GameModethe game mode actor that has been initialized

◆ DECLARE_EVENT_OneParam() [2/2]

FGameModeEvents::DECLARE_EVENT_OneParam ( AGameModeBase  ,
FGameModeMatchStateSetEvent  ,
FName   
)

Match state has changed via SetMatchState()

Parameters
MatchStatenew match state

◆ DECLARE_EVENT_ThreeParams()

FGameModeEvents::DECLARE_EVENT_ThreeParams ( AGameModeBase  ,
FGameModePreLoginEvent  ,
AGameModeBase *  ,
const FUniqueNetIdRepl ,
FString &   
)

Client pre login event, triggered when a client first contacts a server

Parameters
GameModethe game mode actor that has been initialized
NewPlayerthe unique id of the player attempting to join
ErrorMessagecurrent state of any error messages, setting this value non empty will reject the player

◆ DECLARE_EVENT_TwoParams() [1/2]

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

◆ DECLARE_EVENT_TwoParams() [2/2]

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

◆ OnGameModeInitializedEvent()

static FGameModeInitializedEvent & FGameModeEvents::OnGameModeInitializedEvent ( )
inlinestatic

◆ OnGameModeLogoutEvent()

static FGameModeLogoutEvent & FGameModeEvents::OnGameModeLogoutEvent ( )
inlinestatic

◆ OnGameModeMatchStateSetEvent()

static FGameModeMatchStateSetEvent & FGameModeEvents::OnGameModeMatchStateSetEvent ( )
inlinestatic

◆ OnGameModePostLoginEvent()

static FGameModePostLoginEvent & FGameModeEvents::OnGameModePostLoginEvent ( )
inlinestatic

◆ OnGameModePreLoginEvent()

static FGameModePreLoginEvent & FGameModeEvents::OnGameModePreLoginEvent ( )
inlinestatic

Member Data Documentation

◆ GameModeInitializedEvent

FGameModeEvents::FGameModeInitializedEvent FGameModeEvents::GameModeInitializedEvent
static

◆ GameModeLogoutEvent

FGameModeEvents::FGameModeLogoutEvent FGameModeEvents::GameModeLogoutEvent
static

◆ GameModeMatchStateSetEvent

FGameModeEvents::FGameModeMatchStateSetEvent FGameModeEvents::GameModeMatchStateSetEvent
static

◆ GameModePostLoginEvent

FGameModeEvents::FGameModePostLoginEvent FGameModeEvents::GameModePostLoginEvent
static

◆ GameModePreLoginEvent

FGameModeEvents::FGameModePreLoginEvent FGameModeEvents::GameModePreLoginEvent
static

The documentation for this class was generated from the following files: