Always snap to grid

UE3:MeshBeaconClient (UDK)

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

This class is used to connect to a host mesh beacon in order to establish a connected mesh network.

Properties[edit]

bUsingRegisteredAddr[edit]

Type: bool

Modifiers: transient

TRUE if address was registered with the beacon address resolver

ClientBeaconRequestType[edit]

Type: MeshBeacon.EMeshBeaconPacketType

The pending request to be sent

ClientBeaconState[edit]

Type: EMeshBeaconClientState

The state of the client beacon as it establishes a connection to the host

ClientPendingRequest[edit]

Type: ClientConnectionRequest

Modifiers: const

Active connection request that is pending for this client

ConnectionRequestElapsedTime[edit]

Type: float

Used to track how long we've been waiting for a connection response

ConnectionRequestTimeout[edit]

Type: float

Modifiers: config

Indicates how long the client should wait for a connection response before timing out

CurrentBandwidthTest[edit]

Type: ClientBandwidthTestData

The upstream test state for the client

HostPendingRequest[edit]

Type: OnlineGameSearch.OnlineGameSearchResult

Modifiers: const

Holds a reference to the data that is used to reach the potential host while a connection is being established for this client

Resolver[edit]

Type: ClientBeaconAddressResolver

Platform specific address resolver for this beacon. Instantiated using the ResolverClass type.

ResolverClass[edit]

Type: class<ClientBeaconAddressResolver>

Class to use for address resolving and registering

ResolverClassName[edit]

Type: string

Modifiers: config

Name of the class to use for address resolving and registering

Enums[edit]

EMeshBeaconClientState[edit]

Used to drive the client state machine

MBCS_None 
MBCS_Connecting 
MBCS_Connected 
MBCS_ConnectionFailed 
MBCS_AwaitingResponse 
MBCS_Closed 

Structs[edit]

ClientBandwidthTestData[edit]

Modifiers: native

Keeps track of all data needed for the current upstream bandwidth test

MeshBeacon.EMeshBeaconBandwidthTestType TestType 
Type of test current being done
MeshBeacon.EMeshBeaconBandwidthTestState CurrentState 
State of the bandwidth test for the client
int NumBytesToSendTotal 
Total bytes expected to be sent in order to complete this test
int NumBytesSentTotal 
Tally of bytes that have been sent so far for the test
int NumBytesSentLast 
Size of last buffer that was sent for the test
float ElapsedTestTime 
Time since test was started

ClientConnectionRequest[edit]

Modifiers: native

Used to send the initial client connection request to the host

OnlineSubsystem.UniqueNetId PlayerNetId 
Net Id of primary player on this client
OnlineSubsystem.ENATType NatType 
NAT Type for this client
bool bCanHostVs 
TRUE if the client is able to host a vs match
float GoodHostRatio 
Ratio of successful vs unsuccessful matches hosted by this client in the past
array<MeshBeacon.ConnectionBandwidthStats> BandwidthHistory 
History of bandwidth results from previous tests. Saved/loaded in the player's profile
int MinutesSinceLastTest 
Elapsed time in minutes since the last bandwidth test

Delegates[edit]

OnConnectionRequestResult[edit]

delegate OnConnectionRequestResult (MeshBeacon.EMeshBeaconConnectionResult ConnectionResult)

Delegate called by the client mesh beacon when a connection request has been responded to by the destination host

Parameters:

  • ConnectionResult - whether the connection request was successful

OnCreateNewSessionRequestReceived[edit]

delegate OnCreateNewSessionRequestReceived (name SessionName, class<OnlineGameSearchSearchClass, const out array<MeshBeacon.PlayerMemberPlayers)

Delegate called by the client mesh beacon when the host sends a request for a client to create a new game session. Used during game session migration to a new host.

Parameters:

  • SessionName - the name of the session to register
  • SearchClass - the search that should be populated with the session
  • Players - list of players to register on the newly created session

OnReceivedBandwidthTestRequest[edit]

delegate OnReceivedBandwidthTestRequest (MeshBeacon.EMeshBeaconBandwidthTestType TestType)

Delegate called by the client mesh beacon when a new bandwidth test request has been received from the host.

Parameters:

  • TestType - test to run based on enum of EMeshBeaconBandwidthTestType supported bandwidth test types

OnReceivedBandwidthTestResults[edit]

delegate OnReceivedBandwidthTestResults (MeshBeacon.EMeshBeaconBandwidthTestType TestType, MeshBeacon.EMeshBeaconBandwidthTestResult TestResult, const out MeshBeacon.ConnectionBandwidthStats BandwidthStats)

Delegate called by the client mesh beacon when bandwidth testing has completed on the host and the results have been sent back to this client.

Parameters:

  • TestType - test that completed based on enum of EMeshBeaconBandwidthTestType supported bandwidth test types
  • TestResult - overall result from running the test
  • BandwidthStats - statistics and timing information from running the test

OnTravelRequestReceived[edit]

delegate OnTravelRequestReceived (name SessionName, class<OnlineGameSearchSearchClass, const out byte PlatformSpecificInfo[68])

Delegate called by the client mesh beacon when the host sends a request for all clients to travel to the destination included in the packet.

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

Functions[edit]

Native functions[edit]

DestroyBeacon[edit]

native event DestroyBeacon ()

Overrides: MeshBeacon.DestroyBeacon

Stops listening for requests/responses and releases any allocated memory

BeginBandwidthTest[edit]

native function bool BeginBandwidthTest (MeshBeacon.EMeshBeaconBandwidthTestType TestType, int TestBufferSize)

Have this client start a bandwidth test on the connected host by sending a start packet and then streaming as many dummy packets as possible before timeout (MaxBandwidthTestSendTime).

Parameters:

  • TestType - test to run based on enum of EMeshBeaconBandwidthTestType supported bandwidth test types
  • TestBufferSize - size in bytes of total data to be sent for the bandwidth test

Returns:

TRUE if the test was successfully started

RequestConnection[edit]

native function bool RequestConnection (const out OnlineGameSearch.OnlineGameSearchResult DesiredHost, const out ClientConnectionRequest ClientRequest, bool bRegisterSecureAddress)

Request a connection to be established to the remote host. As part of the connection request also send the NAT type and bandwidth history data for the client. Note this request is async and the results will be sent via the delegate

Parameters:

  • DesiredHost - the server that the connection will be made to
  • ClientRequest - the client data that is going to be sendt with the request
  • bRegisterSecureAddress - if TRUE then then key exchange is required to connect with the host

Returns:

TRUE if the request async task started ok, false if it failed to send

SendHostNewGameSessionResponse[edit]

native function bool SendHostNewGameSessionResponse (bool bSuccess, name SessionName, class<OnlineGameSearchSearchClass, const out byte PlatformSpecificInfo[68])

Notify host of a newly created game session by this client. Host can decide to use/discard the new game session.

Parameters:

  • bSuccess - TRUE if the session was created successfully
  • SessionName - the name of the session that was created
  • SearchClass - the search that should be populated with the session
  • PlatformSpecificInfo - the binary data to place in the platform specific areas

Other instance functions[edit]

DebugRender[edit]

function DebugRender (Canvas Canvas)

Render debug info about the client mesh beacon

Parameters:

  • Canvas - canvas object to use for rendering debug info

DumpInfo[edit]

function DumpInfo ()

Render debug info about the client mesh beacon