APartyBeaconHost

A beacon host used for taking reservations for an existing game session

Choose your operating system:

Windows

macOS

Linux

Inheritance Hierarchy

References

Module

OnlineSubsystemUtils

Header

/Engine/Plugins/Online/OnlineSubsystemUtils/Source/OnlineSubsystemUtils/Public/PartyBeaconHost.h

Include

#include "PartyBeaconHost.h"

Syntax

UCLASS(Transient, NotPlaceable, Config=Engine)
class APartyBeaconHost : public AOnlineBeaconHostObject

Remarks

A beacon host used for taking reservations for an existing game session

Variables

Name Description

Protected variable UProperty Config

bool

 

bLogoutOnSessionTimeout

Do the timeouts below cause a player to be removed from the reservation list

Protected variable

FOnCancelationR...

 

CancelationReceived

Delegate fired when the beacon indicates a reservation cancellation

Protected variable

FOnDuplicateRes...

 

DuplicateReservation

Delegate fired when the beacon detects a duplicate reservation

Protected variable

FOnNewPlayerAdd...

 

NewPlayerAddedDelegate

Delegate fired when reservation has been added

Protected variable

FOnReservationU...

 

ReservationChanged

Delegate fired when the beacon indicates a reservation add/remove

Protected variable

FOnReservationU...

 

ReservationsFull

Delegate fired when the beacon indicates all reservations are taken

Protected variable UProperty Transient, Config

float

 

SessionTimeoutSecs

Seconds that can elapse before a reservation is removed due to player not being registered with the session

Protected variable UProperty

TObjectPtr< UPa...

 

State

State of the beacon

Protected variable UProperty Transient, Config

float

 

TravelSessionTimeoutSecs

Seconds that can elapse before a reservation is removed due to player not being registered with the session during a travel

Protected variable

FOnValidatePlay...

 

ValidatePlayers

Delegate fired when asking the beacon owner if this reservation is legit

Constructors

Name Description

Public function

APartyBeaconHost

(
    const FObjectInitializer& ObjectIn...
)

Functions

Name Description

Public function Virtual

EPartyReserv...

 

AddPartyReservation

(
    const FPartyReservation& Reservati...
)

Attempts to add a party reservation to the beacon

Public function Virtual

bool

 

ChangeTeam

(
    const FUniqueNetIdRepl& PartyLeade...,
    int32 NewTeamNum
)

Place a party on a new team, party must fit and team must exist

Protected function Const

bool

 

DoesSessionMatch

(
    const FString& SessionId
)

Does the session match the one associated with this beacon

Public function Virtual Const

void

 

DumpReservations()

Output current state of reservations to log

Public function Virtual Const

int32

 

GetMaxAvailableTeamSize()

Determine the maximum team size that can be accommodated based on the current reservation slots occupied.

Public function Virtual Const

int32

 

GetMaxPlayersPerTeam()

Get the max number of players per team

Public function Virtual Const

int32

 

GetMaxReservations()

Get the maximum number of reservations allowed inside the beacon

Public function Virtual Const

int32

 

GetNumConsumedReservations()

Get the number of reservations actually used/consumed across all parties inside the beacon

Public function Const

int32

 

GetNumPlayersOnTeam

(
    int32 TeamIdx
)

Get the number of players on a team across all existing reservations

Public function Const

int32

 

GetNumTeams()

Get the number of teams.

Protected function Virtual Const

TSubclassOf<...

 

GetPartyBeaconHostClass()

Public function Const

bool

 

GetPartyLeader

(
    const FUniqueNetIdRepl& InPartyMem...,
    FUniqueNetIdRepl& OutPartyLeaderId
)

Get the party leader for a given unique id

Public function Const

int32

 

GetPlayersOnTeam

(
    int32 TeamIndex,
    TArray< FUniqueNetIdRepl >& TeamMe...
)

Get all the known players on a given team

Public function Virtual Const

bool

 

GetPlayerValidation

(
    const FUniqueNetId& PlayerId,
    FString& OutValidation
)

Obtain player validation string from party reservation entry

Public function Virtual Const

int32

 

GetReservationCount()

Get the current reservation count inside the beacon

Public function Virtual Const

int32

 

GetReservationPlatformCount

(
    const FString& InPlatform,
    bool bIncludeMappedPlatforms
)

Get a count of all players for a given platform

Public function Const

UPartyBeacon...

 

GetState()

Public function Const

int32

 

GetTeamForCurrentPlayer

(
    const FUniqueNetId& PlayerId
)

Finds the current team assignment of the given player net id.

Public function Virtual

void

 

HandlePlayerLogout

(
    const FUniqueNetIdRepl& PlayerId
)

Notify the beacon of a player logout

