Diarkis C# Client SDK
Public Member Functions | Events | List of all members
Diarkis.Modules.WsDirectMessage Class Reference

Directly sends and receives messages from another user by passing thier user ID only. More...

Inheritance diagram for Diarkis.Modules.WsDirectMessage:
Diarkis.Modules.DirectMessage

Public Member Functions

bool Setup (Ws ws)
 DirectMessage class does not have network transport. Set up WsDirectMessage class instance with Diarkis WebSocket class instance. More...
 
override void Send (string uid, byte[] message)
 Sends a direct message to the remote user. The first message must "find" the remote client and it may take some time (possibly seconds). If DirectMessage is set up with Diarkis Udp class, the message will be sent as a plain UDP message. More...
 
override void Disconnect (string uid, byte[] message)
 Disconnects the direct message channel with the remote client and sends a custom disconnect message. If Diarkis Udp class is used, the disconnect message is sent as an RUDP message. More...
 
- Public Member Functions inherited from Diarkis.Modules.DirectMessage
delegate void MessageHandler (string senderUID, byte[] message)
 Raised when a message is received. More...
 
delegate void ResponseHandler (bool success, byte[] message)
 
bool SetupAsUdp (Udp udp)
 DirectMessage class does not have network transport. Set up DirectMessage class instance with Diarkis Udp class instance. More...
 
bool SetupAsTcp (Tcp tcp)
 DirectMessage class does not have network transport. Set up DirectMessage class instance with Diarkis Tcp class instance. More...
 
virtual void RSend (string uid, byte[] message)
 Sends a direct message to the remote user. The first message must "find" the remote client and it may take some time (possibly seconds). If DirectMessage is set up with Diarkis Udp class, the message will be sent as an RUDP message. More...
 

Events

override MessageHandler OnMessage
 
override MessageHandler OnDisconnect
 
override MessageHandler OnConnect
 
- Events inherited from Diarkis.Modules.DirectMessage
virtual MessageHandler OnMessage
 
virtual MessageHandler OnDisconnect
 
virtual MessageHandler OnConnect
 
virtual ResponseHandler OnMessageResponse
 
virtual ResponseHandler OnDisconnectResponse
 

Additional Inherited Members

- Protected Member Functions inherited from Diarkis.Modules.DirectMessage
void DispatchEvent_ (byte[] payload, MessageHandler callback)
 
- Static Protected Attributes inherited from Diarkis.Modules.DirectMessage
const uint STATUS_OK = 1
 
const uint VER = 1
 
const uint DISCONN_CMD = 700
 
const uint SEND_CMD = 701
 
const uint CONN_CMD = 702
 

Detailed Description

Directly sends and receives messages from another user by passing thier user ID only.

Member Function Documentation

◆ Disconnect()

override void Diarkis.Modules.WsDirectMessage.Disconnect ( string  uid,
byte[]  message 
)
inlinevirtual

Disconnects the direct message channel with the remote client and sends a custom disconnect message. If Diarkis Udp class is used, the disconnect message is sent as an RUDP message.

Parameters
uidUser ID of the remote client to disconnect from.
messageDisconnect message to be delivered to the remote client.

Reimplemented from Diarkis.Modules.DirectMessage.

◆ Send()

override void Diarkis.Modules.WsDirectMessage.Send ( string  uid,
byte[]  message 
)
inlinevirtual

Sends a direct message to the remote user. The first message must "find" the remote client and it may take some time (possibly seconds). If DirectMessage is set up with Diarkis Udp class, the message will be sent as a plain UDP message.

Parameters
uidUser ID of the remote client to deliver the direct message to.
messageMessage byte array to be delivered.

Reimplemented from Diarkis.Modules.DirectMessage.

◆ Setup()

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

DirectMessage class does not have network transport. Set up WsDirectMessage class instance with Diarkis WebSocket class instance.

Parameters
tcpDiarkis Udp class instance to be used as internal network transport for DirectMessage.

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