summaryrefslogtreecommitdiff
path: root/src/net/eathena/pethandler.cpp
diff options
context:
space:
mode:
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