diff --git a/source/app.d b/source/app.d index 8889706..c1233bf 100644 --- a/source/app.d +++ b/source/app.d @@ -178,7 +178,7 @@ void commandLine() } else { - //client.sendMessage() + dclient.sendMessage(false, currentChannel, commandLine); } } diff --git a/source/client.d b/source/client.d index 1431a5b..3e13a3d 100644 --- a/source/client.d +++ b/source/client.d @@ -102,7 +102,7 @@ public class DClient public bool sendMessage(bool isUser, string location, string message) { /* The protocol data to send */ - byte[] protocolData; + byte[] protocolData = [5]; /** * If we are sending to a user then the @@ -113,6 +113,12 @@ public class DClient */ protocolData ~= [!isUser]; + /* Encode the length of `location` */ + protocolData ~= [cast(byte)location.length]; + + /* Encode the user/channel name */ + protocolData ~= cast(byte[])location; + /* Encode the message */ protocolData ~= cast(byte[])message;