diff --git a/source/dnetd/dconnection.d b/source/dnetd/dconnection.d index 7782db2..3edd4e4 100644 --- a/source/dnetd/dconnection.d +++ b/source/dnetd/dconnection.d @@ -180,6 +180,9 @@ public class DConnection : Thread /* Leave all channels this connetion was a member of */ cleanUp_channels(); + /* Delink this connection from this server */ + cleanUp_delinkServers(); + /* Remove this user from the connection queue */ server.removeConnection(this); @@ -214,6 +217,20 @@ public class DConnection : Thread gprintln(to!(string)(this)~" Leaving all channels... [done]"); } + /** + * Part of the clean up process - `cleanUp()` + * + * Will de-link Will leave all channels this connection is + * a member of + */ + private void cleanUp_delinkServers() + { + if(connType == ConnectionType.SERVER) + { + + } + } + /* TODO: add mutex for writing with message and funciton for doing so */ /** @@ -412,7 +429,7 @@ public class DConnection : Thread /* Add to the meyer system (this connectio) */ import dnetd.dlink : DLink; - DLink newLink = new DLink(server, serverNameIncoming, null, this); + DLink newLink = new DLink(server, serverNameIncoming, this); bool linkSuccessful = server.getMeyer().attachLink(serverNameIncoming, newLink); gprintln("Whether or not the link worked out (could be config error or possibly duplicate link): "~to!(string)(linkSuccessful)); diff --git a/source/dnetd/dlink.d b/source/dnetd/dlink.d index 325e77a..6c28445 100644 --- a/source/dnetd/dlink.d +++ b/source/dnetd/dlink.d @@ -211,20 +211,16 @@ public final class DLink : Thread override public string toString() { return name; - // return "Server: "~name~", Address: "~to!(string)(address); } /** * Constructs a DLink for an inbound peering */ - this(DServer server, string name, Address address, DConnection connection) + this(DServer server, string name, DConnection connection) { - /* Save the server, name and address */ - - /* Save the active connection */ - /* Save name and address */ - this(server, name, address); + /* Save the server and name */ + this(server, name, address=null); /* Save connection */ //this.connection = connection; @@ -269,7 +265,7 @@ public final class DMeyer : Thread linksMutex.lock(); gprintln("Linked servers: "~to!(string)(links), DebugType.WARNING); linksMutex.unlock(); - + Thread.sleep(dur!("seconds")(3)); } }