Construct tristanable pakcet.

This commit is contained in:
Tristan B. Kildaire 2020-06-22 22:36:43 +02:00
parent cbadba2f1e
commit 581b6bd5ee
1 changed files with 14 additions and 3 deletions

View File

@ -51,11 +51,22 @@ public final class Manager
public void sendMessage(ulong tag, byte[] data)
{
/* TODO: Implement me */
/* Construct the message array */
byte[] messageData;
/* Add the `tag` bytes */
messageData ~= *(cast(byte*)&tag);
messageData ~= *(cast(byte*)&tag+1);
messageData ~= *(cast(byte*)&tag+2);
messageData ~= *(cast(byte*)&tag+3);
messageData ~= *(cast(byte*)&tag+4);
messageData ~= *(cast(byte*)&tag+5);
messageData ~= *(cast(byte*)&tag+6);
messageData ~= *(cast(byte*)&tag+7);
/* Add the `data` bytes (the actual message) */
messageData ~= data;
/* Send the message */
bSendMessage(endpoint, messageData);