COmpute list of active servers to be linked to

This commit is contained in:
Tristan B. Kildaire 2021-01-29 11:08:24 +02:00
parent 4face9ae5d
commit 4e4605ff4c
2 changed files with 18 additions and 2 deletions

View File

@ -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;
}

View File

@ -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();
}