Fixed out of range error

This commit is contained in:
Tristan B. Kildaire 2021-01-30 12:56:41 +02:00
parent 068636cde7
commit 67088afaa2
2 changed files with 5 additions and 1 deletions

View File

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

View File

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