![]() |
Diarkis C# Client SDK
|
Public Member Functions | |
delegate void | ResponseHandler (List< byte[]> remoteMsgList) |
delegate void | SyncHandler (byte[] payload) |
delegate void | DisappearHandler (string uid) |
delegate void | ReconnectHandler (bool success) |
delegate void | ServerSyncHandler (bool inSight, byte[] payload) |
bool | SetupAsTcp (Tcp tcp) |
Sets up the instance of as a TCP client. More... | |
bool | SetupAsUdp (Udp udp) |
Sets up the instance of as a UDP client. More... | |
virtual void | Disappear () |
Notifies other clients in view that the client is now disappeared. Triggers Field.OnDisappear. More... | |
virtual void | SyncInit (long x, long y, long z, uint syncLimit, uint customFilterID, byte[] msg) |
Initial sync to the other clients in view. This also raises OnSyncInit event to receive remote client messages that are within the field of view. More... | |
virtual void | Sync (long x, long y, long z, uint syncLimit, uint customFilterID, byte[] msg, bool reliable=true) |
Sync the client's position This raises OnSync event on the remote clients that are within the field of view. More... | |
void | OnCustomBroadcast (uint ver, uint cmd, Action< byte[]> callback) |
Registers a callback on custom broadcast by ver and cmd. Must be callback AFTER field.SetupAsUdp or field.SetupAsTcp More... | |
Events | |
virtual ResponseHandler | OnResponseSyncInit |
The event raised as a server response of SyncInit. More... | |
virtual SyncHandler | OnSync |
The event is raised when a remote client that is in the field of view sends a message via Sync. More... | |
virtual DisappearHandler | OnDisappear |
The event is raised when a remote client that is in the field of view is no longer visible. The event is raised when a remote client invokes Disappear also. More... | |
virtual ReconnectHandler | OnReconnect |
The event is raised when the client auto-reconnect due to server autoscaling. In order to maintain the synchronization of the client, invok Sync() when the event is raised. More... | |
virtual ServerSyncHandler | OnServerSync |
This event is raised by server only. When the server sends field.ServerSync, it triggers OnServerSync event to be raised. This event is meant to synchoronize custom entity or data (such as NPC etc.) that is encapsulated in the payload byte array. More... | |
Field allows you to "see" other clients in view and exchange packets with them freely.
|
inlinevirtual |
Notifies other clients in view that the client is now disappeared. Triggers Field.OnDisappear.
Reimplemented in Diarkis.Modules.WsField.
|
inline |
Registers a callback on custom broadcast by ver and cmd. Must be callback AFTER field.SetupAsUdp or field.SetupAsTcp
ver | Custom command version to listen to. |
cmd | Custom command ID to listen to. |
callback | Callback method to be invoked on targeted ver and cmd. |
|
inline |
Sets up the instance of as a TCP client.
tcp | An instance of Tcp |
|
inline |
Sets up the instance of as a UDP client.
udp | An instance of Udp |
|
inlinevirtual |
Sync the client's position This raises OnSync event on the remote clients that are within the field of view.
x | X position of the client. |
y | Y position of the client. |
z | Z is considered as an "area". For example: different floors of a building etc. |
syncLimit | Maximum number of other clients in view to sync with. |
customFilerID | Indicagtes the usage of custom defined (on the server) filter function when synching. Give 0 to use no filter functions. |
msg | Message to be sent to the clients in view. |
Reimplemented in Diarkis.Modules.WsField.
|
inlinevirtual |
Initial sync to the other clients in view. This also raises OnSyncInit event to receive remote client messages that are within the field of view.
x | X position of the client. |
y | Y position of the client. |
z | Z is considered as an "area". For example: different floors of a building etc. |
syncLimit | Maximum number of other clients in view to sync with. |
customFilerID | Indicates the usage of custom defined (on the server) filter function when synching. Give 0 to use no filter functions. |
msg | Message to be sent to the clients in view. |
Reimplemented in Diarkis.Modules.WsField.
virtual DisappearHandler Diarkis.Modules.Field.OnDisappear |
The event is raised when a remote client that is in the field of view is no longer visible. The event is raised when a remote client invokes Disappear also.
uid | User ID of the remote client that is no longer visible. |
virtual ReconnectHandler Diarkis.Modules.Field.OnReconnect |
The event is raised when the client auto-reconnect due to server autoscaling. In order to maintain the synchronization of the client, invok Sync() when the event is raised.
virtual ResponseHandler Diarkis.Modules.Field.OnResponseSyncInit |
The event raised as a server response of SyncInit.
remoteMsgList | A list of message byte arrays of remote clients that are in the field of view. |
virtual ServerSyncHandler Diarkis.Modules.Field.OnServerSync |
This event is raised by server only. When the server sends field.ServerSync, it triggers OnServerSync event to be raised. This event is meant to synchoronize custom entity or data (such as NPC etc.) that is encapsulated in the payload byte array.
inSight | If true, the custom entity or data received is within the field of vision. |
payload | Custom entity or data sent from the server to synchronize. |
virtual SyncHandler Diarkis.Modules.Field.OnSync |
The event is raised when a remote client that is in the field of view sends a message via Sync.
payload | A message byte array from the remote client that is in the field of view. |