The three virtues of a programmer: Laziness, Impatience, and Hubris. – Larry Wall
UE3:MeshBeaconHost (UDK)
Object >> MeshBeacon >> MeshBeaconHost |
Contents
- 1 Properties
- 2 Structs
- 3 Delegates
- 4 Functions
- 4.1 Native functions
- 4.1.1 DestroyBeacon
- 4.1.2 AllPlayersConnected
- 4.1.3 CancelInProgressBandwidthTests
- 4.1.4 CancelPendingBandwidthTests
- 4.1.5 GetConnectionIndexForPlayer
- 4.1.6 HasInProgressBandwidthTest
- 4.1.7 HasPendingBandwidthTest
- 4.1.8 InitHostBeacon
- 4.1.9 RequestClientBandwidthTest
- 4.1.10 RequestClientCreateNewSession
- 4.1.11 TellClientsToTravel
- 4.2 Other instance functions
- 4.1 Native functions
- Package:
- IpDrv
This is an auto-generated page and may need human attention. Please remove the {{autogenerated}} tag if the page seems reasonably complete or replace it with the {{expand}} tag if the page is not yet complete. |
This class is used to handle connections from client mesh beacons in order to establish a mesh network.
Properties[edit]
bAllowBandwidthTesting[edit]
Type: bool
Modifiers: private
TRUE if new bandwidth test requests should be handled. Set to false to ignore any pending and new requests.
Default value: True
ClientConnections[edit]
Type: array<ClientMeshBeaconConnection>
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
OwningPlayerId[edit]
Type: OnlineSubsystem.UniqueNetId
Modifiers: const
Net Id of player that is hosting this beacon
PendingPlayerConnections[edit]
Type: array<OnlineSubsystem.UniqueNetId>
Modifiers: private
List of players this beacon is waiting to establish connections to.
Structs[edit]
ClientConnectionBandwidthTestData[edit]
Modifiers: native
Stats stored for the current bandwidth test on a client connection
- MeshBeacon.EMeshBeaconBandwidthTestState CurrentState
- Current progress of bandwidth test. Only one client should be MB_BandwidthTestState_InProgress at a time.
- MeshBeacon.EMeshBeaconBandwidthTestType TestType
- Type of bandwidth test currently running
- int BytesTotalNeeded
- Total bytes needed to complete the test
- int BytesReceived
- Total bytes received by the client so far
- Object.double RequestTestStartTime
- Time when request was first sent to client to start the test
- Object.double TestStartTime
- Time when first response was received from client to being the test
- MeshBeacon.ConnectionBandwidthStats BandwidthStats
- Resulting stats from the bandwidth test
ClientMeshBeaconConnection[edit]
Modifiers: native
Holds the information for a client and whether they've timed out
- OnlineSubsystem.UniqueNetId PlayerNetId
- The unique id of the player for this connection
- float ElapsedHeartbeatTime
- How long it's been since the last heartbeat
- pointer{FSocket} Socket
- The socket this client is communicating on
- bool bConnectionAccepted
- True if the client connection has already been accepted for this player
- ClientConnectionBandwidthTestData BandwidthTest
- Bandwidth test being run for the client
- OnlineSubsystem.ENATType NatType
- The NAT of the client as reported by the 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
- Previous bandwidth history reported by the client ordered from newest to oldest.
New bandwidth tests that occur on this host also get added to this history.
- int MinutesSinceLastTest
- Elapsed time in minutes since the last bandwidth test
Delegates[edit]
OnAllPendingPlayersConnected[edit]
Delegate called by the host mesh beacon when all players in the PendingPlayerConnections list get connections.
OnFinishedBandwidthTest[edit]
Delegate called by the host mesh beacon when bandwidth testing has completed for a client connection. This occurs when the test completes successfully or due to error/timeout.
Parameters:
- PlayerNetId - net id for player of client connection that finished the test
- 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
OnReceivedClientConnectionRequest[edit]
Delegate called by the host mesh beacon after establishing a new client socket and receiving the data for a new connection request.
Parameters:
- NewClientConnection - client that sent the request for a new connection
OnReceivedClientCreateNewSessionResult[edit]
Delegate called by the host mesh beacon when it gets the results of a new game session creation on a client.
Parameters:
- bSucceeded - TRUE if the the new session was created on the client
- SessionName - the name of the session to create
- SearchClass - the search that should be with corresponding game settings when creating the session
- PlatformSpecificInfo - the platform specific binary data of the new session
OnStartedBandwidthTest[edit]
Delegate called by the host mesh beacon when bandwidth testing has started for a client connection. This occurs only when the client sends the start packet to initiate the test.
Parameters:
- PlayerNetId - net id for player of client connection that started the test
- TestType - test to run based on enum of EMeshBeaconBandwidthTestType supported bandwidth test types
Functions[edit]
Native functions[edit]
DestroyBeacon[edit]
Overrides: MeshBeacon.DestroyBeacon
Stops listening for clients and releases any allocated memory
AllPlayersConnected[edit]
Determine if the players all have connections on this host beacon
Parameters:
- Players - list of player ids we are searching for
Returns:
- TRUE if all players had connections
CancelInProgressBandwidthTests[edit]
Cancel any bandwidth tests that are already in progress.
CancelPendingBandwidthTests[edit]
Cancel any bandwidth tests that are pending.
GetConnectionIndexForPlayer[edit]
Determine if the given player has an active connection on this host beacon.
Parameters:
- PlayerNetId - player we are searching for
Returns:
- index within ClientConnections for the player's connection, -1 if not found
HasInProgressBandwidthTest[edit]
Determine if a client is currently running a bandwidth test.
Returns:
- TRUE if a client connection is currently running a bandwidth test
HasPendingBandwidthTest[edit]
Determine if a client is currently waiting/pending for a bandwidth test.
Returns:
- TRUE if a client connection is currently pending a bandwidth test
InitHostBeacon[edit]
Creates a listening host mesh beacon to accept new client connections.
Parameters:
- InOwningPlayerId - Net Id of player that is hosting this beacon
Returns:
- true if the beacon was created successfully, false otherwise
RequestClientBandwidthTest[edit]
Send a request to a client connection to initiate a new bandwidth test.
Parameters:
- PlayerNetId - player with an active connection to receive test request
- TestType - EMeshBeaconBandwidthTestType type of bandwidth test to request
- TestBufferSize - size of buffer in bytes to use for running the test
Returns:
- TRUE if the request was successfully sent to the client
RequestClientCreateNewSession[edit]
Sends a request to a specified client to create a new game session.
Parameters:
- PlayerNetId - net id of player for client connection to send request to
- SessionName - the name of the session to create
- SearchClass - the search that should be with corresponding game settings when creating the session
- Players - list of players to register on the newly created session
TellClientsToTravel[edit]
Tells all of the clients to go to a specific session (contained in platform specific info). Used to route all clients 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
Other instance functions[edit]
AllowBandwidthTesting[edit]
Enable/disable future bandwidth test requests and current pending tests.
Parameters:
- bEnabled - true to allow bandwidth testing to be processed by the beacon
DebugRender[edit]
Render debug info about the client mesh beacon
Parameters:
- Canvas - canvas object to use for rendering debug info
- CurOptimalHostId - net id of player that should be highlighted as the current optimal host
DumpConnections[edit]
Logs the all the connected clients of this this beacon
SetPendingPlayerConnections[edit]
Set list of pending player ids we are waiting to connect with. Once all connections are established then the OnAllPendingPlayersConnected delegate is called.
Parameters:
- Players - list of player ids we are waiting to connect