summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-01-07 13:45:06 +0300
committerAndrei Karas <akaras@inbox.ru>2015-01-07 13:45:06 +0300
commitc8f7c0f5b8acdf1b1ecf48501f9468c378486d8c (patch)
tree1180b3da0109ed024f2fb2ce86d202801bc4a008 /src
parentd73c56f5d0495ffc2758b8057207d304c827dc3e (diff)
downloadplus-c8f7c0f5b8acdf1b1ecf48501f9468c378486d8c.tar.gz
plus-c8f7c0f5b8acdf1b1ecf48501f9468c378486d8c.tar.bz2
plus-c8f7c0f5b8acdf1b1ecf48501f9468c378486d8c.tar.xz
plus-c8f7c0f5b8acdf1b1ecf48501f9468c378486d8c.zip
eathena: add partial support for packet SMSG_VENDING_OPEN 0x0136.
Diffstat (limited to 'src')
-rw-r--r--src/net/eathena/protocol.h1
-rw-r--r--src/net/eathena/vendinghandler.cpp26
-rw-r--r--src/net/eathena/vendinghandler.h2
3 files changed, 29 insertions, 0 deletions
diff --git a/src/net/eathena/protocol.h b/src/net/eathena/protocol.h
index 33a5322fe..516358fb7 100644
--- a/src/net/eathena/protocol.h
+++ b/src/net/eathena/protocol.h
@@ -311,6 +311,7 @@
#define SMSG_VENDING_HIDE_BOARD 0x0132
#define SMSG_VENDING_ITEMS_LIST 0x0800
#define SMSG_VENDING_BUY_ACK 0x0135
+#define SMSG_VENDING_OPEN 0x0136
#define SMSG_ELEMENTAL_UPDATE_STATUS 0x081e
#define SMSG_ELEMENTAL_INFO 0x081d
diff --git a/src/net/eathena/vendinghandler.cpp b/src/net/eathena/vendinghandler.cpp
index e342ccea8..8f02e4f72 100644
--- a/src/net/eathena/vendinghandler.cpp
+++ b/src/net/eathena/vendinghandler.cpp
@@ -39,6 +39,7 @@ VendingHandler::VendingHandler() :
SMSG_VENDING_HIDE_BOARD,
SMSG_VENDING_ITEMS_LIST,
SMSG_VENDING_BUY_ACK,
+ SMSG_VENDING_OPEN,
0
};
handledMessages = _messages;
@@ -69,6 +70,10 @@ void VendingHandler::handleMessage(Net::MessageIn &msg)
processBuyAck(msg);
break;
+ case SMSG_VENDING_OPEN:
+ processOpen(msg);
+ break;
+
default:
break;
}
@@ -105,6 +110,8 @@ void VendingHandler::processItemsList(Net::MessageIn &msg)
msg.readUInt8("identify");
msg.readUInt8("attribute");
msg.readUInt8("refine");
+ for (int d = 0; d < 4; d ++)
+ msg.readInt16("card");
}
}
@@ -115,4 +122,23 @@ void VendingHandler::processBuyAck(Net::MessageIn &msg)
msg.readUInt8("flag");
}
+void VendingHandler::processOpen(Net::MessageIn &msg)
+{
+ const int count = (msg.readInt16("len") - 8) / 22;
+ msg.readInt32("id");
+ for (int f = 0; f < count; f ++)
+ {
+ msg.readInt32("price");
+ msg.readInt16("inv index");
+ msg.readInt16("amount");
+ msg.readUInt8("item type");
+ msg.readInt16("item id");
+ msg.readUInt8("identify");
+ msg.readUInt8("attribute");
+ msg.readUInt8("refine");
+ for (int d = 0; d < 4; d ++)
+ msg.readInt16("card");
+ }
+}
+
} // namespace EAthena
diff --git a/src/net/eathena/vendinghandler.h b/src/net/eathena/vendinghandler.h
index a5b17d5fb..d29f355e1 100644
--- a/src/net/eathena/vendinghandler.h
+++ b/src/net/eathena/vendinghandler.h
@@ -47,6 +47,8 @@ class VendingHandler final : public MessageHandler,
static void processItemsList(Net::MessageIn &msg);
static void processBuyAck(Net::MessageIn &msg);
+
+ static void processOpen(Net::MessageIn &msg);
};
} // namespace EAthena