ALobbyBeaconState

Shared state of the game from the lobby perspective Duplicates much of the data in the traditional [AGameState](API\Runtime\Engine\GameFramework\AGameState) object for sharing with players connected via beacon only

Choose your operating system:

Windows

macOS

Linux

Inheritance Hierarchy

References

Module

Lobby

Header

/Engine/Plugins/Online/OnlineFramework/Source/Lobby/Public/LobbyBeaconState.h

Include

#include "LobbyBeaconState.h"

Syntax

UCLASS(Transient, Config=Game, NotPlaceable)
class ALobbyBeaconState : public AInfo

Remarks

Shared state of the game from the lobby perspective Duplicates much of the data in the traditional AGameState object for sharing with players connected via beacon only

Variables

Name Description

Protected variable

friend

 

ALobbyBeaconHost

Protected variable UProperty replicatedusing

bool

 

bLobbyStarted

Has the lobby already been started

Protected variable

friend

 

FLobbyPlayerStateInfoArray

Protected variable

double

 

LastTickTime

Time that last tick occurred for calculating wait time

Protected variable UProperty

TSubclassOf< AL...

 

LobbyBeaconPlayerStateClass

Class to use for lobby beacon player states

Protected variable

FOnLobbyStarted

 

LobbyStarted

Delegate fired when the lobby starts

Protected variable

FOnLobbyWaiting...

 

LobbyWaitingForPlayersUpdate

Delegate fired as time counts down waiting for players in the lobby

Protected variable UProperty

int32

 

MaxPlayers

Total number of players allowed in the lobby

Protected variable

FTimerHandle

 

OneSecTimerHandle

Handle to manage a one sec timer

Protected variable

FOnPlayerLobbyS...

 

PlayerLobbyStateAdded

Delegate fired when a player is added to the lobby

Protected variable

FOnPlayerLobbyS...

 

PlayerLobbyStateRemoved

Delegate fired when a player is removed from the lobby

Protected variable UProperty Replicated

FLobbyPlayerSta...

 

Players

Array of players currently in the game, lobby or otherwise

Protected variable UProperty Config replicatedusing

float

 

WaitForPlayersTimeRemaining

Amount of time waiting for other players before starting the lobby

Constructors

Name Description

Public function

ALobbyBeaconState

(
    const FObjectInitializer& ObjectIn...
)

Functions

Name Description

Public function

ALobbyBeacon...

 

AddPlayer

(
    const FText& PlayerName,
    const FUniqueNetIdRepl& UniqueId
)

Create and replicate the appropriate player state for the new player

Protected function Virtual

ALobbyBeacon...

 

CreateNewPlayer

(
    const FText& PlayerName,
    const FUniqueNetIdRepl& UniqueId
)

Create a new player for this lobby beacon state

Public function Const

void

 

DumpState()

Output current state of lobby to log

Public function Const

int32

 

GetMaxPlayers()

Public function Const

int32

 

GetNumPlayers()

Public function

ALobbyBeacon...

 

GetPlayer

(
    const FUniqueNetIdRepl& UniqueId
)

Get an existing player in the lobby

Public function

ALobbyBeacon...

 

GetPlayer

(
    const FString& UniqueId
)

Get an existing player in the lobby

Public function

ALobbyBeacon...

 

GetPlayer

(
    const AOnlineBeaconClient* Cli...
)

Get an existing player in the lobby

Public function Const

bool

 

HasLobbyStarted()

Protected function

void

 

OneSecTick()

One sec tick function to handle countdowns

Public function

FOnLobbyStar...

 

OnLobbyStarted()

Public function

FOnLobbyWait...

 

OnLobbyWaitingForPlayersUpdate()

Public function

FOnPlayerLob...

 

OnPlayerLobbyStateAdded()

Public function

FOnPlayerLob...

 

OnPlayerLobbyStateRemoved()

Protected function Virtual

void

 

OnPostLobbyStartedTickInternal

(
    double DeltaTime
)

Internal helper function called as part of OneSecTick if the lobby has been started already

Protected function Virtual

void

 

OnPreLobbyStartedTickInternal

(
    double DeltaTime
)

Internal helper function called as part of OneSecTick if the lobby hasn't been started yet

Protected function UFunction

void

 

OnRep_LobbyStarted()

Handle the lobby starting

Protected function UFunction

void

 

OnRep_WaitForPlayersTimeRemaining()

Handle notification of time left to wait for lobby to start

Public function

void

 

RemovePlayer

(
    const FUniqueNetIdRepl& UniqueId
)

Remove an existing player from the lobby

Public function Virtual Const

bool

 

RequireFullLobbyToStart()

Determines whether the beacon state requires a full game before allowing a lobby to start; False by default

Public function

void

 

StartLobby()

Start the lobby for incoming players

Public function Virtual

void

 

StartWaiting()

Start the waiting for other players (first player logged in success)

Public function

void

 

UpdatePartyLeader

(
    const FUniqueNetIdRepl& PartyMembe...,
    const FUniqueNetIdRepl& NewPartyLe...
)

Update the party leader for a given player

Overridden from AActor

Name Description

Public function Virtual Const

bool

 

IsNetRelevantFor

(
    const AActor* RealViewer,
    const AActor* ViewTarget,
    const FVector& SrcLocation
)

Checks to see if this actor is relevant for a specific network connection

Public function Virtual

void

 

PostInitializeComponents()

Allow actors to initialize themselves on the C++ side after all of their components have been initialized, only called during gameplay

Overridden from UObject

Name Description

Public function Virtual

void

 

PostInitProperties()

Called after the C++ constructor and after the properties have been initialized, including those loaded from config.