From 67088afaa25323a162a834c1b7712348c6b5f800 Mon Sep 17 00:00:00 2001 From: "Tristan B. Kildaire" Date: Sat, 30 Jan 2021 12:56:41 +0200 Subject: [PATCH] Fixed out of range error --- source/dnetd/dconnection.d | 2 ++ source/dnetd/dlink.d | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/source/dnetd/dconnection.d b/source/dnetd/dconnection.d index 2fd8c44..09982e4 100644 --- a/source/dnetd/dconnection.d +++ b/source/dnetd/dconnection.d @@ -389,6 +389,8 @@ public class DConnection : Thread /* Set the type of this connection to `server` */ connType = ConnectionType.SERVER; hasAuthed = true; + + reply ~= [0]; // Testing for now } /* If `register` command (requires: unauthed, client) */ else if(command == Command.REGISTER && !hasAuthed && connType == ConnectionType.CLIENT) diff --git a/source/dnetd/dlink.d b/source/dnetd/dlink.d index 877ba47..026a6a0 100644 --- a/source/dnetd/dlink.d +++ b/source/dnetd/dlink.d @@ -168,7 +168,9 @@ public final class DLink : Thread /* TODO: Await an acknowledgement [status] */ byte[] receivedResponseBytes; - bReceiveMessage(outboundSocket, receivedResponseBytes); + bool recvStatus = bReceiveMessage(outboundSocket, receivedResponseBytes); + gprintln("Recev status: "~to!(string)(recvStatus), DebugType.WARNING); + DataMessage receivedResponse = DataMessage.decode(receivedResponseBytes); ubyte[] dataReply = cast(ubyte[])receivedResponse.getData();