From e2b0ec084607f12ec264914d52a25e96668acd3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tristan=20=F0=9F=85=B1=2E=20Kildaire?= <21629986@sun.ac.za> Date: Wed, 23 Sep 2020 21:40:22 +0200 Subject: [PATCH] Fixed toString --- source/dnetd/dchannel.d | 12 +++++++++++- source/dnetd/dconnection.d | 7 +++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/source/dnetd/dchannel.d b/source/dnetd/dchannel.d index 0252ce6..a20bd29 100644 --- a/source/dnetd/dchannel.d +++ b/source/dnetd/dchannel.d @@ -61,7 +61,17 @@ public class DChannel public override string toString() { - return "DChannel [Name: "~name~", Members: "~to!(string)(members)~"]"; + string toStr; + + /* Lock the members list */ + memberLock.lock(); + + toStr = "DChannel [Name: "~name~", Members: "~to!(string)(members)~"]"; + + /* Unlock the members list */ + memberLock.unlock(); + + return toStr; } } \ No newline at end of file diff --git a/source/dnetd/dconnection.d b/source/dnetd/dconnection.d index b93dcdf..fcafe7a 100644 --- a/source/dnetd/dconnection.d +++ b/source/dnetd/dconnection.d @@ -199,6 +199,13 @@ public class DConnection : Thread /* Join the channel */ channel.join(this); } + + /* TODO: Do reply */ + /* Encode the reply */ + byte[] reply = [true]; + + /* TODO: Implement me, use return value */ + writeSocket(tag, reply); } /* TODO: Handle this case */ else