From 23b35de445d6af7d6e00576f4fbdfa1d15ba37df Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 11 Sep 2014 16:00:32 +0300 Subject: eathena: add partial support for packet SMSG_PET_MESSAGE 0x01aa. --- src/net/eathena/pethandler.cpp | 18 +++++++++++++++++- src/net/eathena/pethandler.h | 2 ++ src/net/eathena/protocol.h | 2 ++ 3 files changed, 21 insertions(+), 1 deletion(-) (limited to 'src/net/eathena') diff --git a/src/net/eathena/pethandler.cpp b/src/net/eathena/pethandler.cpp index 9d6772006..60ec03cd2 100644 --- a/src/net/eathena/pethandler.cpp +++ b/src/net/eathena/pethandler.cpp @@ -41,15 +41,25 @@ PetHandler::PetHandler() : { static const uint16_t _messages[] = { + SMSG_PET_MESSAGE, 0 }; handledMessages = _messages; petHandler = this; } -void PetHandler::handleMessage(Net::MessageIn &msg A_UNUSED) +void PetHandler::handleMessage(Net::MessageIn &msg) { BLOCK_START("PetHandler::handleMessage") + switch (msg.getId()) + { + case SMSG_PET_MESSAGE: + processPetMessage(msg); + break; + + default: + break; + } BLOCK_END("PetHandler::handleMessage") } @@ -91,4 +101,10 @@ void PetHandler::requestPetState(const int data) const outMsg.writeInt32(data, "param"); } +void PetHandler::processPetMessage(Net::MessageIn &msg) +{ + msg.readInt32("pet id"); + msg.readInt32("param"); +} + } // namespace EAthena diff --git a/src/net/eathena/pethandler.h b/src/net/eathena/pethandler.h index af3e1d918..f08ce43fa 100644 --- a/src/net/eathena/pethandler.h +++ b/src/net/eathena/pethandler.h @@ -53,6 +53,8 @@ class PetHandler final : public MessageHandler, public Net::PetHandler void requestPetState(const int data) const override final; + void processPetMessage(Net::MessageIn &msg); + protected: int mRandCounter; }; diff --git a/src/net/eathena/protocol.h b/src/net/eathena/protocol.h index 3e806f76d..fc9e9a2f0 100644 --- a/src/net/eathena/protocol.h +++ b/src/net/eathena/protocol.h @@ -204,6 +204,8 @@ #define SMSG_MAIL_OPEN_WINDOW 0x0260 +#define SMSG_PET_MESSAGE 0x01aa + /********************************** * Packets from client to server * **********************************/ -- cgit v1.2.3-70-g09d2