Photon Fusion 2.1.1

INetPeerGroupCallbacks Interface Reference

Defines the callbacks for network peer group events. More...

Inherited by Simulation.

Public Member Functions

void OnConnected (NetConnection *connection)
 Called when a connection is established.
void OnConnectionAttempt (NetConnection *connection, int attempts, int totalConnectAttempts)
 Called when a connection attempt is made.
void OnConnectionFailed (NetAddress address, NetConnectFailedReason reason)
 Called when a connection attempt fails.
OnConnectionRequestReply OnConnectionRequest (NetAddress remoteAddress, byte[] token, byte[] uniqueId)
 Called when a connection request is received.
void OnDisconnected (NetConnection *connection, NetDisconnectReason reason)
 Called when a connection is disconnected.
bool OnNotifyData (NetConnection *connection, ReadBuffer buffer)
 Called when notify data is received.
void OnNotifyDataDelivered (NetConnection *connection, in NetNotifyDataInfo info)
 Called when notify data is delivered.
void OnNotifyDataLost (NetConnection *connection, in NetNotifyDataInfo info)
 Called when notify data is lost.
void OnRejoinRequest (string sessionId)
 Called when this peer was requested to re-join into another Session.
void OnReliableData (NetConnection *connection, ReadOnlySpan< byte > data)
void OnUnconnectedData (NetBitBuffer *buffer)
 Called when unconnected data is received.
void OnUnreliableData (NetConnection *connection, NetBitBuffer *buffer)
 Called when unreliable data is received.

Properties

List< IntPtr > DeliverList [get]
 DeliverList.

Detailed Description

Defines the callbacks for network peer group events.

Member Function Documentation

◆ OnConnected()

void OnConnected ( NetConnection * connection)

Called when a connection is established.

Parameters
connectionThe connection that was established.

◆ OnConnectionAttempt()

void OnConnectionAttempt ( NetConnection * connection,
int attempts,
int totalConnectAttempts )

Called when a connection attempt is made.

Parameters
connectionThe connection being attempted.
attemptsThe number of attempts made.
totalConnectAttemptsThe total number of connection attempts.

◆ OnConnectionFailed()

void OnConnectionFailed ( NetAddress address,
NetConnectFailedReason reason )

Called when a connection attempt fails.

Parameters
addressThe address of the remote peer.
reasonThe reason for the connection failure.

◆ OnConnectionRequest()

OnConnectionRequestReply OnConnectionRequest ( NetAddress remoteAddress,
byte[] token,
byte[] uniqueId )

Called when a connection request is received.

Parameters
remoteAddressThe address of the remote peer.
tokenThe token associated with the connection request.
uniqueIdThe unique identifier for the connection request.
Returns
The reply to the connection request.

◆ OnDisconnected()

void OnDisconnected ( NetConnection * connection,
NetDisconnectReason reason )

Called when a connection is disconnected.

Parameters
connectionThe connection that was disconnected.
reasonThe reason for disconnection.

◆ OnNotifyData()

bool OnNotifyData ( NetConnection * connection,
ReadBuffer buffer )

Called when notify data is received.

Parameters
connectionThe connection from which the data was received.
bufferThe buffer containing the data.

◆ OnNotifyDataDelivered()

void OnNotifyDataDelivered ( NetConnection * connection,
in NetNotifyDataInfo info )

Called when notify data is delivered.

Parameters
connectionThe connection to which the data was delivered.
info

◆ OnNotifyDataLost()

void OnNotifyDataLost ( NetConnection * connection,
in NetNotifyDataInfo info )

Called when notify data is lost.

Parameters
connectionThe connection from which the data was lost.
info

◆ OnRejoinRequest()

void OnRejoinRequest ( string sessionId)

Called when this peer was requested to re-join into another Session.

Parameters
sessionIdSession ID to re-join

◆ OnReliableData()

void OnReliableData ( NetConnection * connection,
ReadOnlySpan< byte > data )
Parameters
connection
data

◆ OnUnconnectedData()

void OnUnconnectedData ( NetBitBuffer * buffer)

Called when unconnected data is received.

Parameters
bufferThe buffer containing the data.

◆ OnUnreliableData()

void OnUnreliableData ( NetConnection * connection,
NetBitBuffer * buffer )

Called when unreliable data is received.

Parameters
connectionThe connection from which the data was received.
bufferThe buffer containing the data.