ASpectatorBeaconClient

A beacon client used for making reservations with an existing game session

Choose your operating system:

Windows

macOS

Linux

Inheritance Hierarchy

References

Module

OnlineSubsystemUtils

Header

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

Include

#include "SpectatorBeaconClient.h"

Syntax

UCLASS(Transient, NotPlaceable, Config=Engine)
class ASpectatorBeaconClient : public AOnlineBeaconClient

Remarks

A beacon client used for making reservations with an existing game session

Variables

Name Description

Protected variable UProperty

bool

 

bCancelReservation

Has the reservation request been canceled

Protected variable UProperty

bool

 

bPendingReservationSent

Has the reservation request been delivered

Protected variable

FTimerHandle

 

CancelRPCFailsafe

Timer to trigger a cancel reservation request if the server doesn't respond in time

Protected variable UProperty

FString

 

DestSessionId

Session Id of the destination host

Protected variable

FTimerHandle

 

PendingCancelResponseTimerHandle

Protected variable UProperty

FSpectatorReser...

 

PendingReservation

Pending reservation that will be sent upon connection with the intended host

Protected variable

FTimerHandle

 

PendingReservationFullTimerHandle

Protected variable

FTimerHandle

 

PendingReservationUpdateTimerHandle

Protected variable

FTimerHandle

 

PendingResponseTimerHandle

Timers for delaying various responses (debug)

Protected variable UProperty

ESpectatorClien...

 

RequestType

Type of request currently being handled by this client beacon

Protected variable

FOnReservationC...

 

ReservationCountUpdate

Delegate for reservation count updates

Protected variable

FOnReservationF...

 

ReservationFull

Delegate for reservation full

Protected variable

FOnSpectatorRes...

 

ReservationRequestComplete

Delegate for reservation request responses

Constructors

Name Description

Public function

ASpectatorBeaconClient

(
    const FObjectInitializer& ObjectIn...
)

Functions

Name Description

Public function Virtual

void

 

CancelReservation()

Cancel an existing request to the remote host to revoke allocated space on the server.

Protected function

void

 

ClearTimers

(
    bool bCallFailSafeIfNeeded
)

Clear out all the timer handles listed above

Public function Virtual UFunction Client, Reliable

void

 

ClientCancelReservationResponse

Response from the host session after making a cancellation request

Public function Virtual UFunction Client, Reliable

void

 

ClientReservationResponse

Response from the host session after making a reservation request

Public function Virtual UFunction Client, Reliable

void

 

ClientSendReservationFull()

Response from the host session that the reservation is full

Public function Virtual UFunction Client, Reliable

void

 

ClientSendReservationUpdates

(
    int32 NumRemainingReservations
)

Response from the host session that the reservation count has changed

Protected function

FTimerHandle

 

DelayResponse

(
    FTimerDelegate& Delegate,
    float Delay
)

Trigger the given delegate at a later time

Public function Const

const FSpect...

 

GetPendingReservation()

Protected function

void

 

OnCancelledComplete()

Delegate triggered when a cancel reservation request is complete

Protected function

void

 

OnCancelledFailsafe()

Delegate triggered if the client doesn't hear from the server in time

Public function

FOnReservati...

 

OnReservationCountUpdate()

Delegate triggered when the host indicated a reservation count has changed

Public function

FOnReservati...

 

OnReservationFull()

Delegate triggered when the host indicated the reservation is full

Public function

FOnSpectator...

 

OnReservationRequestComplete()

Delegate triggered when a response from the spectator beacon host has been received

Protected function

void

 

ProcessCancelReservationResponse

Process a response to our CancelReservation request to the server

Protected function

void

 

ProcessReservationFull()

Process a response from the server that the reservation beacon is full

Protected function

void

 

ProcessReservationResponse

Process a response to our RequestReservation request to the server

Protected function

void

 

ProcessReservationUpdate

(
    int32 NumRemainingReservations
)

Process a response from the server with an update to the number of consumed reservations

Public function Virtual

bool

 

RequestReservation

(
    const FOnlineSessionSearchResult& ...,
    const FUniqueNetIdRepl& Requesting...,
    const FPlayerReservation& Reservat...
)

Sends a request to the remote host to allow the specified members to reserve space in the host's session.

Public function Virtual

bool

 

RequestReservation

(
    const FString& ConnectInfoStr,
    const FString& InSessionId,
    const FUniqueNetIdRepl& Requesting...,
    const FPlayerReservation& Reservat...
)

Sends a request to the remote host to allow the specified members to reserve space in the host's session.

Protected function Virtual UFunction Server, Reliable withvalidation

void

 

ServerCancelReservationRequest

(
    const FUniqueNetIdRepl& Spectator
)

Tell the server to cancel a pending or existing reservation

Protected function Virtual UFunction Server, Reliable withvalidation

void

 

ServerReservationRequest

(
    const FString& SessionId,
    const FSpectatorReservation& Reser...
)

Tell the server about the reservation request being made

Overridden from AOnlineBeaconClient

Name Description

Public function Virtual

void

 

OnConnected()

A connection has been made and RPC/replication can begin

Overridden from AOnlineBeacon

Name Description

Public function Virtual

void

 

OnFailure()

Notification that failure needs to be handled

Overridden from UObject

Name Description

Public function Virtual

void

 

BeginDestroy()

Called before destroying the object.