summaryrefslogtreecommitdiff
path: root/src/account-server/accounthandler.cpp
diff options
context:
space:
mode:
authorRogier Polak <rogier.l.a.polak@gmail.com>2007-03-14 17:47:44 +0000
committerRogier Polak <rogier.l.a.polak@gmail.com>2007-03-14 17:47:44 +0000
commit7ee29dd31113ea6419801e42de0e4b4a122b7aca (patch)
treed72ab243f5f378d7254d4765b3df0b46b63f5aa3 /src/account-server/accounthandler.cpp
parentd69f5bc43d0d08f9b47465598d6b53552a252dfc (diff)
downloadmanaserv-7ee29dd31113ea6419801e42de0e4b4a122b7aca.tar.gz
manaserv-7ee29dd31113ea6419801e42de0e4b4a122b7aca.tar.bz2
manaserv-7ee29dd31113ea6419801e42de0e4b4a122b7aca.tar.xz
manaserv-7ee29dd31113ea6419801e42de0e4b4a122b7aca.zip
Modified the game-server to use AbstractCharacterData, some renaming
Diffstat (limited to 'src/account-server/accounthandler.cpp')
-rw-r--r--src/account-server/accounthandler.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/account-server/accounthandler.cpp b/src/account-server/accounthandler.cpp
index 2b1f2ff0..fe3c64d8 100644
--- a/src/account-server/accounthandler.cpp
+++ b/src/account-server/accounthandler.cpp
@@ -351,8 +351,8 @@ AccountHandler::handleLoginMessage(AccountClient &computer, MessageIn &msg)
charInfo.writeByte(chars[i]->getHairColor());
charInfo.writeByte(chars[i]->getLevel());
charInfo.writeShort(chars[i]->getMoney());
- for (int j = 0; j < NB_ATTRIBUTES; ++j)
- charInfo.writeShort(chars[i]->getAttribute(j));
+ for (int j = 0; j < NB_BASE_ATTRIBUTES; ++j)
+ charInfo.writeShort(chars[i]->getBaseAttribute(j));
computer.send(charInfo);
}
return;
@@ -620,8 +620,8 @@ AccountHandler::handleCharacterCreateMessage(AccountClient &computer,
// LATER_ON: Add race, face and maybe special attributes.
// Customization of character's attributes...
- unsigned short attributes[NB_ATTRIBUTES];
- for (int i = 0; i < NB_ATTRIBUTES; ++i)
+ unsigned short attributes[NB_BASE_ATTRIBUTES];
+ for (int i = 0; i < NB_BASE_ATTRIBUTES; ++i)
attributes[i] = msg.readShort();
// We see if the difference between the lowest stat and the highest
@@ -630,7 +630,7 @@ AccountHandler::handleCharacterCreateMessage(AccountClient &computer,
unsigned short highestAttribute = 0; // start value
unsigned int totalAttributes = 0;
bool validNonZeroAttributes = true;
- for (int i = 0; i < NB_ATTRIBUTES; ++i)
+ for (int i = 0; i < NB_BASE_ATTRIBUTES; ++i)
{
// For good total attributes check.
totalAttributes += attributes[i];
@@ -663,8 +663,8 @@ AccountHandler::handleCharacterCreateMessage(AccountClient &computer,
else
{
CharacterPtr newCharacter(new CharacterData(name));
- for (int i = 0; i < NB_ATTRIBUTES; ++i)
- newCharacter->setAttribute(i, attributes[i]);
+ for (int i = 0; i < NB_BASE_ATTRIBUTES; ++i)
+ newCharacter->setBaseAttribute(i, attributes[i]);
newCharacter->setMoney(0);
newCharacter->setLevel(1);
newCharacter->setGender(gender);
@@ -673,7 +673,7 @@ AccountHandler::handleCharacterCreateMessage(AccountClient &computer,
newCharacter->setMapId((int) config.getValue("defaultMap", 1));
Point startingPos((int) config.getValue("startX", 0),
(int) config.getValue("startY", 0));
- newCharacter->setPos(startingPos);
+ newCharacter->setPosition(startingPos);
computer.getAccount()->addCharacter(newCharacter);
LOG_INFO("Character " << name << " was created for "
@@ -693,8 +693,8 @@ AccountHandler::handleCharacterCreateMessage(AccountClient &computer,
charInfo.writeByte(chars[slot]->getHairColor());
charInfo.writeByte(chars[slot]->getLevel());
charInfo.writeShort(chars[slot]->getMoney());
- for (int j = 0; j < NB_ATTRIBUTES; ++j)
- charInfo.writeShort(chars[slot]->getAttribute(j));
+ for (int j = 0; j < NB_BASE_ATTRIBUTES; ++j)
+ charInfo.writeShort(chars[slot]->getBaseAttribute(j));
computer.send(charInfo);
return;
}
@@ -749,9 +749,9 @@ handleReconnectedAccount(AccountClient &computer, int accountID)
charInfo.writeByte(chars[i]->getLevel());
charInfo.writeShort(chars[i]->getMoney());
- for (int j = 0; j < NB_ATTRIBUTES; ++j)
+ for (int j = 0; j < NB_BASE_ATTRIBUTES; ++j)
{
- charInfo.writeShort(chars[i]->getAttribute(j));
+ charInfo.writeShort(chars[i]->getBaseAttribute(j));
}
computer.send(charInfo);
}