diff options
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; |