From c277f3e829217cd7469a4a5c742ef617a57e8e3f Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 7 Oct 2014 17:00:44 +0300 Subject: eathena: add partial support for packet SMSG_FAMILY_CALL_PARTNER 0x01e6. Also rename family related packages. --- src/net/eathena/familyhandler.cpp | 18 ++++++++++++++---- src/net/eathena/familyhandler.h | 2 ++ src/net/eathena/protocol.h | 7 ++++--- 3 files changed, 20 insertions(+), 7 deletions(-) (limited to 'src/net') diff --git a/src/net/eathena/familyhandler.cpp b/src/net/eathena/familyhandler.cpp index b222977ff..d32ce8409 100644 --- a/src/net/eathena/familyhandler.cpp +++ b/src/net/eathena/familyhandler.cpp @@ -39,7 +39,8 @@ FamilyHandler::FamilyHandler() : { static const uint16_t _messages[] = { - SMSG_ASK_FOR_CHILD, + SMSG_FAMILY_ASK_FOR_CHILD, + SMSG_FAMILY_CALL_PARTNER, 0 }; handledMessages = _messages; @@ -50,10 +51,14 @@ void FamilyHandler::handleMessage(Net::MessageIn &msg) { switch (msg.getId()) { - case SMSG_ASK_FOR_CHILD: + case SMSG_FAMILY_ASK_FOR_CHILD: processAskForChild(msg); break; + case SMSG_FAMILY_CALL_PARTNER: + processCallPartner(msg); + break; + default: break; } @@ -64,7 +69,7 @@ void FamilyHandler::askForChild(const Being *const being) if (!being) return; - createOutPacket(CMSG_ASK_FOR_CHILD); + createOutPacket(CMSG_FAMILY_ASK_FOR_CHILD); outMsg.writeInt32(being->getId()); } @@ -75,9 +80,14 @@ void FamilyHandler::processAskForChild(Net::MessageIn &msg) msg.readString(24, "name who ask"); } +void FamilyHandler::processCallPartner(Net::MessageIn &msg) +{ + msg.readString(24, "name"); +} + void FamilyHandler::askForChildReply(const bool accept) { - createOutPacket(CMSG_ASK_FOR_CHILD_REPLY); + createOutPacket(CMSG_FAMILY_ASK_FOR_CHILD_REPLY); outMsg.writeInt32(mParent1, "parent1"); outMsg.writeInt32(mParent2, "parent2"); outMsg.writeInt32(accept ? 0: 1, "result"); diff --git a/src/net/eathena/familyhandler.h b/src/net/eathena/familyhandler.h index 365a129ba..90a6f4afa 100644 --- a/src/net/eathena/familyhandler.h +++ b/src/net/eathena/familyhandler.h @@ -44,6 +44,8 @@ class FamilyHandler final : public MessageHandler, protected: void processAskForChild(Net::MessageIn &msg); + void processCallPartner(Net::MessageIn &msg); + private: int mParent1; int mParent2; diff --git a/src/net/eathena/protocol.h b/src/net/eathena/protocol.h index eeaf14fcc..ae1bec131 100644 --- a/src/net/eathena/protocol.h +++ b/src/net/eathena/protocol.h @@ -235,7 +235,8 @@ #define SMSG_MAIL_OPEN_WINDOW 0x0260 -#define SMSG_ASK_FOR_CHILD 0x01f6 +#define SMSG_FAMILY_ASK_FOR_CHILD 0x01f6 +#define SMSG_FAMILY_CALL_PARTNER 0x01e6 #define SMSG_PET_MESSAGE 0x01aa #define SMSG_PET_ROULETTE 0x01a0 @@ -459,8 +460,8 @@ #define CMSG_MAIL_RESET_ATTACH 0x0246 #define CMSG_MAIL_SEND 0x0248 -#define CMSG_ASK_FOR_CHILD 0x01f9 -#define CMSG_ASK_FOR_CHILD_REPLY 0x01f7 +#define CMSG_FAMILY_ASK_FOR_CHILD 0x01f9 +#define CMSG_FAMILY_ASK_FOR_CHILD_REPLY 0x01f7 #define CMSG_BANK_DEPOSIT 0x09a7 #define CMSG_BANK_WITHDRAW 0x09a9 -- cgit v1.2.3-60-g2f50