diff options
author | Philipp Sehmisch <crush@themanaworld.org> | 2009-07-03 22:17:18 +0200 |
---|---|---|
committer | Philipp Sehmisch <crush@themanaworld.org> | 2009-07-03 22:28:02 +0200 |
commit | 346d68307553c18777df4c49f9b3fe57955c5c0d (patch) | |
tree | d27d3fff4f5a366f597ae83d3fb62e2dbd4d69bf /src/net | |
parent | e0de8a124bf94b79d9d64e5406b21e8598a05d56 (diff) | |
download | mana-346d68307553c18777df4c49f9b3fe57955c5c0d.tar.gz mana-346d68307553c18777df4c49f9b3fe57955c5c0d.tar.bz2 mana-346d68307553c18777df4c49f9b3fe57955c5c0d.tar.xz mana-346d68307553c18777df4c49f9b3fe57955c5c0d.zip |
Implemented display of spell recharge information from server in the magic gui (very, very hackish)
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 69a2bdb4..bbc73b7c 100644 --- a/src/net/tmwserv/playerhandler.cpp +++ b/src/net/tmwserv/playerhandler.cpp @@ -106,6 +106,7 @@ PlayerHandler::PlayerHandler() GPMSG_LEVEL_PROGRESS, GPMSG_RAISE_ATTRIBUTE_RESPONSE, GPMSG_LOWER_ATTRIBUTE_RESPONSE, + GPMSG_SPECIAL_STATUS, 0 }; handledMessages = _messages; @@ -277,6 +278,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 e9fc5b8a..2f1ea885 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 [, C position, B speed] [, W*2 destination] }* 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 }* |