UPartyBeaconState

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/PartyBeaconState.h

Include

#include "PartyBeaconState.h"

Syntax

UCLASS(Transient, Config=Engine)
class UPartyBeaconState : public UObject

Remarks

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

Variables

Name Description

Protected variable UProperty Transient

bool

 

bEnableRemovalRequests

Process requests from clients to remove players from beacon

Protected variable UProperty Config

bool

 

bRestrictCrossConsole

Are multiple consoles types allowed to play together

Protected variable UProperty Transient

int32

 

ForceTeamNum

Team that everyone is forced to in single team games

Protected variable UProperty Transient

int32

 

MaxReservations

Maximum allowed reservations

Protected variable UProperty Transient

int32

 

NumConsumedReservations

Number of currently consumed reservations

Protected variable UProperty Transient

int32

 

NumPlayersPerTeam

Number of players on each team for balancing

Protected variable UProperty Transient

int32

 

NumTeams

Number of teams in the game

Protected variable UProperty Config

TArray< FString...

 

PlatformCrossplayRestrictions

Platform crossplay restrictions.

Protected variable UProperty Config

TArray< FPartyB...

 

PlatformTypeMapping

Protected variable

TArray< FUnique...

 

PlayersPendingJoin

Players that are expected to join shortly

Protected variable UProperty Transient

TArray< FPartyR...

 

Reservations

Current reservations in the system

Protected variable UProperty Transient

int32

 

ReservedHostTeamNum

Team that the host has been assigned to

Protected variable UProperty Transient

FName

 

SessionName

Session tied to the beacon

Protected variable UProperty Transient

FName

 

TeamAssignmentMethod

Team assignment method

Constructors

Name Description

Public function

UPartyBeaconState

(
    const FObjectInitializer& ObjectIn...
)

Functions

Name Description

Public function Virtual

bool

 

AddReservation

(
    const FPartyReservation& Reservati...
)

Add a reservation to the beacon state, tries to assign a team

Public function Virtual Const

bool

 

AreTeamsAvailable

(
    const FPartyReservation& Reservati...
)

Determine if there are any teams that can fit the current party request.

Protected function Virtual

void

 

BestFitTeamAssignmentJiggle()

Arrange reservations to make the most room available on a single team allowing larger parties to fit into this session Since teams change, this shouldn't be used after the teams have been set in the game logic

Public function Virtual

bool

 

ChangeTeam

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

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

Public function Virtual Const

bool

 

CrossPlayAllowed

(
    const FPartyReservation& Reservati...
)

Perform a cross play compatible check for the new reservation against existing reservations

Public function Virtual Const

bool

 

DoesReservationFit

(
    const FPartyReservation& Reservati...
)

Determine if this reservation fits all rules for fitting in the game

Public function Virtual Const

void

 

DumpReservations()

Output current state of reservations to log

Public function Virtual Const

int32

 

GetExistingReservation

(
    const FUniqueNetIdRepl& PartyLeade...
)

Get an existing reservation for a given party

Public function Virtual Const

int32

 

GetExistingReservationContainingMember

(
    const FUniqueNetIdRepl& PartyMembe...
)

Get an existing reservation containing a given party member

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()

Public function Virtual Const

int32

 

GetNumConsumedReservations()

Public function Virtual Const

int32

 

GetNumPlayersOnTeam

(
    int32 TeamIdx
)

Get the number of current players on a given team.

Public function Virtual Const

int32

 

GetNumTeams()

Get the number of teams.

Public function Virtual 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

 

GetRemainingReservations()

Public function Virtual Const

int32

 

GetReservationCount()

Get the current reservation count inside the beacon this is NOT the number of players in the game

Public function Virtual Const

int32

 

GetReservationPlatformCount

(
    const FString& InPlatform,
    bool bIncludeMappedPlatforms
)

Get a count of all players for a given platform

Public function Virtual

TArray< FPar...

 

GetReservations()

Public function Virtual Const

FName

 

GetSessionName()

Public function Virtual

int32

 

GetTeamAssignment

(
    const FPartyReservation& Party
)

Determine the team number for the given party reservation request.

Public function Virtual Const

int32

 

GetTeamForCurrentPlayer

(
    const FUniqueNetId& PlayerId
)

Get the team index for a given player

Public function Virtual Const

bool

 

HasCrossplayOptOutReservation()

Public function Virtual

bool

 

InitState

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

Initialize this state object

Public function Virtual

void

 

InitTeamArray()

Randomly assign a team for the reservation configuring the beacon

Public function Virtual Const

bool

 

IsBeaconFull()

Public function Virtual Const

bool

 

PlayerHasReservation

(
    const FUniqueNetId& PlayerId
)

Does a given player id have an existing reservation

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

bool

 

RemovePlayer

(
    const FUniqueNetIdRepl& PlayerId
)

Remove a single player from their party's reservation

PlayerId player to remove

Public function Virtual

bool

 

RemoveReservation

(
    const FUniqueNetIdRepl& PartyLeade...
)

Remove an entire reservation from this state object

Protected function Const

void

 

SanityCheckReservations

(
    const bool bIgnoreEmptyReservations
)

Check that our reservations are in a good state

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 able to fit on other team after swap

Public function Virtual

bool

 

UpdateMemberPlatform

(
    const FUniqueNetIdRepl& PartyMembe...,
    const FString& PlatformName
)

Updates the platform on an existing reservation (Used when MMS does not set a platform when handing out a match assignment)

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)