diff options
author | Erik Schilling <ablu.erikschilling@googlemail.com> | 2013-04-13 12:32:22 +0200 |
---|---|---|
committer | Erik Schilling <ablu.erikschilling@googlemail.com> | 2013-05-08 14:02:50 +0200 |
commit | 708896008ad8ea391d542ce37b9871318a84fb97 (patch) | |
tree | 30c862cb18d354f879ffb0b426d5ff133d2bde3b /src/account-server | |
parent | e2b6a4efe72333ab0e0761f4e9e8ce9eb29a5335 (diff) | |
download | manaserv-708896008ad8ea391d542ce37b9871318a84fb97.tar.gz manaserv-708896008ad8ea391d542ce37b9871318a84fb97.tar.xz manaserv-708896008ad8ea391d542ce37b9871318a84fb97.zip |
[Abilities] Renamed specials to abilities
Diffstat (limited to 'src/account-server')
-rw-r--r-- | src/account-server/character.cpp | 6 | ||||
-rw-r--r-- | src/account-server/character.h | 38 | ||||
-rw-r--r-- | src/account-server/storage.cpp | 38 |
3 files changed, 41 insertions, 41 deletions
diff --git a/src/account-server/character.cpp b/src/account-server/character.cpp index 61e59b4..19d679d 100644 --- a/src/account-server/character.cpp +++ b/src/account-server/character.cpp @@ -46,10 +46,10 @@ void CharacterData::setAccount(Account *acc) mAccountLevel = acc->getLevel(); } -void CharacterData::giveSpecial(int id, int currentMana) +void CharacterData::giveAbility(int id, int currentMana) { - if (mSpecials.find(id) == mSpecials.end()) + if (mAbilities.find(id) == mAbilities.end()) { - mSpecials[id] = SpecialValue(currentMana); + mAbilities[id] = AbilityValue(currentMana); } } diff --git a/src/account-server/character.h b/src/account-server/character.h index a9aa810..f59fe23 100644 --- a/src/account-server/character.h +++ b/src/account-server/character.h @@ -55,17 +55,17 @@ struct AttributeValue { return modified; } }; -struct SpecialValue +struct AbilityValue { - SpecialValue() - : currentMana(0) + AbilityValue() + : currentPoints(0) {} - SpecialValue(unsigned currentMana) - : currentMana(currentMana) + AbilityValue(unsigned currentPoints) + : currentPoints(currentPoints) {} - unsigned currentMana; + unsigned currentPoints; }; struct Status @@ -83,9 +83,9 @@ struct Status typedef std::map<unsigned, AttributeValue> AttributeMap; /** - * Stores specials by their id. + * Stores abilitys by their id. */ -typedef std::map<unsigned, SpecialValue> SpecialMap; +typedef std::map<unsigned, AbilityValue> AbilityMap; class CharacterData { @@ -221,22 +221,22 @@ class CharacterData { mKillCount[monsterId] = kills; } /** - * Get / Set specials + * Get / Set abilitys */ - int getSpecialSize() const - { return mSpecials.size(); } + int getAbilitySize() const + { return mAbilities.size(); } - SpecialMap::const_iterator getSpecialBegin() const - { return mSpecials.begin(); } + AbilityMap::const_iterator getAbilityBegin() const + { return mAbilities.begin(); } - SpecialMap::const_iterator getSpecialEnd() const - { return mSpecials.end(); } + AbilityMap::const_iterator getAbilityEnd() const + { return mAbilities.end(); } - void clearSpecials() - { mSpecials.clear(); } + void clearAbilities() + { mAbilities.clear(); } - void giveSpecial(int id, int currentMana); + void giveAbility(int id, int currentMana); /** * Gets the Id of the map that the character is on. @@ -303,7 +303,7 @@ class CharacterData std::map<int, int> mExperience; //!< Skill Experience. std::map<int, Status> mStatusEffects; //!< Status Effects std::map<int, int> mKillCount; //!< Kill Count - SpecialMap mSpecials; + AbilityMap mAbilities; unsigned short mMapId; //!< Map the being is on. unsigned char mGender; //!< Gender of the being. unsigned char mHairStyle; //!< Hair style of the being. diff --git a/src/account-server/storage.cpp b/src/account-server/storage.cpp index 72f4fc0..965024a 100644 --- a/src/account-server/storage.cpp +++ b/src/account-server/storage.cpp @@ -78,7 +78,7 @@ static const char *CHAR_ATTR_TBL_NAME = "mana_char_attr"; static const char *CHAR_SKILLS_TBL_NAME = "mana_char_skills"; static const char *CHAR_STATUS_EFFECTS_TBL_NAME = "mana_char_status_effects"; static const char *CHAR_KILL_COUNT_TBL_NAME = "mana_char_kill_stats"; -static const char *CHAR_SPECIALS_TBL_NAME = "mana_char_specials"; +static const char *CHAR_ABILITIES_TBL_NAME = "mana_char_abilities"; static const char *CHAR_EQUIPS_TBL_NAME = "mana_char_equips"; static const char *INVENTORIES_TBL_NAME = "mana_inventories"; static const char *ITEMS_TBL_NAME = "mana_items"; @@ -474,20 +474,20 @@ CharacterData *Storage::getCharacterBySQL(Account *owner) } } - // Load the special status + // Load the ability status s.clear(); s.str(""); - s << "SELECT special_id, special_current_mana FROM " - << CHAR_SPECIALS_TBL_NAME + s << "SELECT ability_id, ability_current_points FROM " + << CHAR_ABILITIES_TBL_NAME << " WHERE char_id = " << character->getDatabaseID(); - const dal::RecordSet &specialsInfo = mDb->execSql(s.str()); - if (!specialsInfo.isEmpty()) + const dal::RecordSet &abilitiesInfo = mDb->execSql(s.str()); + if (!abilitiesInfo.isEmpty()) { - const unsigned nRows = specialsInfo.rows(); + const unsigned nRows = abilitiesInfo.rows(); for (unsigned row = 0; row < nRows; row++) { - character->giveSpecial(toUint(specialsInfo(row, 0)), - toUint(specialsInfo(row, 1))); + character->giveAbility(toUint(abilitiesInfo(row, 0)), + toUint(abilitiesInfo(row, 1))); } } } @@ -788,29 +788,29 @@ bool Storage::updateCharacter(CharacterData *character) "SQL query failure: ", e); } - // Character's special actions + // Character's abillities try { // Out with the old std::ostringstream deleteSql(""); std::ostringstream insertSql; - deleteSql << "DELETE FROM " << CHAR_SPECIALS_TBL_NAME + deleteSql << "DELETE FROM " << CHAR_ABILITIES_TBL_NAME << " WHERE char_id='" << character->getDatabaseID() << "';"; mDb->execSql(deleteSql.str()); // In with the new - SpecialMap::const_iterator special_it, special_it_end; - for (special_it = character->getSpecialBegin(), - special_it_end = character->getSpecialEnd(); - special_it != special_it_end; ++special_it) + AbilityMap::const_iterator ability_it, ability_it_end; + for (ability_it = character->getAbilityBegin(), + ability_it_end = character->getAbilityEnd(); + ability_it != ability_it_end; ++ability_it) { insertSql.str(""); - insertSql << "INSERT INTO " << CHAR_SPECIALS_TBL_NAME - << " (char_id, special_id, special_current_mana)" + insertSql << "INSERT INTO " << CHAR_ABILITIES_TBL_NAME + << " (char_id, ability_id, ability_current_points)" << " VALUES (" << " '" << character->getDatabaseID() << "'," - << " '" << special_it->first << "'," - << " '" << special_it->second.currentMana + << " '" << ability_it->first << "'," + << " '" << ability_it->second.currentPoints << "');"; mDb->execSql(insertSql.str()); } |