Diarkis C# Client SDK
Public Member Functions | Protected Member Functions | Static Protected Attributes | Events | List of all members
Diarkis.Modules.DirectMessage Class Reference

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

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

Public Member Functions

delegate void MessageHandler (string senderUID, byte[] message)
 Raised when a message is received. More...
 
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 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...
 
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...
 
virtual 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...
 

Protected Member Functions

void DispatchEvent_ (byte[] payload, MessageHandler callback)
 

Static Protected Attributes

const uint VER = 1
 
const uint DISCONN_CMD = 700
 
const uint SEND_CMD = 701
 
const uint CONN_CMD = 702
 

Events

virtual MessageHandler OnMessage
 
virtual MessageHandler OnDisconnect
 
virtual MessageHandler OnConnect
 

Detailed Description

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

Member Function Documentation

◆ Disconnect()

virtual void Diarkis.Modules.DirectMessage.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 in Diarkis.Modules.WsDirectMessage.

◆ MessageHandler()

delegate void Diarkis.Modules.DirectMessage.MessageHandler ( string  senderUID,
byte[]  message 
)

Raised when a message is received.

Parameters
senderUIDUser ID of the message sender.
messageMessage byte array.

◆ RSend()

virtual void Diarkis.Modules.DirectMessage.RSend ( 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 an RUDP message.

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

◆ Send()

virtual void Diarkis.Modules.DirectMessage.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 in Diarkis.Modules.WsDirectMessage.

◆ SetupAsTcp()

bool Diarkis.Modules.DirectMessage.SetupAsTcp ( Tcp  tcp)
inline

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

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

◆ SetupAsUdp()

bool Diarkis.Modules.DirectMessage.SetupAsUdp ( Udp  udp)
inline

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

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

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