Added rehash() method

This commit is contained in:
Tristan B. Velloza Kildaire 2021-12-25 13:08:22 +02:00
parent 203762c454
commit 1d2fc01b24
2 changed files with 15 additions and 2 deletions

View File

@ -216,6 +216,7 @@ struct NetworkInformation
{
string serverName;
string motd;
ushort sid;
string networkName;

View File

@ -9,14 +9,14 @@
module dnetd.server;
import dnetd.app : logger;
import dnetd.config : Configuration;
import dnetd.config : ConfigurationError;
/**
* Represents an instance of a dnet server
*/
public final class Server
{
/* Server Conifguration */
/* Server Configuration */
private Configuration config;
this(Configuration config)
@ -26,4 +26,16 @@ public final class Server
}
/* Rehash server configuration */
public void rehash()
{
try
{
config = Configuration.readConfig(config.configPath);
}
catch(ConfigurationError e)
{
/* TODO: Handle the error here by sending a server message */
logger.log("Error whilst rehashing the configuration");
}
}
}