diff options
author | deva <deva> | 2008-07-30 11:33:15 +0000 |
---|---|---|
committer | deva <deva> | 2008-07-30 11:33:15 +0000 |
commit | 71ac37ecfaf5dff76c8880b62228c30bd207054b (patch) | |
tree | 3d0074544ae1141bb9154884de69ece62e8a3519 /server/src/configuration.cc | |
parent | b3b694c8dd17955aec463f50c6f526f570d8b97f (diff) |
Added global Conf namepsace with configuration values. These are to be filled with config file values later.
Diffstat (limited to 'server/src/configuration.cc')
-rw-r--r-- | server/src/configuration.cc | 45 |
1 files changed, 9 insertions, 36 deletions
diff --git a/server/src/configuration.cc b/server/src/configuration.cc index 3f8e9d6..8883e30 100644 --- a/server/src/configuration.cc +++ b/server/src/configuration.cc @@ -26,42 +26,15 @@ */ #include "configuration.h" -#include "debug.h" +port_t Conf::server_port = 12345; +std::string Conf::server_user = "pracro"; +std::string Conf::server_group = "pracro"; -Configuration::Configuration(std::string filename) -{ - this->filename = filename; +std::string Conf::journal_commit_addr = "localhost"; +port_t Conf::journal_commit_port = 18112; - reload(); -} +unsigned int Conf::db_max_ttl = 60 * 60 * 24; +unsigned int Conf::pentominos_max_ttl = 60 * 60 * 24; -void Configuration::reload() - throw(ConfigurationException) -{ - try { - readFile(this->filename.c_str()); - } catch(libconfig::FileIOException) { - throw ConfigurationException("Could not read config file: File does not exist."); - } catch(libconfig::ParseException &e) { - char lineno[32]; - sprintf(lineno, "%d", e.getLine()); - throw ConfigurationException(std::string("Error when parsing the config file in line ") - + lineno + ": " + e.getError()); - } -} - - -static Configuration *_config = NULL; - -Configuration *config() - throw(ConfigurationException) -{ - if(_config == NULL) - throw ConfigurationException("Configuration has not yet been set."); - return _config; -} - -void initConfig(Configuration *config) -{ - _config = config; -} +std::string pentominos_addr = "localhost"; +port_t pentominos_potr = 11108; |