From f20a02635e10f30457496efc0259b16bc4af41e1 Mon Sep 17 00:00:00 2001 From: "Tristan B. Kildaire" Date: Tue, 20 Oct 2020 08:17:48 +0200 Subject: [PATCH] Added neew properties system. --- source/dnetd/dconnection.d | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/source/dnetd/dconnection.d b/source/dnetd/dconnection.d index cd18b99..4d3d558 100644 --- a/source/dnetd/dconnection.d +++ b/source/dnetd/dconnection.d @@ -60,6 +60,7 @@ public class DConnection : Thread private ConnectionType connType; private string username; private string currentStatus; + private string[string] properties; /* TODO: New, replace old status mechanism */ /* Write lock for socket */ /* TODO: Forgot how bmessage works, might need, might not, if multipel calls @@ -795,6 +796,23 @@ public class DConnection : Thread return statusMessage; } + /** + * Sets a property for this user + */ + public void setProperty(string propertyName, string propertyValue) + { + properties[propertyName] = propertyValue; + } + + /** + * Returns a property + */ + public string getProperty(string propertyName) + { + /* TODO: Error handling */ + return ""; + } + public ConnectionType getConnectionType() { return connType;