Navigation
API > API/Plugins > API/Plugins/OnlineSubsystemUtils
Inheritance Hierarchy
- UObjectBase
- UObjectBaseUtility
- UObject
- AActor
- AOnlineBeaconHostObject
- ASpectatorBeaconHost
References
| Module | OnlineSubsystemUtils |
| Header | /Engine/Plugins/Online/OnlineSubsystemUtils/Source/OnlineSubsystemUtils/Public/SpectatorBeaconHost.h |
| Include | #include "SpectatorBeaconHost.h" |
Syntax
UCLASS&40;Transient, NotPlaceable, Config&61;Engine&41;
class ASpectatorBeaconHost : public AOnlineBeaconHostObject
Remarks
A beacon host used for taking reservations for an existing game session
Variables
| Type | Name | Description | |
|---|---|---|---|
| bool | bIsValidationStrRequired | Do spectators require validation strings. | |
| bool | bLogoutOnSessionTimeout | Do the timeouts below cause a player to be removed from the reservation list | |
| FOnCancelationReceived | CancelationReceived | Delegate fired when the beacon indicates a reservation cancellation | |
| FOnSpectatorDuplicateReservation | DuplicateReservation | Delegate fired when the beacon detects a duplicate reservation | |
| FOnNewPlayerAdded | NewPlayerAddedDelegate | Delegate fired when reservation has been added | |
| FOnReservationUpdate | ReservationChanged | Delegate fired when the beacon indicates a reservation add/remove | |
| FOnReservationUpdate | ReservationsFull | Delegate fired when the beacon indicates all reservations are taken | |
| float | SessionTimeoutSecs | Seconds that can elapse before a reservation is removed due to player not being registered with the session | |
| TObjectPtr< USpectatorBeaconState > | State | State of the beacon | |
| float | TravelSessionTimeoutSecs | Seconds that can elapse before a reservation is removed due to player not being registered with the session during a travel | |
| FOnSpectatorValidatePlayers | ValidatePlayers | Delegate fired when asking the beacon owner if this reservation is legit |
Constructors
| Type | Name | Description | |
|---|---|---|---|
ASpectatorBeaconHost
(
const FObjectInitializer& ObjectInitializer |
Functions
| Type | Name | Description | |
|---|---|---|---|
| ESpectatorReservationResult::Type | AddSpectatorReservation
(
const FSpectatorReservation& ReservationRequest |
Attempts to add a spectator reservation to the beacon | |
| bool | DoesSessionMatch
(
const FString& SessionId |
Does the session match the one associated with this beacon | |
| void | Output current state of reservations to log | ||
| int32 | Get the maximum number of reservations allowed inside the beacon | ||
| int32 | Get the number of reservations actually used/consumed across all parties inside the beacon | ||
| bool | GetPlayerValidation
(
const FUniqueNetId& PlayerId, |
Obtain player validation string from spectator reservation entry | |
| int32 | Get the current reservation count inside the beacon NOTE: This is NOT the same as the number of consumed reservations across all parties, just the total number of reservations! | ||
| TSubclassOf< USpectatorBeaconState > | |||
| USpectatorBeaconState * | GetState () |
||
| void | HandlePlayerLogout
(
const FUniqueNetIdRepl& PlayerId |
Notify the beacon of a player logout | |
| bool | InitFromBeaconState
(
USpectatorBeaconState* PrevState |
Initialize the spectator host beacon from a previous state/configuration all existing reservations and configuration values are preserved | |
| bool | InitHostBeacon
(
int32 InMaxReservations, |
Initialize the spectator host beacon | |
| void | NewPlayerAdded
(
const FPlayerReservation& NewPlayer |
Handle a newly added player | |
| void | NotifyReservationEventNextFrame
(
FOnReservationUpdate& ReservationEvent |
||
| FOnCancelationReceived & | Delegate fired when a the beacon host cancels a reservation | ||
| FOnSpectatorDuplicateReservation & | Delegate fired when a the beacon detects a duplicate reservation | ||
| FOnNewPlayerAdded & | Delegate fired when the beacon host adds a new player | ||
| FOnReservationUpdate & | Delegate fired when a the beacon host detects that all reservations are full | ||
| FOnReservationUpdate & | Crossplay Delegate fired when a the beacon host detects a reservation addition/removal | ||
| FOnSpectatorValidatePlayers & | Delegate called when the beacon gets any request, allowing the owner to validate players at a higher level (bans,etc) | ||
| bool | PlayerHasReservation
(
const FUniqueNetId& PlayerId |
Does a given player id have an existing reservation | |
| void | ProcessCancelReservationRequest
(
ASpectatorBeaconClient* Client, |
Handle a reservation cancellation request received from an incoming client | |
| void | ProcessReservationRequest
(
ASpectatorBeaconClient* Client, |
Handle a reservation request received from an incoming client | |
| void | RegisterAuthTicket
(
const FUniqueNetIdRepl& InSpectatorId, |
Register user auth ticket with the reservation system Must have an existing reservation entry | |
| ESpectatorReservationResult::Type | RemoveSpectatorReservation
(
const FUniqueNetIdRepl& Spectator |
Attempts to remove a spectator reservation from the beacon | |
| void | Update clients with current reservation information |
Overridden from AActor
| Type | Name | Description | |
|---|---|---|---|
| void | Tick
(
float DeltaSeconds |
Function called every frame on this Actor. |
Overridden from UObject
| Type | Name | Description | |
|---|---|---|---|
| void | Called after the C++ constructor and after the properties have been initialized, including those loaded from config. |