diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/account-server/accounthandler.cpp | 23 | ||||
-rw-r--r-- | src/common/manaserv_protocol.h | 5 |
2 files changed, 19 insertions, 9 deletions
diff --git a/src/account-server/accounthandler.cpp b/src/account-server/accounthandler.cpp index 9271c0ab..90d1092f 100644 --- a/src/account-server/accounthandler.cpp +++ b/src/account-server/accounthandler.cpp @@ -283,15 +283,24 @@ void AccountHandler::sendCharacterData(AccountClient &client, charInfo.writeInt16(ch.getAttributePoints()); charInfo.writeInt16(ch.getCorrectionPoints()); - for (AttributeMap::const_iterator it = ch.mAttributes.begin(), - it_end = ch.mAttributes.end(); - it != it_end; - ++it) + auto &possessions = ch.getPossessions(); + auto &equipData = possessions.getEquipment(); + auto &inventoryData = possessions.getInventory(); + charInfo.writeInt8(equipData.size()); + + for (int itemSlot : equipData) + { + const auto &it = inventoryData.find(itemSlot); + charInfo.writeInt16(itemSlot); + charInfo.writeInt16(it->second.itemId); + } + + for (auto &it : ch.getAttributes()) { // {id, base value in 256ths, modified value in 256ths }* - charInfo.writeInt32(it->first); - charInfo.writeInt32((int) (it->second.base * 256)); - charInfo.writeInt32((int) (it->second.modified * 256)); + charInfo.writeInt32(it.first); + charInfo.writeInt32((int) (it.second.base * 256)); + charInfo.writeInt32((int) (it.second.modified * 256)); } client.send(charInfo); diff --git a/src/common/manaserv_protocol.h b/src/common/manaserv_protocol.h index b34a99ec..86f6196c 100644 --- a/src/common/manaserv_protocol.h +++ b/src/common/manaserv_protocol.h @@ -29,7 +29,7 @@ namespace ManaServ { enum { - PROTOCOL_VERSION = 7, + PROTOCOL_VERSION = 8, SUPPORTED_DB_VERSION = 25 }; @@ -83,7 +83,8 @@ enum { PAMSG_CHAR_DELETE = 0x0022, // B slot APMSG_CHAR_DELETE_RESPONSE = 0x0023, // B error // B slot, S name, B gender, B hair style, B hair color, - // W character points, W correction points, + // W character points, W correction points, B amount of items equipped, + // { W slot, W itemId }* // {D attr id, D base value (in 1/256ths) D mod value (in 256ths) }* APMSG_CHAR_INFO = 0x0024, // ^ PAMSG_CHAR_SELECT = 0x0026, // B slot |