Fully implemeted authetication

This commit is contained in:
Tristan B. Kildaire 2020-06-18 17:33:04 +02:00
parent ddc799d93a
commit 903ae57c97

View File

@ -37,5 +37,21 @@ public final class ButterflyClient
/* Send the command */
sendMessage(connection, cast(byte[])toJSON(commandBlock));
/* Get the status */
JSONValue response;
byte[] receivedBytes;
receiveMessage(connection, receivedBytes);
response = parseJSON(cast(string)receivedBytes);
if(response["status"].integer() == 0)
{
/* TODO: Good */
}
else
{
/* TODO: Throw an exception here */
}
}
}