From c7e7b62aa94bf295ca1dc556762ad6070221e0cd Mon Sep 17 00:00:00 2001 From: Eugenio Favalli Date: Tue, 25 Jul 2006 18:04:38 +0000 Subject: Switched client to use enet and modified login sequence to work with the new protocol from tmwserv. --- src/net/equipmenthandler.cpp | 41 ++++++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 21 deletions(-) (limited to 'src/net/equipmenthandler.cpp') 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; -- cgit v1.2.3-70-g09d2