mirror of https://github.com/deavminet/skippy.git
Encode length
This commit is contained in:
parent
538607fa56
commit
819abf1faa
|
@ -178,7 +178,7 @@ void commandLine()
|
|||
}
|
||||
else
|
||||
{
|
||||
//client.sendMessage()
|
||||
dclient.sendMessage(false, currentChannel, commandLine);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue