From 1f7122e76f28ec851ef7d9361396575dde381287 Mon Sep 17 00:00:00 2001
From: Andrei Karas <akaras@inbox.ru>
Date: Wed, 24 Dec 2014 15:22:18 +0300
Subject: eathena: add partial support for packet SMSG_NPC_CASH_BUY_ACK 0x0289.

---
 src/net/eathena/cashshophandler.cpp | 12 ++++++++++++
 src/net/eathena/cashshophandler.h   |  2 ++
 src/net/eathena/packets.h           |  2 +-
 src/net/eathena/protocol.h          |  1 +
 4 files changed, 16 insertions(+), 1 deletion(-)

(limited to 'src/net')

diff --git a/src/net/eathena/cashshophandler.cpp b/src/net/eathena/cashshophandler.cpp
index 56e7bac25..2ae0c67be 100644
--- a/src/net/eathena/cashshophandler.cpp
+++ b/src/net/eathena/cashshophandler.cpp
@@ -36,6 +36,7 @@ CashShopHandler::CashShopHandler() :
     static const uint16_t _messages[] =
     {
         SMSG_NPC_CASH_SHOP_OPEN,
+        SMSG_NPC_CASH_BUY_ACK,
         0
     };
     handledMessages = _messages;
@@ -50,6 +51,10 @@ void CashShopHandler::handleMessage(Net::MessageIn &msg)
             processCashShopOpen(msg);
             break;
 
+        case SMSG_NPC_CASH_BUY_ACK:
+            processCashShopBuyAck(msg);
+            break;
+
         default:
             break;
     }
@@ -69,6 +74,13 @@ void CashShopHandler::processCashShopOpen(Net::MessageIn &msg)
     }
 }
 
+void CashShopHandler::processCashShopBuyAck(Net::MessageIn &msg)
+{
+    msg.readInt32("cash points");
+    msg.readInt32("kafra points");
+    msg.readInt16("error");
+}
+
 void CashShopHandler::buy(const int points,
                           const int itemId,
                           const unsigned char color A_UNUSED,
diff --git a/src/net/eathena/cashshophandler.h b/src/net/eathena/cashshophandler.h
index fa781f74a..00f272d69 100644
--- a/src/net/eathena/cashshophandler.h
+++ b/src/net/eathena/cashshophandler.h
@@ -44,6 +44,8 @@ class CashShopHandler final : public MessageHandler,
 
     protected:
         static void processCashShopOpen(Net::MessageIn &msg);
+
+        static void processCashShopBuyAck(Net::MessageIn &msg);
 };
 
 }  // namespace EAthena
diff --git a/src/net/eathena/packets.h b/src/net/eathena/packets.h
index 336f1311c..8b88eeb8c 100644
--- a/src/net/eathena/packets.h
+++ b/src/net/eathena/packets.h
@@ -93,7 +93,7 @@ int16_t packet_lengths[] =
   6,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
 // #0x0280
-  0,   0,   0,   6,  14,   0,   0,  -1,   0,   0,  18,   0,   0,   0,   4,   0,
+  0,   0,   0,   6,  14,   0,   0,  -1,   0,  12,  18,   0,   0,   0,   4,   0,
   4,   4,   0,   0,   0,   0,   0,   0,   8,   6,   0,  80,   0,  -1,   0,   0,
   0,   0,   8,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
   0,  -1,  -1, 107,   6,  -1,   0,   7,  22, 191,   0,   0,   0,   0,   0,   0,
diff --git a/src/net/eathena/protocol.h b/src/net/eathena/protocol.h
index 53214e876..c7237187d 100644
--- a/src/net/eathena/protocol.h
+++ b/src/net/eathena/protocol.h
@@ -152,6 +152,7 @@
 #define SMSG_NPC_MARKET_OPEN         0x09d5
 #define SMSG_NPC_MARKET_BUY_ACK      0x09d7
 #define SMSG_NPC_CASH_SHOP_OPEN      0x0287
+#define SMSG_NPC_CASH_BUY_ACK        0x0289
 
 #define SMSG_PLAYER_CHAT             0x008e /**< Player talks */
 #define SMSG_WHISPER                 0x0097 /**< Whisper Recieved */
-- 
cgit v1.2.3-70-g09d2