mirror of
https://github.com/deavminet/dnetd.git
synced 2025-02-17 21:17:46 +00:00
Direct messages implemented
This commit is contained in:
parent
ff1aba9dc1
commit
7424875676
@ -484,11 +484,28 @@ public class DConnection : Thread
|
|||||||
/* Find the user to send to */
|
/* Find the user to send to */
|
||||||
DConnection user = server.findUser(username);
|
DConnection user = server.findUser(username);
|
||||||
|
|
||||||
|
writeln("sendUserMessage(): ", user);
|
||||||
|
|
||||||
/* If the user was found */
|
/* If the user was found */
|
||||||
if(user)
|
if(user)
|
||||||
{
|
{
|
||||||
|
/* The protocol data to send */
|
||||||
|
byte[] protocolData;
|
||||||
|
|
||||||
|
/* Set the sub-type (ntype=0) */
|
||||||
|
protocolData ~= [0];
|
||||||
|
|
||||||
|
/* Encode the sender's length */
|
||||||
|
protocolData ~= [cast(byte)username.length];
|
||||||
|
|
||||||
|
/* Encode the username */
|
||||||
|
protocolData ~= cast(byte[])username;
|
||||||
|
|
||||||
|
/* Encode the message */
|
||||||
|
protocolData ~= cast(byte[])message;
|
||||||
|
|
||||||
/* Send the messge */
|
/* Send the messge */
|
||||||
/* TODO: Implement me */
|
user.writeSocket(0, protocolData);
|
||||||
|
|
||||||
|
|
||||||
/* TODO: Return value should be based off message send success */
|
/* TODO: Return value should be based off message send success */
|
||||||
|
Loading…
Reference in New Issue
Block a user