summaryrefslogtreecommitdiff
path: root/src/net/eathena/pethandler.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-09-17 23:04:38 +0300
committerAndrei Karas <akaras@inbox.ru>2014-09-17 23:04:38 +0300
commit45c7fa7d912504e25396320013baf388c419f908 (patch)
tree78e891ee5aefcf6f237dfdba019888f7b27c8b87 /src/net/eathena/pethandler.cpp
parent92d592dce023fc155d7956e5e80f170f23b456f6 (diff)
downloadmv-45c7fa7d912504e25396320013baf388c419f908.tar.gz
mv-45c7fa7d912504e25396320013baf388c419f908.tar.bz2
mv-45c7fa7d912504e25396320013baf388c419f908.tar.xz
mv-45c7fa7d912504e25396320013baf388c419f908.zip
eathena: add packet SMSG_PET_ROULETTE 0x01a0.
Diffstat (limited to 'src/net/eathena/pethandler.cpp')
-rw-r--r--src/net/eathena/pethandler.cpp26
1 files changed, 26 insertions, 0 deletions
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