summaryrefslogtreecommitdiff
path: root/src/account-server/storage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/account-server/storage.cpp')
-rw-r--r--src/account-server/storage.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/account-server/storage.cpp b/src/account-server/storage.cpp
index ef66c020..4f22964b 100644
--- a/src/account-server/storage.cpp
+++ b/src/account-server/storage.cpp
@@ -28,10 +28,12 @@
#include "chat-server/guild.h"
#include "chat-server/post.h"
#include "common/configuration.h"
+#include "common/manaserv_protocol.h"
#include "dal/dalexcept.h"
#include "dal/dataproviderfactory.h"
#include "utils/functors.h"
#include "utils/point.h"
+#include "utils/string.h"
#include "utils/throwerror.h"
#include "utils/xml.h"
@@ -41,7 +43,6 @@ static const char *DEFAULT_ITEM_FILE = "items.xml";
// Defines the supported db version
static const char *DB_VERSION_PARAMETER = "database_version";
-static const char *SUPPORTED_DB_VERSION = "15";
/*
* MySQL specificities:
@@ -118,12 +119,14 @@ void Storage::open()
mDb->connect();
// Check database version here
- std::string dbversion = getWorldStateVar(DB_VERSION_PARAMETER);
- if (dbversion != SUPPORTED_DB_VERSION)
+ int dbversion = utils::stringToInt(
+ getWorldStateVar(DB_VERSION_PARAMETER));
+ int supportedDbVersion = ManaServ::SUPPORTED_DB_VERSION;
+ if (dbversion != supportedDbVersion)
{
std::ostringstream errmsg;
errmsg << "Database version is not supported. "
- << "Needed version: '" << SUPPORTED_DB_VERSION
+ << "Needed version: '" << supportedDbVersion
<< "', current version: '" << dbversion << "'";
utils::throwError(errmsg.str());
}