diff options
author | Andreas Habel <mail@exceptionfault.de> | 2008-10-13 09:48:40 +0000 |
---|---|---|
committer | Andreas Habel <mail@exceptionfault.de> | 2008-10-13 09:48:40 +0000 |
commit | 5956dd7483ceda0d9e8464440d467fc7003c9182 (patch) | |
tree | 8a163328424b482def0d37af0feb9a4689f7e133 /src | |
parent | 29ae6d3f42ac55e7bc8c5ad0b044c7b0e662d358 (diff) | |
download | manaserv-5956dd7483ceda0d9e8464440d467fc7003c9182.tar.gz manaserv-5956dd7483ceda0d9e8464440d467fc7003c9182.tar.bz2 manaserv-5956dd7483ceda0d9e8464440d467fc7003c9182.tar.xz manaserv-5956dd7483ceda0d9e8464440d467fc7003c9182.zip |
fixed bug 456: erroneous sql query at character save
Diffstat (limited to 'src')
-rw-r--r-- | src/account-server/dalstorage.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/account-server/dalstorage.cpp b/src/account-server/dalstorage.cpp index d3d10aff..2484657d 100644 --- a/src/account-server/dalstorage.cpp +++ b/src/account-server/dalstorage.cpp @@ -122,6 +122,8 @@ Account *DALStorage::getAccountBySQL(std::string const &query) account->setName(accountInfo(0, 1)); account->setPassword(accountInfo(0, 2)); account->setEmail(accountInfo(0, 3)); + account->setRegistrationDate(toUint(accountInfo(0, 6))); + account->setLastLogin(toUint(accountInfo(0, 7))); int level = toUint(accountInfo(0, 4)); // Check if the user is permanently banned, or temporarily banned. @@ -133,9 +135,6 @@ Account *DALStorage::getAccountBySQL(std::string const &query) return account; } account->setLevel(level); - account->setRegistrationDate(toUint(accountInfo(0, 6))); - account->setLastLogin(toUint(accountInfo(0, 7))); - // load the characters associated with the account. std::ostringstream sql; @@ -176,6 +175,7 @@ Account *DALStorage::getAccountBySQL(std::string const &query) } catch (dal::DbSqlQueryExecFailure const &e) { + LOG_ERROR("DALStorage::getAccountBySQL: " << e.what()); return NULL; // TODO: Throw exception here } } @@ -635,12 +635,12 @@ void DALStorage::flushSkill(const Character* const character, return; } - sql.clear(); + sql.str(""); sql << "INSERT INTO " << CHAR_SKILLS_TBL_NAME << " " - << "(char_id, skill_id, skill_exp) VALUES " + << "(char_id, skill_id, skill_exp) VALUES ( " << "'" << character->getDatabaseID() << "', " << "'" << skill_id << "', " - << "'" << exp << "'"; + << "'" << exp << "' )"; mDb->execSql(sql.str()); } catch (const dal::DbSqlQueryExecFailure &e) |