mirror of https://github.com/deavminet/dnetd.git
COmpute list of active servers to be linked to
This commit is contained in:
parent
4face9ae5d
commit
4e4605ff4c
|
@ -131,11 +131,19 @@ public final class DGeneralConfig
|
||||||
|
|
||||||
public final class DLinkConfig
|
public final class DLinkConfig
|
||||||
{
|
{
|
||||||
public static DLinkConfig getConfig(JSONValue linksBlocks)
|
public static DLinkConfig getConfig(JSONValue linksBlock)
|
||||||
{
|
{
|
||||||
DLinkConfig dlinkConfig;
|
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;
|
return dlinkConfig;
|
||||||
|
|
|
@ -46,6 +46,14 @@ public final class DMeyer
|
||||||
this(DServer server, DLinkConfig linkConfig)
|
this(DServer server, DLinkConfig linkConfig)
|
||||||
{
|
{
|
||||||
this.server = server;
|
this.server = server;
|
||||||
|
|
||||||
|
/* Initialize the locks */
|
||||||
|
initLocks();
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Initialize locks */
|
||||||
|
private void initLocks()
|
||||||
|
{
|
||||||
linksMutex = new Mutex();
|
linksMutex = new Mutex();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue