mirror of
https://github.com/deavminet/dnetd
synced 2024-09-21 09:43:37 +02:00
COmpute list of active servers to be linked to
This commit is contained in:
parent
4face9ae5d
commit
4e4605ff4c
@ -131,12 +131,20 @@ public final class DGeneralConfig
|
||||
|
||||
public final class DLinkConfig
|
||||
{
|
||||
public static DLinkConfig getConfig(JSONValue linksBlocks)
|
||||
public static DLinkConfig getConfig(JSONValue linksBlock)
|
||||
{
|
||||
DLinkConfig dlinkConfig;
|
||||
|
||||
/* Get the active servers */
|
||||
string[] activeServers;
|
||||
JSONValue[] serversActive = linksBlock["active"].array();
|
||||
foreach(JSONValue activeServer; serversActive)
|
||||
{
|
||||
string server = activeServer.str();
|
||||
gprintln("Found active server to be linked with \""~server~"\"");
|
||||
activeServers ~= server;
|
||||
}
|
||||
|
||||
|
||||
|
||||
return dlinkConfig;
|
||||
}
|
||||
|
@ -46,6 +46,14 @@ public final class DMeyer
|
||||
this(DServer server, DLinkConfig linkConfig)
|
||||
{
|
||||
this.server = server;
|
||||
|
||||
/* Initialize the locks */
|
||||
initLocks();
|
||||
}
|
||||
|
||||
/* Initialize locks */
|
||||
private void initLocks()
|
||||
{
|
||||
linksMutex = new Mutex();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user