Added stub functions for creating a new Server instance

This commit is contained in:
Tristan B. Kildaire 2021-09-29 12:41:51 +02:00
parent d23ea6c16e
commit e27a683170
1 changed files with 17 additions and 1 deletions

View File

@ -1,6 +1,7 @@
import std.stdio;
import std.json;
import std.exception;
import dnetd.server;
void main(string[] args)
{
@ -36,13 +37,28 @@ private void startServer(string configPath)
try
{
configJSON= parseJSON(configFileData);
configJSON = parseJSON(configFileData);
}
catch(JSONException)
{
writeln("config parse error");
return;
}
/* Get server config */
ServerConfig config = getServerConfig(configJSON);
/* Create a new Server */
Server server = new Server(config);
}
private ServerConfig getServerConfig(JSONValue jsonConfig)
{
/* TODO: Implement me */
ServerConfig config;
return config;
}
private string readConfig(string configPath)