diff --git a/source/app.d b/source/app.d index 7b59774..99c1cd9 100644 --- a/source/app.d +++ b/source/app.d @@ -51,26 +51,19 @@ void main(string[] args) return; } - /* The JSON */ - JSONValue json; + try { + /* The JSON */ + JSONValue json; + /* Parse the configuration file */ json = parseJSON(cast(string)data); - } - catch(JSONException e) - { - gprintln("Failure to parse configuration file'"~configFilename~"' with error:\n\n"~e.toString(), DebugType.ERROR); - return; - } - /* Create a new configuration file and check configuration parameters */ - DGeneralConfig config = DGeneralConfig.getConfig(json["general"]); + /* Create a new configuration file and check configuration parameters */ + DGeneralConfig config = DGeneralConfig.getConfig(json["general"]); - /* If the configuration reading was successful (valid JSON) */ - if(config) - { /* Create a new server */ DServer dserver = new DServer(config); @@ -90,12 +83,11 @@ void main(string[] args) /* Start the server (TODO: This should start Meyer) */ dserver.startServer(); - } - else - { - gprintln("Failure to read a valid dnetd configuration file'"~configFilename~"'", DebugType.ERROR); - } - - + } + catch(JSONException e) + { + gprintln("Failure to parse configuration file'"~configFilename~"' with error:\n\n"~e.toString(), DebugType.ERROR); + return; + } } \ No newline at end of file diff --git a/source/dnetd/dconfig.d b/source/dnetd/dconfig.d index 9b8e586..80063ba 100644 --- a/source/dnetd/dconfig.d +++ b/source/dnetd/dconfig.d @@ -12,7 +12,6 @@ import gogga; import dnetd.dlink : DLink; import dnetd.dserver : DServer; - public final class DGeneralConfig { /* Addresses to bind sockets to */