diff options
author | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2011-08-30 21:08:21 +0200 |
---|---|---|
committer | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2011-08-30 21:08:21 +0200 |
commit | 5661e7d0ce2c3233d302d65ac4cd7b016af27cde (patch) | |
tree | 41e376373bc56fb4a88c99e0d8e370edab942c93 /src/account-server | |
parent | 800772fc10d923b315277490e7e009fe116e8ce5 (diff) | |
parent | 6204fdfdae8139083b48a114b954a844b0df707c (diff) | |
download | manaserv-5661e7d0ce2c3233d302d65ac4cd7b016af27cde.tar.gz manaserv-5661e7d0ce2c3233d302d65ac4cd7b016af27cde.tar.bz2 manaserv-5661e7d0ce2c3233d302d65ac4cd7b016af27cde.tar.xz manaserv-5661e7d0ce2c3233d302d65ac4cd7b016af27cde.zip |
Merge branch 'equipment-fix'
Diffstat (limited to 'src/account-server')
-rw-r--r-- | src/account-server/main-account.cpp | 5 | ||||
-rw-r--r-- | src/account-server/storage.cpp | 11 |
2 files changed, 10 insertions, 6 deletions
diff --git a/src/account-server/main-account.cpp b/src/account-server/main-account.cpp index 5520fb8e..6d46ec49 100644 --- a/src/account-server/main-account.cpp +++ b/src/account-server/main-account.cpp @@ -364,8 +364,9 @@ int main(int argc, char *argv[]) LOG_INFO("The Mana Account+Chat Server (unknown version)"); #endif LOG_INFO("Manaserv Protocol version " << ManaServ::PROTOCOL_VERSION - << ", " << "Enet version " << ENET_VERSION_MAJOR << "." - << ENET_VERSION_MINOR << "." << ENET_VERSION_PATCH); + << ", Enet version " << ENET_VERSION_MAJOR << "." + << ENET_VERSION_MINOR << "." << ENET_VERSION_PATCH + << ", Database version " << ManaServ::SUPPORTED_DB_VERSION); if (!options.verbosityChanged) options.verbosity = static_cast<Logger::Level>( diff --git a/src/account-server/storage.cpp b/src/account-server/storage.cpp index 05f8ec69..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 = "14"; /* * 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()); } |