Working `bformat` dub package added.

This commit is contained in:
Tristan B. Kildaire 2020-05-02 19:59:57 +02:00
parent 145444da29
commit 11ffb79f9a
3 changed files with 15 additions and 3 deletions

View File

@ -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",

View File

@ -1,6 +1,6 @@
{
"fileVersion": 1,
"versions": {
"bformat": "1.0.3"
"bformat": "1.0.4"
}
}

View File

@ -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);
}