Diarkis C# Client SDK
Public Member Functions | Events | List of all members
Diarkis.Modules.WsField Class Reference
Inheritance diagram for Diarkis.Modules.WsField:
Diarkis.Modules.Field

Public Member Functions

bool Setup (Ws ws)
 Sets up the instance of as a WebSocket client. More...
 
override void Disappear ()
 Notifies other clients in view that the client is now disappeared. Triggers Field.OnDisappear. More...
 
override void SyncInit (long x, long y, long z, uint syncLimit, uint customFilterID, byte[] msg)
 Initial sync to the other clients in view. More...
 
override void Sync (long x, long y, long z, uint syncLimit, uint customFilterID, byte[] msg, bool notUsed=true)
 Sync the client's position More...
 
- Public Member Functions inherited from Diarkis.Modules.Field
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...
 
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

override ResponseHandler OnResponseSyncInit
 The event raised as a server response of SyncInit. More...
 
override SyncHandler OnSync
 The event is raised when a remote client that is in the field of view sends a message via Sync. More...
 
override 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...
 
override 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...
 
override 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...
 
- Events inherited from Diarkis.Modules.Field
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...
 

Additional Inherited Members

- Static Public Attributes inherited from Diarkis.Modules.Field
const uint STATUS_OK = 1
 
const uint BUILTIN_CMD_VER = 1
 
const uint SYNC_INIT_CMD = 120
 
const uint SYNC_CMD = 121
 
const uint DISAPPEAR_CMD = 123
 
const uint SERVER_SYNC_CMD = 124
 

Member Function Documentation

◆ Disappear()

override void Diarkis.Modules.WsField.Disappear ( )
inlinevirtual

Notifies other clients in view that the client is now disappeared. Triggers Field.OnDisappear.

Reimplemented from Diarkis.Modules.Field.

◆ Setup()

bool Diarkis.Modules.WsField.Setup ( Ws  ws)
inline

Sets up the instance of as a WebSocket client.

Parameters
wsAn instance of Ws

◆ Sync()

override void Diarkis.Modules.WsField.Sync ( long  x,
long  y,
long  z,
uint  syncLimit,
uint  customFilterID,
byte[]  msg,
bool  notUsed = true 
)
inlinevirtual

Sync the client's position

Parameters
xX position of the client.
yY position of the client.
zZ is considered as an "area". For example: different floors of a building etc.
syncLimitMaximum number of other clients in view to sync with.
customFilerIDIndicagtes the usage of custom defined (on the server) filter function when synching. Give 0 to use no filter functions.
msgMessage to be sent to the clients in view.

Reimplemented from Diarkis.Modules.Field.

◆ SyncInit()

override void Diarkis.Modules.WsField.SyncInit ( long  x,
long  y,
long  z,
uint  syncLimit,
uint  customFilterID,
byte[]  msg 
)
inlinevirtual

Initial sync to the other clients in view.

Parameters
xX position of the client.
yY position of the client.
zZ is considered as an "area". For example: different floors of a building etc.
syncLimitMaximum number of other clients in view to sync with.
customFilerIDIndicates the usage of custom defined (on the server) filter function when synching. Give 0 to use no filter functions.
msgMessage to be sent to the clients in view.

Reimplemented from Diarkis.Modules.Field.

Event Documentation

◆ OnDisappear

override DisappearHandler Diarkis.Modules.WsField.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.

Parameters
uidUser ID of the remote client that is no longer visible.

◆ OnReconnect

override ReconnectHandler Diarkis.Modules.WsField.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.

◆ OnResponseSyncInit

override ResponseHandler Diarkis.Modules.WsField.OnResponseSyncInit

The event raised as a server response of SyncInit.

Parameters
remoteMsgListA list of message byte arrays of remote clients that are in the field of view.

◆ OnServerSync

override ServerSyncHandler Diarkis.Modules.WsField.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.

Parameters
inSightIf true, the custom entity or data received is within the field of vision.
payloadCustom entity or data sent from the server to synchronize.

◆ OnSync

override SyncHandler Diarkis.Modules.WsField.OnSync

The event is raised when a remote client that is in the field of view sends a message via Sync.

Parameters
payloadA message byte array from the remote client that is in the field of view.

The documentation for this class was generated from the following file: