diff options
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/tmwserv/inventoryhandler.cpp | 6 | ||||
-rw-r--r-- | src/net/tmwserv/playerhandler.cpp | 14 | ||||
-rw-r--r-- | src/net/tmwserv/protocol.h | 3 |
3 files changed, 21 insertions, 2 deletions
diff --git a/src/net/tmwserv/inventoryhandler.cpp b/src/net/tmwserv/inventoryhandler.cpp index 8110fdd2..6993167c 100644 --- a/src/net/tmwserv/inventoryhandler.cpp +++ b/src/net/tmwserv/inventoryhandler.cpp @@ -40,6 +40,8 @@ #include "resources/iteminfo.h" +#include "log.h" // <<< REMOVE ME! + Net::InventoryHandler *inventoryHandler; namespace TmwServ { @@ -102,7 +104,9 @@ void InventoryHandler::unequipItem(const Item *item) Net::GameServer::connection->send(msg); // Tidy equipment directly to avoid weapon still shown bug, for instance - player_node->mEquipment->setEquipment(item->getInvIndex(), 0); + int equipSlot = item->getInvIndex(); + logger->log("Unequipping %d", equipSlot); + player_node->mEquipment->setEquipment(equipSlot, 0); } void InventoryHandler::useItem(const Item *item) diff --git a/src/net/tmwserv/playerhandler.cpp b/src/net/tmwserv/playerhandler.cpp index 656befdf..ce1990ed 100644 --- a/src/net/tmwserv/playerhandler.cpp +++ b/src/net/tmwserv/playerhandler.cpp @@ -105,6 +105,7 @@ PlayerHandler::PlayerHandler() GPMSG_LEVEL_PROGRESS, GPMSG_RAISE_ATTRIBUTE_RESPONSE, GPMSG_LOWER_ATTRIBUTE_RESPONSE, + GPMSG_SPECIAL_STATUS, 0 }; handledMessages = _messages; @@ -255,6 +256,19 @@ void PlayerHandler::handleMessage(MessageIn &msg) } } break; + + case GPMSG_SPECIAL_STATUS : + { + while (msg.getUnreadLength()) + { + // { B specialID, L current, L max, L recharge } + int id = msg.readInt8(); + int current = msg.readInt32(); + int max = msg.readInt32(); + int recharge = msg.readInt32(); + player_node->setSpecialStatus(id, current, max, recharge); + } + } break; /* case SMSG_PLAYER_ARROW_MESSAGE: { diff --git a/src/net/tmwserv/protocol.h b/src/net/tmwserv/protocol.h index 90ff2437..60a50d89 100644 --- a/src/net/tmwserv/protocol.h +++ b/src/net/tmwserv/protocol.h @@ -107,8 +107,9 @@ enum { GPMSG_BEINGS_MOVE = 0x0280, // { W being id, B flags [, W*2 position, B speed] }* GPMSG_ITEMS = 0x0281, // { W item id, W*2 position }* PGMSG_ATTACK = 0x0290, // W being id - PGMSG_USE_SPECIAL = 0x0292, // B specialID GPMSG_BEING_ATTACK = 0x0291, // W being id + PGMSG_USE_SPECIAL = 0x0292, // B specialID + GPMSG_SPECIAL_STATUS = 0x0293, // { B specialID, L current, L max, L recharge } PGMSG_SAY = 0x02A0, // S text GPMSG_SAY = 0x02A1, // W being id, S text GPMSG_NPC_CHOICE = 0x02B0, // W being id, { S text }* |