summaryrefslogtreecommitdiff
path: root/src/client.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-05-12 23:19:23 +0300
committerAndrei Karas <akaras@inbox.ru>2013-05-12 23:19:23 +0300
commita18645643144058d67301435505a506e36e0aa6b (patch)
treeab7c333c3e2c2ffc7ee4ebfb98ae63f1edda13bd /src/client.cpp
parente82b08179b74bd8bf54157897ee06626422f72b8 (diff)
downloadmanaplus-a18645643144058d67301435505a506e36e0aa6b.tar.gz
manaplus-a18645643144058d67301435505a506e36e0aa6b.tar.bz2
manaplus-a18645643144058d67301435505a506e36e0aa6b.tar.xz
manaplus-a18645643144058d67301435505a506e36e0aa6b.zip
add features configuration file to enable/disable features per server.
Diffstat (limited to 'src/client.cpp')
-rw-r--r--src/client.cpp24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/client.cpp b/src/client.cpp
index 8dd2e663a..cb17f4919 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -143,12 +143,13 @@ std::string errorMessage;
ErrorListener errorListener;
LoginData loginData;
-Configuration config; /**< XML file configuration reader */
-Configuration serverConfig; /**< XML file server configuration reader */
-Configuration branding; /**< XML branding information reader */
-Configuration paths; /**< XML default paths information reader */
-Logger *logger = nullptr; /**< Log object */
-ChatLogger *chatLogger = nullptr; /**< Chat log object */
+Configuration config; // XML file configuration reader
+Configuration serverConfig; // XML file server configuration reader
+Configuration features; // XML file features
+Configuration branding; // XML branding information reader
+Configuration paths; // XML default paths information reader
+Logger *logger = nullptr; // Log object
+ChatLogger *chatLogger = nullptr; // Chat log object
KeyboardConfig keyboard;
UserPalette *userPalette = nullptr;
Graphics *mainGraphics = nullptr;
@@ -344,6 +345,7 @@ void Client::gameInit()
logger->setLogFile(mLocalDataDir + "/manaplus.log");
initConfiguration();
+ initFeatures();
logger->log("init 4");
logger->setDebugLog(config.getBoolValue("debugLog"));
@@ -1074,6 +1076,7 @@ int Client::gameExec()
{
mServerName = mCurrentServer.hostname;
initServerConfig(mCurrentServer.hostname);
+ initFeatures();
loginData.registerUrl = mCurrentServer.registerUrl;
if (!mCurrentServer.onlineListUrl.empty())
mOnlineListUrl = mCurrentServer.onlineListUrl;
@@ -2014,9 +2017,12 @@ void Client::initServerConfig(std::string serverName)
dropShortcut = new DropShortcut;
}
-/**
- * Initialize configuration.
- */
+void Client::initFeatures() const
+{
+ features.init("features.xml", true);
+ paths.setDefaultValues(getFeaturesDefaults());
+}
+
void Client::initConfiguration() const
{
#ifdef DEBUG_CONFIG