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 */
|
/* 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 */
|
/* 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 */
|
/* Add to the connection queue */
|
||||||
connectionQueue ~= connection;
|
connectionQueue ~= connection;
|
||||||
writeln("Added new connection to queue "~to!(string)(connection));
|
writeln("Added connection to queue "~to!(string)(connection));
|
||||||
|
|
||||||
/* Unlock the connections list */
|
/* Unlock the connections list */
|
||||||
connectionLock.unlock();
|
connectionLock.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TODO Remove connection */
|
/* 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)
|
public DChannel getChannelByName(string channelName)
|
||||||
|
Loading…
Reference in New Issue
Block a user