Navigation
API > API/Runtime > API/Runtime/Engine > API/Runtime/Engine/GameFramework
Inheritance Hierarchy
- UObjectBase
- UObjectBaseUtility
- UObject
- AActor
- AInfo
- AGameSession
References
| Module | Engine |
| Header | /Engine/Source/Runtime/Engine/Classes/GameFramework/GameSession.h |
| Include | #include "GameFramework/GameSession.h" |
Syntax
class AGameSession : public AInfo
Remarks
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.
Variables
| Type | Name | Description | |
|---|---|---|---|
| bool | bRequiresPushToTalk | Is voice enabled always or via a push to talk keybinding | |
| int32 | MaxPartySize | Restrictions on the largest party that can join together | |
| int32 | MaxPlayers | Maximum number of players allowed by this server. | |
| int32 | MaxSpectators | Maximum number of spectators allowed by this server. | |
| uint8 | MaxSplitscreensPerConnection | Maximum number of splitscreen players to allow from one connection | |
| FName | SessionName | SessionName local copy from PlayerState class. |
Constructors
| Type | Name | Description | |
|---|---|---|---|
AGameSession
(
const FObjectInitializer& ObjectInitializer |
Functions
| Type | Name | Description | |
|---|---|---|---|
| void | AddAdmin
(
APlayerController* AdminPlayer |
Add a player to the admin list of this session | |
| FString | ApproveLogin
(
const FString& Options |
Called from GameMode.PreLogin() and Login(). | |
| bool | AtCapacity
(
bool bSpectator |
||
| bool | BanPlayer
(
APlayerController* BannedPlayer, |
Forcibly remove player from the server and ban them permanently | |
| bool | Called from GameMode.RestartGame(). | ||
| void | Dump session info to log for debugging. | ||
| int32 | |||
| bool | GetSessionJoinability
(
FName InSessionName, |
Get the current joinability settings for a given session | |
| void | Handle when the match has completed | ||
| void | Handle when the match has started | ||
| void | Handle when the match enters waiting to start | ||
| bool | True if GameSession handled the request, in case it wants to stall for some reason. | ||
| void | InitOptions
(
const FString& Options |
Initialize options based on passed in options string | |
| bool | KickPlayer
(
APlayerController* KickedPlayer, |
Forcibly remove player from the server | |
| void | NotifyLogout
(
FName InSessionName, |
Called when a player logs out of game. | |
| void | NotifyLogout
(
const APlayerController* PC |
Called when a PlayerController logs out of game. | |
| void | OnAutoLoginComplete
(
int32 LocalUserNum, |
Delegate triggered on auto login completion | |
| void | OnEndSessionComplete
(
FName InSessionName, |
Delegate called when EndSession has completed | |
| void | OnStartSessionComplete
(
FName InSessionName, |
Delegate called when StartSession has completed | |
| void | PostLogin
(
APlayerController* NewPlayer |
Called by GameMode::PostLogin to give session code chance to do work after PostLogin | |
| void | 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 | ||
| bool | Allow an online service to process a login if specified on the commandline with -auth_login/-auth_password | ||
| void | RegisterPlayer
(
APlayerController* NewPlayer, |
Register a player with the online service session | |
| void | Allow a dedicated server a chance to register itself with an online service | ||
| void | Callback when autologin was expected but failed | ||
| void | RemoveAdmin
(
APlayerController* AdminPlayer |
Remove a player from the admin list of this session | |
| bool | Does the session require push to talk | ||
| void | Restart () |
Restart the session | |
| void | Gracefully tell all clients then local players to return to lobby | ||
| void | UnregisterPlayer
(
const APlayerController* ExitingPlayer |
Unregister a player from the online service session | |
| void | UnregisterPlayer
(
FName InSessionName, |
Unregister a player from the online service session | |
| void | UpdateSessionJoinability
(
FName InSessionName, |
Update session join parameters |
Deprecated Functions
| Type | Name | Description | |
|---|---|---|---|
| void | RegisterPlayer
(
APlayerController* NewPlayer, |
Use RegisterPlayer with FUniqueNetIdRepl | |
| void | UnregisterPlayers
(
FName InSessionName, |
Use UnregisterPlayers with FUniqueNetIdRepl | |
| void | UnregisterPlayers
(
FName InSessionName, |
Use UnregisterPlayers with FUniqueNetIdRepl |