summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Sehmisch <tmw@crushnet.org>2007-12-18 01:26:16 +0000
committerPhilipp Sehmisch <tmw@crushnet.org>2007-12-18 01:26:16 +0000
commit467f9b9b58c7a6a5c834afd874a6a3ee472f6934 (patch)
treed7186a8d31a96e08973efd208d4c9c4c2cf6acb0
parentc924c0e03f3a68bb5144cca561b654b3203ba127 (diff)
downloadmanaserv-467f9b9b58c7a6a5c834afd874a6a3ee472f6934.tar.gz
manaserv-467f9b9b58c7a6a5c834afd874a6a3ee472f6934.tar.bz2
manaserv-467f9b9b58c7a6a5c834afd874a6a3ee472f6934.tar.xz
manaserv-467f9b9b58c7a6a5c834afd874a6a3ee472f6934.zip
Updated attribute system to the latest design decisions (removed charisma, kept agility in)
-rw-r--r--ChangeLog8
-rw-r--r--src/account-server/dalstorage.cpp32
-rw-r--r--src/account-server/dalstoragesql.hpp3
-rw-r--r--src/defines.h3
-rw-r--r--src/game-server/itemmanager.cpp1
5 files changed, 24 insertions, 23 deletions
diff --git a/ChangeLog b/ChangeLog
index ca5473c1..14852935 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2007-12-18 Philipp Sehmisch <tmw@crushnet.org>
+
+ * src/account-server/dalstorage.cpp,
+ src/account-server/dalstoragesql.hpp,
+ src/defines.h, src/game-server/itemmanager.cpp: Updated
+ attribute system to the latest design decisions (removed
+ charisma, kept agility in)
+
2007-11-19 Eugenio Favalli <elvenprogrammer@gmail.com>
* accountserver.cbp, gameserver.cbp, src/utils/timer.cpp,
diff --git a/src/account-server/dalstorage.cpp b/src/account-server/dalstorage.cpp
index 2fe9c697..acaf166a 100644
--- a/src/account-server/dalstorage.cpp
+++ b/src/account-server/dalstorage.cpp
@@ -254,7 +254,7 @@ Account *DALStorage::getAccount(int accountID)
Character *DALStorage::getCharacterBySQL(std::string const &query, Account *owner)
{
- Character *character;
+ Character *character;
// specialize the string_to functor to convert
// a string to an unsigned int.
@@ -537,7 +537,6 @@ bool DALStorage::updateCharacter(Character *character)
#endif
<< character->getAttribute(CHAR_ATTR_INTELLIGENCE) << "', "
<< "will = '" << character->getAttribute(CHAR_ATTR_WILLPOWER) << "', "
- << "charisma = '" << character->getAttribute(CHAR_ATTR_CHARISMA) << "' "
<< "where id = '" << character->getDatabaseID() << "';";
mDb->execSql(sqlUpdateCharacterInfo.str());
@@ -825,7 +824,7 @@ void DALStorage::flush(Account *account)
sqlInsertCharactersTable
<< "insert into " << CHARACTERS_TBL_NAME
<< " (user_id, name, gender, hair_style, hair_color, level, money,"
- << " x, y, map_id, str, agi, dex, vit, int, will, charisma) values ("
+ << " x, y, map_id, str, agi, dex, vit, int, will) values ("
<< account->getID() << ", \""
<< (*it)->getName() << "\", "
<< (*it)->getGender() << ", "
@@ -841,8 +840,7 @@ void DALStorage::flush(Account *account)
<< (*it)->getAttribute(CHAR_ATTR_DEXTERITY) << ", "
<< (*it)->getAttribute(CHAR_ATTR_VITALITY) << ", "
<< (*it)->getAttribute(CHAR_ATTR_INTELLIGENCE) << ", "
- << (*it)->getAttribute(CHAR_ATTR_WILLPOWER) << ", "
- << (*it)->getAttribute(CHAR_ATTR_CHARISMA) << ");";
+ << (*it)->getAttribute(CHAR_ATTR_WILLPOWER) << ");";
mDb->execSql(sqlInsertCharactersTable.str());
@@ -982,7 +980,7 @@ void DALStorage::removeGuild(Guild* guild)
void DALStorage::addGuildMember(int guildId, const std::string &memberName)
{
std::ostringstream sql;
-
+
try
{
sql << "insert into " << GUILD_MEMBERS_TBL_NAME
@@ -995,7 +993,7 @@ void DALStorage::addGuildMember(int guildId, const std::string &memberName)
catch (const dal::DbSqlQueryExecFailure& e) {
// TODO: throw an exception.
LOG_ERROR("SQL query failure: " << e.what());
- }
+ }
}
/**
@@ -1004,7 +1002,7 @@ void DALStorage::addGuildMember(int guildId, const std::string &memberName)
void DALStorage::removeGuildMember(int guildId, const std::string &memberName)
{
std::ostringstream sql;
-
+
try
{
sql << "delete from " << GUILD_MEMBERS_TBL_NAME
@@ -1016,7 +1014,7 @@ void DALStorage::removeGuildMember(int guildId, const std::string &memberName)
catch (const dal::DbSqlQueryExecFailure& e) {
// TODO: throw an exception.
LOG_ERROR("SQL query failure: " << e.what());
- }
+ }
}
// Guild members should not be stored by name in the database.
@@ -1033,18 +1031,18 @@ std::list<Guild*> DALStorage::getGuildList()
/**
* Get the guilds stored in the db.
*/
-
+
try
{
sql << "select id, name from " << GUILDS_TBL_NAME << ";";
const dal::RecordSet& guildInfo = mDb->execSql(sql.str());
-
+
// check that at least 1 guild was returned
if(guildInfo.isEmpty())
{
return guilds;
}
-
+
// loop through every row in the table and assign it to a guild
for ( unsigned int i = 0; i < guildInfo.rows(); ++i)
{
@@ -1052,11 +1050,11 @@ std::list<Guild*> DALStorage::getGuildList()
guild->setId(toShort(guildInfo(i,0)));
guilds.push_back(guild);
}
-
+
/**
* Add the members to the guilds.
*/
-
+
for (std::list<Guild*>::iterator itr = guilds.begin();
itr != guilds.end();
++itr)
@@ -1065,7 +1063,7 @@ std::list<Guild*> DALStorage::getGuildList()
memberSql << "select member_name from " << GUILD_MEMBERS_TBL_NAME
<< " where guild_id = '" << (*itr)->getId() << "';";
const dal::RecordSet& memberInfo = mDb->execSql(memberSql.str());
-
+
for (unsigned int j = 0; j < memberInfo.rows(); ++j)
{
Character *character = getCharacter(memberInfo(j,0));
@@ -1078,7 +1076,7 @@ std::list<Guild*> DALStorage::getGuildList()
// TODO: throw an exception.
LOG_ERROR("SQL query failure: " << e.what());
}
-
+
return guilds;
}
#endif
@@ -1151,5 +1149,5 @@ void DALStorage::banCharacter(int id, int duration)
catch (dal::DbSqlQueryExecFailure const &e)
{
LOG_ERROR("(DALStorage::banAccount) SQL query failure: " << e.what());
- }
+ }
}
diff --git a/src/account-server/dalstoragesql.hpp b/src/account-server/dalstoragesql.hpp
index 93ae7759..51215e1b 100644
--- a/src/account-server/dalstoragesql.hpp
+++ b/src/account-server/dalstoragesql.hpp
@@ -129,7 +129,6 @@ static char const *SQL_CHARACTERS_TABLE =
// note: int must be backquoted as it's a MySQL keyword
"`int` SMALLINT UNSIGNED NOT NULL,"
"will SMALLINT UNSIGNED NOT NULL,"
- "charisma SMALLINT UNSIGNED NOT NULL,"
"FOREIGN KEY (user_id) REFERENCES tmw_accounts(id),"
"FOREIGN KEY (map_id) REFERENCES tmw_maps(id),"
"INDEX (id)"
@@ -154,7 +153,6 @@ static char const *SQL_CHARACTERS_TABLE =
"vit INTEGER NOT NULL,"
"int INTEGER NOT NULL,"
"will INTEGER NOT NULL,"
- "charisma INTEGER NOT NULL,"
"FOREIGN KEY (user_id) REFERENCES tmw_accounts(id),"
"FOREIGN KEY (map_id) REFERENCES tmw_maps(id)"
#elif defined (POSTGRESQL_SUPPORT)
@@ -178,7 +176,6 @@ static char const *SQL_CHARACTERS_TABLE =
"vit INTEGER NOT NULL,"
"int INTEGER NOT NULL,"
"will INTEGER NOT NULL,"
- "charisma INTEGER NOT NULL,"
"FOREIGN KEY (user_id) REFERENCES tmw_accounts(id),"
"FOREIGN KEY (map_id) REFERENCES tmw_maps(id)"
#endif
diff --git a/src/defines.h b/src/defines.h
index 9668bb7c..bc3e8a3f 100644
--- a/src/defines.h
+++ b/src/defines.h
@@ -71,7 +71,7 @@ enum
/**
* Points to give to a brand new character
*/
- POINTS_TO_DISTRIBUTES_AT_LVL1 = 70,
+ POINTS_TO_DISTRIBUTES_AT_LVL1 = 60,
// Screen Related
/**
@@ -394,7 +394,6 @@ enum
CHAR_ATTR_VITALITY,
CHAR_ATTR_INTELLIGENCE,
CHAR_ATTR_WILLPOWER,
- CHAR_ATTR_CHARISMA,
CHAR_ATTR_END,
CHAR_ATTR_NB = CHAR_ATTR_END - CHAR_ATTR_BEGIN,
diff --git a/src/game-server/itemmanager.cpp b/src/game-server/itemmanager.cpp
index 12dae825..02eee7d5 100644
--- a/src/game-server/itemmanager.cpp
+++ b/src/game-server/itemmanager.cpp
@@ -123,7 +123,6 @@ void ItemManager::reload()
modifiers.setAttributeValue(CHAR_ATTR_VITALITY, XML::getProperty(node, "vitality", 0));
modifiers.setAttributeValue(CHAR_ATTR_INTELLIGENCE, XML::getProperty(node, "intelligence", 0));
modifiers.setAttributeValue(CHAR_ATTR_WILLPOWER, XML::getProperty(node, "willpower", 0));
- modifiers.setAttributeValue(CHAR_ATTR_CHARISMA, XML::getProperty(node, "charisma", 0));
if (maxPerSlot == 0)
{