From 95d2c2adc9a5706e7ac3b47d4488ae5bd8181854 Mon Sep 17 00:00:00 2001 From: "Tristan B. Kildaire" Date: Tue, 20 Oct 2020 07:57:27 +0200 Subject: [PATCH] Added getStatus message --- source/dnetd/dserver.d | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/source/dnetd/dserver.d b/source/dnetd/dserver.d index 935da5a..dcb630b 100644 --- a/source/dnetd/dserver.d +++ b/source/dnetd/dserver.d @@ -337,6 +337,31 @@ public class DServer : Thread return currentChannels; } + public string getStatusMessage(string username) + { + /* Lock the connections list */ + connectionLock.lock(); + + /* The matching connection */ + DConnection matchedConnection; + + /* Find the connection */ + foreach(DConnection connection; connectionQueue) + { + if(cmp(connection.getUsername(), username) == 0) + { + matchedConnection = connection; + break; + } + } + + + /* Unlock the connections list */ + connectionLock.unlock(); + + return matchedConnection.getStatusMessage(username); + } + public string getServerInfo() { /* The server information */