Public function Virtual Const

bool

 

HasCrossplayOptOutReservation()

Crossplay

Public function Virtual

bool

 

InitFromBeaconState

(
    UPartyBeaconState* PrevState
)

Initialize the party host beacon from a previous state/configuration all existing reservations and configuration values are preserved

Public function Virtual

bool

 

InitHostBeacon

(
    int32 InTeamCount,
    int32 InTeamSize,
    int32 InMaxReservations,
    FName InSessionName,
    int32 InForceTeamNum,
    bool bInEnableRemovalRequests
)

Initialize the party host beacon

Protected function

void

 

NewPlayerAdded

(
    const FPlayerReservation& NewPlaye...
)

Handle a newly added player

Protected function

void

 

NotifyReservationEventNextFrame

(
    FOnReservationUpdate& ReservationE...
)

Public function

FOnCancelati...

 

OnCancelationReceived()

Delegate fired when a the beacon host cancels a reservation

Public function

FOnDuplicate...

 

OnDuplicateReservation()

Delegate fired when a the beacon detects a duplicate reservation

Public function

FOnNewPlayer...

 

OnNewPlayerAdded()

Delegate fired when the beacon host adds a new player

Public function

FOnReservati...

 

OnReservationChanged()

Delegate fired when a the beacon host detects a reservation addition/removal

Public function

FOnReservati...

 

OnReservationsFull()

Delegate fired when a the beacon host detects that all reservations are full

Public function

FOnValidateP...

 

OnValidatePlayers()

Delegate called when the beacon gets any request, allowing the owner to validate players at a higher level (bans,etc)

Public function Virtual Const

bool

 

PlayerHasReservation

(
    const FUniqueNetId& PlayerId
)

Does a given player id have an existing reservation

Protected function

void

 

PlayerRemoved

(
    const FPlayerReservation& RemovedP...
)

Handle a newly removed player

Public function Virtual

void

 

ProcessCancelReservationRequest

(
    APartyBeaconClient* Client,
    const FUniqueNetIdRepl& PartyLeade...
)

Handle a reservation cancellation request received from an incoming client

Public function Virtual

void

 

ProcessReservationAddOrUpdateRequest

(
    APartyBeaconClient* Client,
    const FString& SessionId,
    const FPartyReservation& Reservati...
)

Handle a reservation add or update request depending on reservation existance received from an incoming client

Public function Virtual

void

 

ProcessReservationRequest

(
    APartyBeaconClient* Client,
    const FString& SessionId,
    const FPartyReservation& Reservati...
)

Handle a reservation request received from an incoming client

Public function Virtual

void

 

ProcessReservationUpdateRequest

(
    APartyBeaconClient* Client,
    const FString& SessionId,
    const FPartyReservation& Reservati...,
    bool bIsRemovingMember
)

Handle a reservation update request received from an incoming client

Public function Virtual

bool

 

ReconfigureTeamAndPlayerCount

(
    int32 InNumTeams,
    int32 InNumPlayersPerTeam,
    int32 InNumReservations
)

Reconfigures the beacon for a different team/player count configuration Allows dedicated server to change beacon parameters after a playlist configuration has been made Does no real checking against current reservations because we assume the UI wouldn't let this party start a gametype if they were too big to fit on a team together

Public function

void

 

RegisterAuthTicket

(
    const FUniqueNetIdRepl& InPartyMem...,
    const FString& InAuthTicket
)

Register user auth ticket with the reservation system Must have an existing reservation entry

Public function Virtual

EPartyReserv...

 

RemovePartyReservation

(
    const FUniqueNetIdRepl& PartyLeade...
)

Attempts to remove a party reservation from the beacon

Protected function

void

 

SendReservationUpdates()

Update clients with current reservation information

Public function Virtual

void

 

SetTeamAssignmentMethod

(
    FName NewAssignmentMethod
)

Define the method for assignment new reservations to teams

Public function Virtual

bool

 

SwapTeams

(
    const FUniqueNetIdRepl& PartyLeade...,
    const FUniqueNetIdRepl& OtherParty...
)

Swap the parties between teams, parties must be of same size

Public function Virtual

void

 

UpdatePartyLeader

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

Update party leader for a given player with the reservation beacon (needed when party leader leaves, reservation beacon is in a temp/bad state until someone updates this)

Public function Virtual

EPartyReserv...

 

UpdatePartyReservation

(
    const FPartyReservation& Reservati...,
    bool bIsRemovingMembers
)

Updates an existing party reservation on the beacon An existing reservation for this party leader must already exist

Overridden from AActor

Name Description

Public function Virtual

void

 

Tick

(
    float DeltaSeconds
)

Function called every frame on this Actor.

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.