ChannelManager
- Added some testing channels Server - We now construct a `ChannelManager` on construction - `getChannelNames(ulong, ubyte)` now uses the `ChannelManager` to enumerate the channels
This commit is contained in:
parent
938ca897bd
commit
e9fddfc55c
|
@ -110,6 +110,11 @@ public final class ChannelManager
|
|||
private this()
|
||||
{
|
||||
this.channelsLock = new Mutex();
|
||||
|
||||
// TODO: Disable later, this just adds some testing channels
|
||||
// return ["#general", "#tomfoolery"];
|
||||
channelCreate("#general");
|
||||
channelCreate("#tomfoolery");
|
||||
}
|
||||
|
||||
public static ChannelManager create(Server server)
|
||||
|
|
|
@ -7,6 +7,7 @@ import std.algorithm : canFind;
|
|||
import renaissance.exceptions;
|
||||
import renaissance.connection;
|
||||
import renaissance.logging;
|
||||
import renaissance.server.channelmanager;
|
||||
|
||||
/**
|
||||
* Represents an instance of the daemon which manages
|
||||
|
@ -26,12 +27,22 @@ public class Server
|
|||
// TODO: volatility
|
||||
private bool isRunning = false;
|
||||
|
||||
// TODO: Add constructor
|
||||
private ChannelManager channelManager;
|
||||
|
||||
// TODO: Some sendq/recq mechanism with messages or something
|
||||
// ... should be placed here
|
||||
|
||||
/**
|
||||
* Constructs a new server
|
||||
*/
|
||||
this()
|
||||
{
|
||||
/* Initialize all mutexes */
|
||||
this.listenerQLock = new Mutex();
|
||||
this.connectionQLock = new Mutex();
|
||||
|
||||
/* Initialize the channel management sub-system */
|
||||
this.channelManager = ChannelManager.create(this);
|
||||
}
|
||||
|
||||
|
||||
|
@ -187,8 +198,7 @@ public class Server
|
|||
public string[] getChannelNames(ulong offset, ubyte limit)
|
||||
{
|
||||
// TODO: Implement me
|
||||
|
||||
return ["#general", "#tomfoolery"];
|
||||
return this.channelManager.getChannelNames(offset, limit);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue