|
virtual void | OnJoinServerComplete (ErrorInfo *info, const ByteArray &replyFromServer)=0 |
|
virtual void | OnLeaveServer (ErrorInfo *errorInfo)=0 |
|
virtual void | OnP2PMemberJoin (HostID memberHostID, HostID groupHostID, int memberCount, const ByteArray &message)=0 |
|
virtual void | OnP2PMemberLeave (HostID memberHostID, HostID groupHostID, int memberCount)=0 |
|
virtual void | OnChangeP2PRelayState (HostID remoteHostID, ErrorType reason)=0 |
|
virtual void | OnServerOffline (CRemoteOfflineEventArgs &) |
|
virtual void | OnServerOnline (CRemoteOnlineEventArgs &) |
|
virtual void | OnP2PMemberOffline (CRemoteOfflineEventArgs &) |
|
virtual void | OnP2PMemberOnline (CRemoteOnlineEventArgs &) |
|
virtual void | OnChangeServerUdpState (ErrorType) |
|
virtual void | OnSynchronizeServerTime ()=0 |
|
virtual void | OnError (ErrorInfo *errorInfo)=0 |
|
virtual void | OnWarning (ErrorInfo *errorInfo)=0 |
|
virtual void | OnInformation (ErrorInfo *errorInfo)=0 |
|
virtual void | OnException (const Exception &e)=0 |
|
virtual void | OnNoRmiProcessed (RmiID rmiID)=0 |
|
virtual PROUD_API void | OnReceiveUserMessage (HostID sender, const RmiContext &rmiContext, uint8_t *payload, int payloadLength) |
|
virtual void | OnTick (void *) |
|
virtual void | OnUserWorkerThreadCallbackBegin (CUserWorkerThreadCallbackContext *) |
|
virtual void | OnUserWorkerThreadCallbackEnd (CUserWorkerThreadCallbackContext *) |
|
Event sink for CNetClient
Usage
- Realize this object.
- Passed as a parameter to CNetClient
virtual void Proud::INetClientEvent::OnChangeP2PRelayState |
( |
HostID |
remoteHostID, |
|
|
ErrorType |
reason |
|
) |
| |
|
pure virtual |
This method is called at the moment the connection status to other client via P2P (relay or not) changes. Since it is called after the change so it is ok to call CNetClient.GetPeerInfo to view the value of CNetPeerInfo.Proud.CNetPeerInfo.m_RelayedP2P. P2P performance of ProudNet
- Parameters
-
remoteHostID | HostID of other peer that is connected via P2P |
reason | If the P2P connection is successful then contains ErrorType_Ok. For other values it contain 'why the connection changed to relay'. |
virtual void Proud::INetClientEvent::OnChangeServerUdpState |
( |
ErrorType |
| ) |
|
|
inlinevirtual |
This method is called at the moment that the communication status of UDP communication with server change.
- Parameters
-
reason | If ErrorType_Ok then UDP communication with server is normal and unreliable RMI messaging goes to server via UDP. Having other values means UDP communication witer server is unavailable and during this state, unreliable RMI messaging goes to server via TCP. |
virtual void Proud::INetClientEvent::OnJoinServerComplete |
( |
ErrorInfo * |
info, |
|
|
const ByteArray & |
replyFromServer |
|
) |
| |
|
pure virtual |
Event that occurs after arrival of the result of attempt to connect to server through CNetServer.Connect
- Parameters
-
info | object that contains the result of connection to server. ErrorInfo.m_type has success value when it is successful. View this value when connection attempt to server failed. Please refer ErrorInfo class description. |
replyFromServer | Additional message from server. This value is from INetServerEvent.OnConnectionRequest. |
virtual void Proud::INetClientEvent::OnLeaveServer |
( |
ErrorInfo * |
errorInfo | ) |
|
|
pure virtual |
Event that occurs when server connection is terminated
- This event also occurs when client terminates the connection to server. However, it will be called back if the thread where NetClient.FrameMove is called and NetClient.Disconnect is called are same.
- Parameters
-
errorInfo | Contains the reason why the connection was terminated. Please refer ErrorInfo. |
virtual void Proud::INetClientEvent::OnP2PMemberJoin |
( |
HostID |
memberHostID, |
|
|
HostID |
groupHostID, |
|
|
int |
memberCount, |
|
|
const ByteArray & |
message |
|
) |
| |
|
pure virtual |
This method is to be called back either when P2P Group is created or when a new member is added to P2P group. Also called for local host iteself.
For an example, if B enters into group G which already has client A in it, then A receives (B,G) and B recieves (A,G) and (B,G).
- Parameters
-
memberHostID | HostID of itself or other peer |
groupHostID | HostID of P2P group |
memberCount | The number of menebers after being processed |
message | The custom data entered by user via either CNetServer.CreateP2PGroup or CNetServer.JoinP2PGroup will be passed onto here as they are. |
virtual void Proud::INetClientEvent::OnP2PMemberLeave |
( |
HostID |
memberHostID, |
|
|
HostID |
groupHostID, |
|
|
int |
memberCount |
|
) |
| |
|
pure virtual |
This method is to be called back either when P2P Group is created or when a peer withdraws. Also called for local host iteself.
- Parameters
-
memberHostID | HostID of itself or other peer |
groupHostID | HostID of P2P group |
memberCount | The number of members after processed |
When other peers within the P2P group where it belongs to lost connection to the server, a callback occurs. (The particular function shall have NetConnectionParam.m_enableAutoConnectionRecovery of NetClient as “True”)
- Parameters
-
args | It has information on the peers that have lost connection. |
When other peers within the P2P group where it belongs to lost connection to the server and then gains reconnection, a callback occurs. (The particular function shall have NetConnectionParam.m_enableAutoConnectionRecovery of NetClient as “True”)
- Parameters
-
args | It contains information of the peer reconnected. |
When connection to the server is lost, a callback is called. After the callback is called for a particular event, if reconnection to the server is not established, a callback occurs for OnLeaveServer. (The particular function shall have NetConnectionParam.m_enableAutoConnectionRecovery of NetClient as “True”)
- Parameters
-
args | When connection is lost, it has a variety of information. |
After connection to the server is lost and then established again, a callback occurs. (The particular function shall have NetConnectionParam.m_enableAutoConnectionRecovery of NetClient as “True”)
- Parameters
-
args | It has information on reconnection. |
virtual void Proud::INetClientEvent::OnSynchronizeServerTime |
( |
| ) |
|
|
pure virtual |
Called every time when time is synchronized with server Server time sybchronization becomes more accurate with as frequency of calling this method increases. It is also possible to call GetServerTimeMs() within this metod.