Cogito, ergo sum

UE3:PartyBeaconHost (UDK)

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to: navigation, search
UDK Object >> PartyBeacon >> PartyBeaconHost
Package: 
IpDrv

This class is used to create a network accessible beacon for responding to reservation requests for party matches. It handles all tracking of who has reserved space, how much space is available, and how many parties can reserve space.

Properties[edit]

bBestFitTeamAssignment[edit]

Type: bool

Force new reservations to teams with the smallest accommodating need size, otherwise team assignment is random

Clients[edit]

Type: array<ClientBeaconConnection>

Modifiers: const

The object that is used to send/receive data with the remote host/client

ConnectionBacklog[edit]

Type: int

Modifiers: config

The number of connections to allow before refusing them

NumConsumedReservations[edit]

Type: int

Modifiers: const

The number of slots that have been consumed by parties in total (saves having to iterate and sum)

NumPlayersPerTeam[edit]

Type: int

Modifiers: const

The number of players required for a full team

NumReservations[edit]

Type: int

Modifiers: const

The number of players that are allowed to reserve space

NumTeams[edit]

Type: int

Modifiers: const

The number of teams that these players will be divided amongst

OnlineSessionName[edit]

Type: name

The online session name that players will register with

Reservations[edit]

Type: array<PartyBeacon.PartyReservation>

Modifiers: const

The list of accepted reservations

ReservedHostTeamNum[edit]

Type: int

Modifiers: const

The team the host (owner of the beacon) is assigned to when random teams are chosen

Structs[edit]

ClientBeaconConnection[edit]

Modifiers: native

Holds the information for a client and whether they've timed out

OnlineSubsystem.UniqueNetId PartyLeader 
The unique id of the party leader for this connection
float ElapsedHeartbeatTime 
How long it's been since the last heartbeat
pointer{FSocket} Socket 
The socket this client is communicating on

Delegates[edit]

OnClientCancellationReceived[edit]

delegate OnClientCancellationReceived (OnlineSubsystem.UniqueNetId PartyLeader)

Called by the beacon when a client cancels a reservation

Parameters:

  • PartyLeader - the party leader that is cancelling the reservation

OnReservationChange[edit]

delegate OnReservationChange ()

Called by the beacon when a reservation occurs or is cancelled so that UI can be updated, etc.

OnReservationsFull[edit]

delegate OnReservationsFull ()

Called by the beacon when all of the available reservations have been filled

Functions[edit]

Native functions[edit]

DestroyBeacon[edit]

native event DestroyBeacon ()

Overrides: PartyBeacon.DestroyBeacon

Stops listening for clients and releases any allocated memory

AddPartyReservationEntry[edit]

native function PartyBeacon.EPartyReservationResult AddPartyReservationEntry (OnlineSubsystem.UniqueNetId PartyLeader, const out array<PartyBeacon.PlayerReservationPlayerMembers, int TeamNum, bool bIsHost)

Add a new party to the reservation list. Avoids adding duplicate entries based on party leader.

Parameters:

  • PartyLeader - the party leader that is adding the reservation
  • PlayerMembers - players (including party leader) being added to the reservation
  • TeamNum - team assignment of the new party
  • bIsHost - treat the party as the game host

Returns:

EPartyReservationResult similar to a client update request

AppendReservationSkillsToSearch[edit]

native function AppendReservationSkillsToSearch (OnlineGameSearch Search)

Appends the skills from all reservations to the search object so that they can be included in the search information

Parameters:

  • Search - the search object to update

GetMaxAvailableTeamSize[edit]

native function int GetMaxAvailableTeamSize ()

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

Returns:

maximum team size that is currently available

HandlePlayerLogout[edit]

native function HandlePlayerLogout (OnlineSubsystem.UniqueNetId PlayerId, bool bMaintainParty)

Called when a player logs out of the current game. The player's party reservation entry is freed up so that a new reservation request can be accepted.

Parameters:

  • PlayerId - the net Id of the player that just logged out
  • bMaintainParty - if TRUE then preserve party members of a reservation when the party leader logs out

InitHostBeacon[edit]

native function bool InitHostBeacon (int InNumTeams, int InNumPlayersPerTeam, int InNumReservations, name InSessionName)

Creates a listening host beacon with the specified number of parties, players, and the session name that remote parties will be registered under

Parameters:

  • InNumTeams - the number of teams that are expected to join
  • InNumPlayersPerTeam - the number of players that are allowed to be on each team
  • InNumReservations - the total number of players to allow to join (if different than team * players)
  • InSessionName - the name of the session to add the players to when a reservation occurs

Returns:

true if the beacon was created successfully, false otherwise

TellClientsHostHasCancelled[edit]

native function TellClientsHostHasCancelled ()

Tells all of the clients that the host has cancelled the matchmaking beacon and that they need to find a different host

TellClientsHostIsReady[edit]

native function TellClientsHostIsReady ()

Tells all of the clients that the host is ready for them to travel to the host connection

TellClientsToTravel[edit]

native function TellClientsToTravel (name SessionName, class<OnlineGameSearchSearchClass, byte PlatformSpecificInfo[68])

Tells all of the clients to go to a specific session (contained in platform specific info). Used to route clients that aren't in the same party to one destination.

Parameters:

  • SessionName - the name of the session to register
  • SearchClass - the search that should be populated with the session
  • PlatformSpecificInfo - the binary data to place in the platform specific areas

UpdatePartyReservationEntry[edit]

native function PartyBeacon.EPartyReservationResult UpdatePartyReservationEntry (OnlineSubsystem.UniqueNetId PartyLeader, const out array<PartyBeacon.PlayerReservationPlayerMembers)

Update a party with an existing reservation Avoids adding duplicate entries to the player members of a party.

Parameters:

  • PartyLeader - the party leader for which the existing reservation entry is being updated
  • PlayerMembers - players (not including party leader) being added to the existing reservation

Returns:

EPartyReservationResult similar to a client update request

Events[edit]

RegisterPartyMembers[edit]

event RegisterPartyMembers ()

Registers all of the parties as part of the session that this beacon is associated with

UnregisterParty[edit]

event UnregisterParty (OnlineSubsystem.UniqueNetId PartyLeader)

Unregisters each of the party members that have the specified party leader

Parameters:

  • PartyLeader - the leader to search for in the reservation array

UnregisterPartyMembers[edit]

event UnregisterPartyMembers ()

Unregisters each of the party members at the specified reservation with the session

Other instance functions[edit]

AreReservationsFull[edit]

function bool AreReservationsFull ()

Determine if the beacon has filled all open reservation slots

Returns:

TRUE if all reservations have been consumed by party members

DumpReservations[edit]

function DumpReservations ()

Logs the reservation information for this beacon

GetPartyLeaders[edit]

function GetPartyLeaders (out array<OnlineSubsystem.UniqueNetIdPartyLeaders)

Gathers all the unique ids for party leaders that have reservations

GetPlayers[edit]

function GetPlayers (out array<OnlineSubsystem.UniqueNetIdPlayers)

Gathers all the unique ids for players that have reservations