summaryrefslogtreecommitdiff
path: root/server/src/configurationparser.cc
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/configurationparser.cc')
-rw-r--r--server/src/configurationparser.cc57
1 files changed, 57 insertions, 0 deletions
diff --git a/server/src/configurationparser.cc b/server/src/configurationparser.cc
index 6335fd9..3065907 100644
--- a/server/src/configurationparser.cc
+++ b/server/src/configurationparser.cc
@@ -26,6 +26,8 @@
*/
#include "configurationparser.h"
+#include "configuration.h"
+
ConfigurationParser::ConfigurationParser(std::string filename)
{
this->filename = filename;
@@ -46,4 +48,59 @@ void ConfigurationParser::reload()
throw ConfigurationParserException(std::string("Error when parsing the config file in line ")
+ lineno + ": " + e.getError());
}
+
+ // Set internal values
+ try {
+ int p = lookup("server_port");
+ Conf::server_port = p;
+ } catch( ... ) {
+ }
+
+ try {
+ std::string u = lookup("server_user");
+ Conf::server_user = u;
+ } catch( ... ) {
+ }
+
+ try {
+ std::string g = lookup("server_group");
+ Conf::server_group = g;
+ } catch( ... ) {
+ }
+
+ try {
+ std::string a = lookup("journal_commit_addr");
+ Conf::journal_commit_addr = a;
+ } catch( ... ) {
+ }
+
+ try {
+ int p = lookup("journal_commit_port");
+ Conf::journal_commit_port = p;
+ } catch( ... ) {
+ }
+
+ try {
+ int t = lookup("db_max_ttl");
+ Conf::db_max_ttl = t;
+ } catch( ... ) {
+ }
+
+ try {
+ int t = lookup("pentominos_max_ttl");
+ Conf::pentominos_max_ttl = t;
+ } catch( ... ) {
+ }
+
+ try {
+ std::string a = lookup("pentominos_addr");
+ Conf::pentominos_addr = a;
+ } catch( ... ) {
+ }
+
+ try {
+ int p = lookup("pentominos_port");
+ Conf::pentominos_port = p;
+ } catch( ... ) {
+ }
}