summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-09-11 16:00:32 +0300
committerAndrei Karas <akaras@inbox.ru>2014-09-11 16:00:32 +0300
commit23b35de445d6af7d6e00576f4fbdfa1d15ba37df (patch)
treeca945d6ca28f63f59db68391dcacf6cfc5fc06d7 /src/net
parent4c4c2684278f84f952544d8e4f119ce9da980c1a (diff)
downloadplus-23b35de445d6af7d6e00576f4fbdfa1d15ba37df.tar.gz
plus-23b35de445d6af7d6e00576f4fbdfa1d15ba37df.tar.bz2
plus-23b35de445d6af7d6e00576f4fbdfa1d15ba37df.tar.xz
plus-23b35de445d6af7d6e00576f4fbdfa1d15ba37df.zip
eathena: add partial support for packet SMSG_PET_MESSAGE 0x01aa.
Diffstat (limited to 'src/net')
-rw-r--r--src/net/eathena/pethandler.cpp18
-rw-r--r--src/net/eathena/pethandler.h2
-rw-r--r--src/net/eathena/protocol.h2
3 files changed, 21 insertions, 1 deletions
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 *
**********************************/