From 0da554ba6a55bbc195a30afa8f154af2ec2107a7 Mon Sep 17 00:00:00 2001 From: deva Date: Wed, 30 Jul 2008 12:19:03 +0000 Subject: Reenabled the config file parser. --- server/src/configurationparser.cc | 57 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) (limited to 'server/src/configurationparser.cc') 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( ... ) { + } } -- cgit v1.2.3