diff options
Diffstat (limited to 'src/serialize/characterdata.hpp')
-rw-r--r-- | src/serialize/characterdata.hpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/serialize/characterdata.hpp b/src/serialize/characterdata.hpp index 7d3a7fc1..b1ef19e7 100644 --- a/src/serialize/characterdata.hpp +++ b/src/serialize/characterdata.hpp @@ -36,13 +36,21 @@ void serializeCharacterData(T const &data, MessageOut &msg) msg.writeByte(data.getGender()); msg.writeByte(data.getHairStyle()); msg.writeByte(data.getHairColor()); - msg.writeByte(data.getLevel()); + msg.writeShort(data.getLevel()); + msg.writeShort(data.getCharacterPoints()); + msg.writeShort(data.getCorrectionPoints()); for (int i = CHAR_ATTR_BEGIN; i < CHAR_ATTR_END; ++i) { msg.writeByte(data.getAttribute(i)); } + for (int i = 0; i < CHAR_SKILL_NB; ++i) + { + msg.writeLong(data.getExperience(i)); + } + + msg.writeShort(data.getMapId()); Point const &pos = data.getPosition(); msg.writeShort(pos.x); @@ -69,13 +77,20 @@ void deserializeCharacterData(T &data, MessageIn &msg) data.setGender(msg.readByte()); data.setHairStyle(msg.readByte()); data.setHairColor(msg.readByte()); - data.setLevel(msg.readByte()); + data.setLevel(msg.readShort()); + data.setCharacterPoints(msg.readShort()); + data.setCorrectionPoints(msg.readShort()); for (int i = CHAR_ATTR_BEGIN; i < CHAR_ATTR_END; ++i) { data.setAttribute(i, msg.readByte()); } + for (int i = 0; i < CHAR_SKILL_NB; ++i) + { + data.setExperience(i, msg.readLong()); + } + data.setMapId(msg.readShort()); Point temporaryPoint; |