summaryrefslogtreecommitdiff
path: root/src/account-server
diff options
context:
space:
mode:
authorPhilipp Sehmisch <tmw@crushnet.org>2007-03-15 23:47:13 +0000
committerPhilipp Sehmisch <tmw@crushnet.org>2007-03-15 23:47:13 +0000
commit7e1011ccea542f4bc972c0a9c03eaca4a718566b (patch)
tree4ebdde458b132ddb12c737a338e39711eed72534 /src/account-server
parent16faa1f2ead902fd5f883dab487fc4ef4762c45f (diff)
downloadmanaserv-7e1011ccea542f4bc972c0a9c03eaca4a718566b.tar.gz
manaserv-7e1011ccea542f4bc972c0a9c03eaca4a718566b.tar.bz2
manaserv-7e1011ccea542f4bc972c0a9c03eaca4a718566b.tar.xz
manaserv-7e1011ccea542f4bc972c0a9c03eaca4a718566b.zip
Set the default map position of new characters to a value that makes more sense. Implemented new basic attribute system on account server. Removed attribute modifiers, unified basic and derived attributes, storing attributes in a vector, renamed some attribute identifiers, removed identifiers for derived attributes that aren't needed yet.
Diffstat (limited to 'src/account-server')
-rw-r--r--src/account-server/accounthandler.cpp4
-rw-r--r--src/account-server/dalstorage.cpp41
-rw-r--r--src/account-server/dalstoragesql.hpp9
3 files changed, 30 insertions, 24 deletions
diff --git a/src/account-server/accounthandler.cpp b/src/account-server/accounthandler.cpp
index 4f2bbe89..a77516ce 100644
--- a/src/account-server/accounthandler.cpp
+++ b/src/account-server/accounthandler.cpp
@@ -671,8 +671,8 @@ AccountHandler::handleCharacterCreateMessage(AccountClient &computer,
newCharacter->setHairStyle(hairStyle);
newCharacter->setHairColor(hairColor);
newCharacter->setMapId((int) config.getValue("defaultMap", 1));
- Point startingPos((int) config.getValue("startX", 0),
- (int) config.getValue("startY", 0));
+ Point startingPos((int) config.getValue("startX", 512),
+ (int) config.getValue("startY", 512));
newCharacter->setPosition(startingPos);
computer.getAccount()->addCharacter(newCharacter);
diff --git a/src/account-server/dalstorage.cpp b/src/account-server/dalstorage.cpp
index 0df47d86..4898ed1c 100644
--- a/src/account-server/dalstorage.cpp
+++ b/src/account-server/dalstorage.cpp
@@ -550,22 +550,24 @@ DALStorage::updateCharacter(CharacterPtr character)
<< "', "
<< "map_id = '" << character->getMapId()
<< "', "
- << "str = '" << character->getBaseAttribute(ATT_STRENGTH)
+ << "str = '" << character->getBaseAttribute(BASE_ATTR_STRENGTH)
<< "', "
- << "agi = '" << character->getBaseAttribute(ATT_AGILITY)
+ << "agi = '" << character->getBaseAttribute(BASE_ATTR_AGILITY)
<< "', "
- << "vit = '" << character->getBaseAttribute(ATT_VITALITY)
+ << "vit = '" << character->getBaseAttribute(BASE_ATTR_VITALITY)
<< "', "
#if defined(MYSQL_SUPPORT) || defined(POSTGRESQL_SUPPORT)
<< "`int` = '"
#else
<< "int = '"
#endif
- << character->getBaseAttribute(ATT_INTELLIGENCE)
+ << character->getBaseAttribute(BASE_ATTR_INTELLIGENCE)
<< "', "
- << "dex = '" << character->getBaseAttribute(ATT_DEXTERITY)
+ << "dex = '" << character->getBaseAttribute(BASE_ATTR_DEXTERITY)
<< "', "
- << "luck = '" << character->getBaseAttribute(ATT_LUCK)
+ << "will = '" << character->getBaseAttribute(BASE_ATTR_WILLPOWER)
+ << "', "
+ << "charisma = '" << character->getBaseAttribute(BASE_ATTR_CHARISMA)
<< "' "
<< "where id = '" << character->getDatabaseID()
<< "';";
@@ -863,7 +865,7 @@ void DALStorage::flush(AccountPtr const &account)
sqlInsertCharactersTable
<< "insert into " << CHARACTERS_TBL_NAME
<< " (user_id, name, gender, hair_style, hair_color, level, money,"
- << " x, y, map_id, str, agi, vit, int, dex, luck) values ("
+ << " x, y, map_id, str, agi, vit, int, dex, will, charisma) values ("
<< account->getID() << ", \""
<< (*it)->getName() << "\", "
<< (*it)->getGender() << ", "
@@ -874,12 +876,13 @@ void DALStorage::flush(AccountPtr const &account)
<< (*it)->getPosition().x << ", "
<< (*it)->getPosition().y << ", "
<< (*it)->getMapId() << ", "
- << (*it)->getBaseAttribute(ATT_STRENGTH) << ", "
- << (*it)->getBaseAttribute(ATT_AGILITY) << ", "
- << (*it)->getBaseAttribute(ATT_VITALITY) << ", "
- << (*it)->getBaseAttribute(ATT_INTELLIGENCE) << ", "
- << (*it)->getBaseAttribute(ATT_DEXTERITY) << ", "
- << (*it)->getBaseAttribute(ATT_LUCK) << ");";
+ << (*it)->getBaseAttribute(BASE_ATTR_STRENGTH) << ", "
+ << (*it)->getBaseAttribute(BASE_ATTR_AGILITY) << ", "
+ << (*it)->getBaseAttribute(BASE_ATTR_VITALITY) << ", "
+ << (*it)->getBaseAttribute(BASE_ATTR_INTELLIGENCE) << ", "
+ << (*it)->getBaseAttribute(BASE_ATTR_DEXTERITY) << ", "
+ << (*it)->getBaseAttribute(BASE_ATTR_WILLPOWER) << ", "
+ << (*it)->getBaseAttribute(BASE_ATTR_CHARISMA) << ");";
mDb->execSql(sqlInsertCharactersTable.str());
} else {
@@ -895,17 +898,17 @@ void DALStorage::flush(AccountPtr const &account)
<< " x = " << (*it)->getPosition().x << ", "
<< " y = " << (*it)->getPosition().y << ", "
<< " map_id = " << (*it)->getMapId() << ", "
- << " str = " << (*it)->getBaseAttribute(ATT_STRENGTH) << ", "
- << " agi = " << (*it)->getBaseAttribute(ATT_AGILITY) << ", "
- << " vit = " << (*it)->getBaseAttribute(ATT_VITALITY) << ", "
+ << " str = " << (*it)->getBaseAttribute(BASE_ATTR_STRENGTH) << ", "
+ << " agi = " << (*it)->getBaseAttribute(BASE_ATTR_AGILITY) << ", "
+ << " vit = " << (*it)->getBaseAttribute(BASE_ATTR_VITALITY) << ", "
#if defined(MYSQL_SUPPORT) || defined(POSTGRESQL_SUPPORT)
<< " `int` = "
#else
<< " int = "
#endif
- << (*it)->getBaseAttribute(ATT_INTELLIGENCE) << ", "
- << " dex = " << (*it)->getBaseAttribute(ATT_DEXTERITY) << ", "
- << " luck = " << (*it)->getBaseAttribute(ATT_LUCK)
+ << (*it)->getBaseAttribute(BASE_ATTR_INTELLIGENCE) << ", "
+ << " will = " << (*it)->getBaseAttribute(BASE_ATTR_WILLPOWER) << ", "
+ << " charisma = " << (*it)->getBaseAttribute(BASE_ATTR_CHARISMA)
<< " where id = " << (*it)->getDatabaseID() << ";";
mDb->execSql(sqlUpdateCharactersTable.str());
diff --git a/src/account-server/dalstoragesql.hpp b/src/account-server/dalstoragesql.hpp
index 655cbac6..1d42467d 100644
--- a/src/account-server/dalstoragesql.hpp
+++ b/src/account-server/dalstoragesql.hpp
@@ -136,7 +136,8 @@ const std::string SQL_CHARACTERS_TABLE(
// note: int must be backquoted as it's a MySQL keyword
"`int` SMALLINT UNSIGNED NOT NULL,"
"dex SMALLINT UNSIGNED NOT NULL,"
- "luck 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)"
@@ -160,7 +161,8 @@ const std::string SQL_CHARACTERS_TABLE(
"vit INTEGER NOT NULL,"
"int INTEGER NOT NULL,"
"dex INTEGER NOT NULL,"
- "luck 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)
@@ -183,7 +185,8 @@ const std::string SQL_CHARACTERS_TABLE(
"vit INTEGER NOT NULL,"
"int INTEGER NOT NULL,"
"dex INTEGER NOT NULL,"
- "luck 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