mirror of
https://github.com/deavminet/dnetd
synced 2024-09-21 09:43:37 +02:00
Fixed compilation error
This commit is contained in:
parent
c7fd5a6d30
commit
98700f3067
@ -154,7 +154,7 @@ public class DConnection : Thread
|
||||
}
|
||||
|
||||
/* Remove this user from the connection queue */
|
||||
/* TODO: Implement me */
|
||||
server.removeConnection(this);
|
||||
}
|
||||
|
||||
/* TODO: add mutex for writing with message and funciton for doing so */
|
||||
|
@ -142,16 +142,37 @@ public class DServer : Thread
|
||||
|
||||
/* Add to the connection queue */
|
||||
connectionQueue ~= connection;
|
||||
writeln("Added new connection to queue "~to!(string)(connection));
|
||||
writeln("Added connection to queue "~to!(string)(connection));
|
||||
|
||||
/* Unlock the connections list */
|
||||
connectionLock.unlock();
|
||||
}
|
||||
|
||||
/* TODO Remove connection */
|
||||
public void removeConnection(DConnection client)
|
||||
public void removeConnection(DConnection connection)
|
||||
{
|
||||
|
||||
/* Lock the connections list */
|
||||
connectionLock.lock();
|
||||
|
||||
/* The new connection queue */
|
||||
DConnection[] connectionQueueNew;
|
||||
|
||||
foreach(DConnection currentConnection; connectionQueue)
|
||||
{
|
||||
if(!(currentConnection is connection))
|
||||
{
|
||||
connectionQueueNew ~= currentConnection;
|
||||
}
|
||||
}
|
||||
|
||||
/* Set this as the new queue */
|
||||
connectionQueue = connectionQueueNew;
|
||||
|
||||
/* TODO: Implement removal */
|
||||
writeln("Remove connection from queue "~to!(string)(connection));
|
||||
|
||||
/* Unlock the connections list */
|
||||
connectionLock.unlock();
|
||||
}
|
||||
|
||||
public DChannel getChannelByName(string channelName)
|
||||
|
Loading…
Reference in New Issue
Block a user