From 45c7fa7d912504e25396320013baf388c419f908 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 17 Sep 2014 23:04:38 +0300 Subject: eathena: add packet SMSG_PET_ROULETTE 0x01a0. --- src/net/eathena/pethandler.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'src/net/eathena/pethandler.cpp') diff --git a/src/net/eathena/pethandler.cpp b/src/net/eathena/pethandler.cpp index 1485c1de0..d801c422c 100644 --- a/src/net/eathena/pethandler.cpp +++ b/src/net/eathena/pethandler.cpp @@ -20,6 +20,8 @@ #include "net/eathena/pethandler.h" +#include "notifymanager.h" + #include "gui/chatconsts.h" #include "net/chathandler.h" @@ -28,6 +30,8 @@ #include "net/eathena/messageout.h" #include "net/eathena/protocol.h" +#include "resources/notifytypes.h" + #include "debug.h" extern Net::PetHandler *petHandler; @@ -42,6 +46,7 @@ PetHandler::PetHandler() : static const uint16_t _messages[] = { SMSG_PET_MESSAGE, + SMSG_PET_ROULETTE, 0 }; handledMessages = _messages; @@ -57,6 +62,10 @@ void PetHandler::handleMessage(Net::MessageIn &msg) processPetMessage(msg); break; + case SMSG_PET_ROULETTE: + processPetRoulette(msg); + break; + default: break; } @@ -113,4 +122,21 @@ void PetHandler::processPetMessage(Net::MessageIn &msg) msg.readInt32("param"); } +void PetHandler::processPetRoulette(Net::MessageIn &msg) +{ + const uint8_t data = msg.readUInt8("data"); + switch (data) + { + case 0: + NotifyManager::notify(NotifyTypes::PET_CATCH_FAILED); + break; + case 1: + NotifyManager::notify(NotifyTypes::PET_CATCH_SUCCESS); + break; + default: + NotifyManager::notify(NotifyTypes::PET_CATCH_UNKNOWN, data); + break; + } +} + } // namespace EAthena -- cgit v1.2.3-60-g2f50