diff options
author | Eugenio Favalli <elvenprogrammer@gmail.com> | 2006-07-25 18:04:38 +0000 |
---|---|---|
committer | Eugenio Favalli <elvenprogrammer@gmail.com> | 2006-07-25 18:04:38 +0000 |
commit | c7e7b62aa94bf295ca1dc556762ad6070221e0cd (patch) | |
tree | 04f827df0df64a80e04a4115986609486d715237 /src/net/equipmenthandler.cpp | |
parent | c0c8775271679ac4904bc0bc02a74d28fc75efd0 (diff) | |
download | mana-c7e7b62aa94bf295ca1dc556762ad6070221e0cd.tar.gz mana-c7e7b62aa94bf295ca1dc556762ad6070221e0cd.tar.bz2 mana-c7e7b62aa94bf295ca1dc556762ad6070221e0cd.tar.xz mana-c7e7b62aa94bf295ca1dc556762ad6070221e0cd.zip |
Switched client to use enet and modified login sequence to work with the new protocol from tmwserv.
Diffstat (limited to 'src/net/equipmenthandler.cpp')
-rw-r--r-- | src/net/equipmenthandler.cpp | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/src/net/equipmenthandler.cpp b/src/net/equipmenthandler.cpp index 01760eeb..aa372961 100644 --- a/src/net/equipmenthandler.cpp +++ b/src/net/equipmenthandler.cpp @@ -60,20 +60,19 @@ void EquipmentHandler::handleMessage(MessageIn *msg) switch (msg->getId()) { case SMSG_PLAYER_EQUIPMENT: - msg->readInt16(); // length + msg->readShort(); // length itemCount = (msg->getLength() - 4) / 20; for (int loop = 0; loop < itemCount; loop++) { - index = msg->readInt16(); - itemId = msg->readInt16(); - msg->readInt8(); // type - msg->readInt8(); // identify flag - msg->readInt16(); // equip type - equipPoint = msg->readInt16(); - msg->readInt8(); // attribute - msg->readInt8(); // refine - msg->skip(8); // card + index = msg->readShort(); + itemId = msg->readShort(); + msg->readByte(); // type + msg->readByte(); // identify flag + msg->readShort(); // equip type + equipPoint = msg->readShort(); + msg->readByte(); // attribute + msg->readByte(); // refine player_node->addInvItem(index, itemId, 1, true); @@ -93,9 +92,9 @@ void EquipmentHandler::handleMessage(MessageIn *msg) break; case SMSG_PLAYER_EQUIP: - index = msg->readInt16(); - equipPoint = msg->readInt16(); - type = msg->readInt8(); + index = msg->readShort(); + equipPoint = msg->readShort(); + type = msg->readByte(); logger->log("Equipping: %i %i %i", index, equipPoint, type); @@ -129,10 +128,10 @@ void EquipmentHandler::handleMessage(MessageIn *msg) case 0x01d7: // Equipment related - being = beingManager->findBeing(msg->readInt32()); - msg->readInt8(); // equip point - itemId = msg->readInt16(); - msg->readInt16(); // item id 2 + being = beingManager->findBeing(msg->readLong()); + msg->readByte(); // equip point + itemId = msg->readShort(); + msg->readShort(); // item id 2 if (!being) break; @@ -141,9 +140,9 @@ void EquipmentHandler::handleMessage(MessageIn *msg) break; case SMSG_PLAYER_UNEQUIP: - index = msg->readInt16(); - equipPoint = msg->readInt16(); - type = msg->readInt8(); + index = msg->readShort(); + equipPoint = msg->readShort(); + type = msg->readByte(); if (!type) { chatWindow->chatLog("Unable to unequip.", BY_SERVER); @@ -193,7 +192,7 @@ void EquipmentHandler::handleMessage(MessageIn *msg) break; case SMSG_PLAYER_ARROW_EQUIP: - itemId = msg->readInt16(); + itemId = msg->readShort(); if (itemId <= 1) break; |