summaryrefslogtreecommitdiff
path: root/src/game-server
diff options
context:
space:
mode:
authorGuillaume Melquiond <guillaume.melquiond@gmail.com>2007-07-01 19:41:59 +0000
committerGuillaume Melquiond <guillaume.melquiond@gmail.com>2007-07-01 19:41:59 +0000
commitd4edf76ec16c63ad126712ffbe86d8ed63ab70eb (patch)
tree7cf7d0d2354aa5468a5cb37699a61918e98a6ed5 /src/game-server
parentf07dbf97c27aef7630782052ba6021359294cd86 (diff)
downloadmanaserv-d4edf76ec16c63ad126712ffbe86d8ed63ab70eb.tar.gz
manaserv-d4edf76ec16c63ad126712ffbe86d8ed63ab70eb.tar.bz2
manaserv-d4edf76ec16c63ad126712ffbe86d8ed63ab70eb.tar.xz
manaserv-d4edf76ec16c63ad126712ffbe86d8ed63ab70eb.zip
Made character data persistent across logout/login.
Diffstat (limited to 'src/game-server')
-rw-r--r--src/game-server/accountconnection.cpp1
-rw-r--r--src/game-server/character.cpp6
2 files changed, 5 insertions, 2 deletions
diff --git a/src/game-server/accountconnection.cpp b/src/game-server/accountconnection.cpp
index de1ec618..fa097921 100644
--- a/src/game-server/accountconnection.cpp
+++ b/src/game-server/accountconnection.cpp
@@ -60,6 +60,7 @@ bool AccountConnection::start()
void AccountConnection::sendCharacterData(Character *p)
{
MessageOut msg(GAMSG_PLAYER_DATA);
+ msg.writeLong(p->getDatabaseID());
serializeCharacterData(*p, msg);
send(msg);
}
diff --git a/src/game-server/character.cpp b/src/game-server/character.cpp
index b9613c1f..4d04c227 100644
--- a/src/game-server/character.cpp
+++ b/src/game-server/character.cpp
@@ -32,13 +32,15 @@ Character::Character(MessageIn & msg):
Being(OBJECT_CHARACTER, 65535),
mClient(NULL),
mAttributesChanged(true),
- mDatabaseID(-1), mName(""), mGender(0), mHairStyle(0), mHairColor(0),
+ mDatabaseID(-1), mName(), mGender(0), mHairStyle(0), mHairColor(0),
mLevel(0), mMoney(0)
{
// prepare attributes vector
mAttributes.resize(NB_ATTRIBUTES_CHAR, 1);
mOldAttributes.resize(NB_ATTRIBUTES_CHAR, 0);
- // get base attributes
+ // get character data
+ mDatabaseID = msg.readLong();
+ mName = msg.readString();
deserializeCharacterData(*this, msg);
// give the player 10 weapon skill for testing purpose
setAttribute(CHAR_SKILL_WEAPON_UNARMED, 10);