From cf234156c53af86c828f83df21ab115e1013f3ed Mon Sep 17 00:00:00 2001 From: "Tristan B. Kildaire" Date: Tue, 20 Oct 2020 11:22:14 +0200 Subject: [PATCH] Implemented `setProperty` --- source/libdnet/dclient.d | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/source/libdnet/dclient.d b/source/libdnet/dclient.d index 4858b52..dc14109 100644 --- a/source/libdnet/dclient.d +++ b/source/libdnet/dclient.d @@ -280,6 +280,32 @@ public final class DClient return status; } + /** + * Set's the given property of yourself to the given value + */ + public void setProperty(string property, string propertyValue) + { + /* The property's value */ + bool status; + + /* The protocol data to send */ + byte[] data = [17]; + data ~= property~","~propertyValue; + + /* Send the protocol data */ + DataMessage protocolData = new DataMessage(reqRepQueue.getTag(), data); + bSendMessage(socket, protocolData.encode()); + + /* Receive the server's response */ + byte[] resp = reqRepQueue.dequeue().getData(); + + /* If it worked */ + if(cast(bool)resp[0]) + { + + } + } + /** * Lists all the channels on the server