Working `bformat` dub package added.
This commit is contained in:
parent
145444da29
commit
11ffb79f9a
2
dub.json
2
dub.json
|
@ -4,7 +4,7 @@
|
|||
],
|
||||
"copyright": "Copyright © 2020, Tristan B. Kildaire",
|
||||
"dependencies": {
|
||||
"bformat": "1.0.3"
|
||||
"bformat": "1.0.4"
|
||||
},
|
||||
"description": "D library for writing Bester-based applications.",
|
||||
"license": "GPLv3",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"fileVersion": 1,
|
||||
"versions": {
|
||||
"bformat": "1.0.3"
|
||||
"bformat": "1.0.4"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ import std.socket : Socket;
|
|||
import libester.execeptions;
|
||||
import std.string : cmp;
|
||||
import bmessage;
|
||||
import std.json : JSONValue;
|
||||
|
||||
public final class BesterClient
|
||||
{
|
||||
|
@ -32,7 +33,18 @@ public final class BesterClient
|
|||
|
||||
public void authenticate(string username, string password)
|
||||
{
|
||||
sendMessage_internal();
|
||||
/* Construct the authentication payload */
|
||||
JSONValue payload;
|
||||
JSONValue headerBlock;
|
||||
JSONValue authenticationBlock;
|
||||
authenticationBlock["username"] = username;
|
||||
authenticationBlock["password"] = password;
|
||||
headerBlock["authentication"] = authenticationBlock;
|
||||
payload["header"] = headerBlock;
|
||||
|
||||
/* Send the message to the server */
|
||||
/* TODO: Error handling */
|
||||
sendMessage(serverSocket, payload);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue