mirror of
https://github.com/thebutterflyprotocol/libutterfly
synced 2024-09-21 01:32:49 +02:00
Fully implemeted authetication
This commit is contained in:
parent
ddc799d93a
commit
903ae57c97
@ -37,5 +37,21 @@ public final class ButterflyClient
|
|||||||
|
|
||||||
/* Send the command */
|
/* Send the command */
|
||||||
sendMessage(connection, cast(byte[])toJSON(commandBlock));
|
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 */
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user