Navigation
API > API/Runtime > API/Runtime/Engine
Acts as a game-specific wrapper around the session interface. The game code makes calls to this when it needs to interact with the session interface. A game session exists only the server, while running an online game.
| Name | AGameSession |
| Type | class |
| Header File | /Engine/Source/Runtime/Engine/Classes/GameFramework/GameSession.h |
| Include Path | #include "GameFramework/GameSession.h" |
Syntax
UCLASS (Config=Game, NotPlaceable, MinimalAPI)
class AGameSession : public AInfo
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → AActor → AInfo → AGameSession
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
AGameSession
(
const FObjectInitializer& ObjectInitializer |
GameFramework/GameSession.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bRequiresPushToTalk | bool | Is voice enabled always or via a push to talk keybinding | GameFramework/GameSession.h |
|
| MaxPartySize | int32 | Restrictions on the largest party that can join together | GameFramework/GameSession.h | |
| MaxPlayers | int32 | Maximum number of players allowed by this server. | GameFramework/GameSession.h |
|
| MaxSpectators | int32 | Maximum number of spectators allowed by this server. | GameFramework/GameSession.h |
|
| MaxSplitscreensPerConnection | uint8 | Maximum number of splitscreen players to allow from one connection | GameFramework/GameSession.h |
|
| SessionName | FName | SessionName local copy from PlayerState class. | GameFramework/GameSession.h |
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| MaxPlayersOptionOverride | TOptional< int32 > | Override for the default value of MaxPlayers passed to InitOptions. | GameFramework/GameSession.h | |
| MaxSpectatorsOptionOverride | TOptional< int32 > | Override for the default value of MaxSpectators passed to InitOptions. | GameFramework/GameSession.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void AddAdmin
(
APlayerController* AdminPlayer |
Add a player to the admin list of this session | GameFramework/GameSession.h | |
| Called from GameMode.PreLogin() and Login(). | GameFramework/GameSession.h | ||
virtual bool AtCapacity
(
bool bSpectator |
GameFramework/GameSession.h | ||
virtual bool BanPlayer
(
APlayerController* BannedPlayer, |
Forcibly remove player from the server and ban them permanently | GameFramework/GameSession.h | |
virtual bool CanRestartGame() |
Called from GameMode.RestartGame(). | GameFramework/GameSession.h | |
virtual void DumpSessionState() |
Dump session info to log for debugging. | GameFramework/GameSession.h | |
int32 GetNextPlayerID() |
GameFramework/GameSession.h | ||
virtual bool GetSessionJoinability
(
FName InSessionName, |
Get the current joinability settings for a given session | GameFramework/GameSession.h | |
virtual void HandleMatchHasEnded() |
Handle when the match has completed | GameFramework/GameSession.h | |
virtual void HandleMatchHasStarted() |
Handle when the match has started | GameFramework/GameSession.h | |
virtual void HandleMatchIsWaitingToStart() |
Handle when the match enters waiting to start | GameFramework/GameSession.h | |
virtual bool HandleStartMatchRequest () |
@RETURNS true if GameSession handled the request, in case it wants to stall for some reason. | GameFramework/GameSession.h | |
virtual void InitOptions
(
const FString& Options |
Initialize options based on passed in options string | GameFramework/GameSession.h | |
virtual bool KickPlayer
(
APlayerController* KickedPlayer, |
Forcibly remove player from the server | GameFramework/GameSession.h | |
virtual void NotifyLogout
(
FName InSessionName, |
Called when a player logs out of game. | GameFramework/GameSession.h | |
virtual void NotifyLogout
(
const APlayerController* PC |
Called when a PlayerController logs out of game. | GameFramework/GameSession.h | |
virtual void OnAutoLoginComplete
(
int32 LocalUserNum, |
Delegate triggered on auto login completion | GameFramework/GameSession.h | |
virtual void PostLogin
(
APlayerController* NewPlayer |
Called by GameMode::PostLogin to give session code chance to do work after PostLogin | GameFramework/GameSession.h | |
virtual void PostSeamlessTravel() |
Called after a seamless level transition has been completed on the new GameMode used to reinitialize players already in the game as they won't have *Login() called on them | GameFramework/GameSession.h | |
virtual bool ProcessAutoLogin() |
Allow an online service to process a login if specified on the commandline with -auth_login/-auth_password | GameFramework/GameSession.h | |
virtual void RegisterPlayer
(
APlayerController* NewPlayer, |
Register a player with the online service session | GameFramework/GameSession.h | |
virtual void RegisterServer() |
Allow a dedicated server a chance to register itself with an online service | GameFramework/GameSession.h | |
virtual void RegisterServerFailed() |
Callback when autologin was expected but failed | GameFramework/GameSession.h | |
virtual void RemoveAdmin
(
APlayerController* AdminPlayer |
Remove a player from the admin list of this session | GameFramework/GameSession.h | |
virtual bool RequiresPushToTalk() |
Does the session require push to talk | GameFramework/GameSession.h | |
virtual void Restart() |
Restart the session | GameFramework/GameSession.h | |
virtual void ReturnToMainMenuHost() |
Gracefully tell all clients then local players to return to lobby | GameFramework/GameSession.h | |
virtual void UnregisterPlayer
(
const APlayerController* ExitingPlayer |
Unregister a player from the online service session | GameFramework/GameSession.h | |
virtual void UnregisterPlayer
(
FName InSessionName, |
Unregister a player from the online service session | GameFramework/GameSession.h | |
virtual void UnregisterPlayers
(
FName InSessionName, |
GameFramework/GameSession.h | ||
virtual void UpdateSessionJoinability
(
FName InSessionName, |
Update session join parameters | GameFramework/GameSession.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void OnEndSessionComplete
(
FName InSessionName, |
Delegate called when EndSession has completed | GameFramework/GameSession.h | |
virtual void OnStartSessionComplete
(
FName InSessionName, |
Delegate called when StartSession has completed | GameFramework/GameSession.h |
Overridden from UObject
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void PostReloadConfig
(
FProperty* PropertyThatWasLoaded |
PostReloadConfig override to reapply config property overrides. | GameFramework/GameSession.h |