summaryrefslogtreecommitdiff
path: root/src/net/eathena/vendinghandler.cpp
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/net/eathena/vendinghandler.cpp
parentd73c56f5d0495ffc2758b8057207d304c827dc3e (diff)
downloadManaVerse-c8f7c0f5b8acdf1b1ecf48501f9468c378486d8c.tar.gz
ManaVerse-c8f7c0f5b8acdf1b1ecf48501f9468c378486d8c.tar.bz2
ManaVerse-c8f7c0f5b8acdf1b1ecf48501f9468c378486d8c.tar.xz
ManaVerse-c8f7c0f5b8acdf1b1ecf48501f9468c378486d8c.zip
eathena: add partial support for packet SMSG_VENDING_OPEN 0x0136.
Diffstat (limited to 'src/net/eathena/vendinghandler.cpp')
-rw-r--r--src/net/eathena/vendinghandler.cpp26
1 files changed, 26 insertions, 0 deletions
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