diff options
author | deva <deva> | 2008-07-30 12:19:03 +0000 |
---|---|---|
committer | deva <deva> | 2008-07-30 12:19:03 +0000 |
commit | 0da554ba6a55bbc195a30afa8f154af2ec2107a7 (patch) | |
tree | 1f5c1f6d6964c4e2cc76ddcfae9ec1f5940b32ad /server/src/configurationparser.cc | |
parent | 2cfbbf77c85e48bad66288bad4b2122a526c6699 (diff) |
Reenabled the config file parser.
Diffstat (limited to 'server/src/configurationparser.cc')
-rw-r--r-- | server/src/configurationparser.cc | 57 |
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( ... ) { + } } |