summaryrefslogtreecommitdiffstats
path: root/src/account-server
diff options
context:
space:
mode:
authorErik Schilling <ablu.erikschilling@googlemail.com>2012-04-18 19:49:12 +0200
committerErik Schilling <ablu.erikschilling@googlemail.com>2012-05-25 15:12:23 +0200
commita5108774672d118f89b9f24e4e846341fd5105fd (patch)
treeae95da1aa0f0b18ad6129d664f69a2c6b0f93eb5 /src/account-server
parent7dc342ab105a305d31badd1449c3ac295d700666 (diff)
downloadmanaserv-a5108774672d118f89b9f24e4e846341fd5105fd.tar.gz
manaserv-a5108774672d118f89b9f24e4e846341fd5105fd.tar.xz
manaserv-a5108774672d118f89b9f24e4e846341fd5105fd.zip
Fixed handling of skills
- Removed possibility of skills getting mixed with attributes - Made the server sending the level of the current skill on exp change (currently the client could calculate it itself, but it allows more flexibillity in future this way) - Fixed reading of skills out of the database (for some reason the status effects were added as skills) ** Needs clientside patch as well (coming soon) ** Reviewed-by: Bertram.
Diffstat (limited to 'src/account-server')
-rw-r--r--src/account-server/storage.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/account-server/storage.cpp b/src/account-server/storage.cpp
index c39bfc5..353dc8e 100644
--- a/src/account-server/storage.cpp
+++ b/src/account-server/storage.cpp
@@ -429,26 +429,26 @@ Character *Storage::getCharacterBySQL(Account *owner)
s.clear();
s.str("");
- // Load the skills of the char from CHAR_SKILLS_TBL_NAME
- s << "select status_id, status_time FROM "
- << CHAR_STATUS_EFFECTS_TBL_NAME
+ // Load skills.
+ s << "SELECT skill_id, skill_exp "
+ << "FROM " << CHAR_SKILLS_TBL_NAME
<< " WHERE char_id = " << character->getDatabaseID();
const dal::RecordSet &skillInfo = mDb->execSql(s.str());
if (!skillInfo.isEmpty())
{
const unsigned int nRows = skillInfo.rows();
- for (unsigned int row = 0; row < nRows; row++)
+ for (unsigned int row = 0; row < nRows; ++row)
{
- character->setExperience(
- toUint(skillInfo(row, 0)), // Skill Id
- toUint(skillInfo(row, 1))); // Experience
+ unsigned int id = toUint(skillInfo(row, 0));
+ character->setExperience(id, toInt(skillInfo(row, 1)));
}
}
- // Load the status effect
s.clear();
s.str("");
+
+ // Load the status effects
s << "select status_id, status_time FROM "
<< CHAR_STATUS_EFFECTS_TBL_NAME
<< " WHERE char_id = " << character->getDatabaseID();