summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-04-01 19:07:21 +0300
committerAndrei Karas <akaras@inbox.ru>2016-04-01 19:30:21 +0300
commit5f4a9b697438f38629a9839105e7a284b39e0cde (patch)
tree17fddc69ab0021d41d436b3434e49842348da237 /src/net
parent5279e8de2799308ad6365562d812f6f23946dc80 (diff)
downloadmanaverse-5f4a9b697438f38629a9839105e7a284b39e0cde.tar.gz
manaverse-5f4a9b697438f38629a9839105e7a284b39e0cde.tar.bz2
manaverse-5f4a9b697438f38629a9839105e7a284b39e0cde.tar.xz
manaverse-5f4a9b697438f38629a9839105e7a284b39e0cde.zip
Sort more packets. Add version checks inside packets.
Diffstat (limited to 'src/net')
-rw-r--r--src/net/eathena/cashshoprecv.cpp11
-rw-r--r--src/net/eathena/packetsin.inc6
2 files changed, 12 insertions, 5 deletions
diff --git a/src/net/eathena/cashshoprecv.cpp b/src/net/eathena/cashshoprecv.cpp
index b427fd5df..0e868cda3 100644
--- a/src/net/eathena/cashshoprecv.cpp
+++ b/src/net/eathena/cashshoprecv.cpp
@@ -30,6 +30,8 @@
#include "debug.h"
+extern int packetVersion;
+
namespace EAthena
{
@@ -40,13 +42,18 @@ namespace CashShopRecv
void CashShopRecv::processCashShopOpen(Net::MessageIn &msg)
{
- const int count = (msg.readInt16("len") - 12) / 11;
+ int count;
+ if (packetVersion >= 20070711)
+ count = (msg.readInt16("len") - 12) / 11;
+ else
+ count = (msg.readInt16("len") - 8) / 11;
CREATEWIDGETV(mBuyDialog, BuyDialog, fromInt(BuyDialog::Cash, BeingId));
mBuyDialog->setMoney(PlayerInfo::getAttribute(Attributes::MONEY));
msg.readInt32("cash points");
- msg.readInt32("kafra points");
+ if (packetVersion >= 20070711)
+ msg.readInt32("kafra points");
for (int f = 0; f < count; f ++)
{
msg.readInt32("price");
diff --git a/src/net/eathena/packetsin.inc b/src/net/eathena/packetsin.inc
index 5d4b43e7c..deab761cf 100644
--- a/src/net/eathena/packetsin.inc
+++ b/src/net/eathena/packetsin.inc
@@ -88,6 +88,7 @@ if (packetVersion >= 20060424)
{
packet(SMSG_MAP_ACCOUNT_ID, 0x0283, 6, &GameRecv::processMapAccountId, 20060424);
packet(SMSG_BEING_SPECIAL_EFFECT_NUM, 0x0284, 14, &BeingRecv::processBeingSpecialEffectNum, 20060424);
+ packet(SMSG_NPC_CASH_SHOP_OPEN, 0x0287, -1, &CashShopRecv::processCashShopOpen, 20060424);
packet(SMSG_NPC_CASH_BUY_ACK, 0x0289, 8, &CashShopRecv::processCashShopBuyAck, 20060424);
packet(SMSG_FORMAT_MESSAGE, 0x0291, 4, &ChatRecv::processFormatMessage, 20060424);
packet(SMSG_BOSS_MAP_INFO, 0x0293, 70, &BeingRecv::processBossMapInfo, 20060424);
@@ -351,11 +352,10 @@ packet(SMSG_NPC_BUY, 0x00c6, -1, &BuySellRecv::processNpc
packet(SMSG_NPC_BUY_RESPONSE, 0x00ca, 3, &Ea::BuySellRecv::processNpcBuyResponse, 0);
packet(SMSG_NPC_BUY_SELL_CHOICE, 0x00c4, 6, &Ea::BuySellRecv::processNpcBuySellChoice, 0);
packet(SMSG_NPC_CASH_BUY, 0x0849, 16, &CashShopRecv::processCashShopBuy, 0);
-
-// 20150000 or near
packet(SMSG_NPC_CASH_POINTS, 0x0845, 10, &CashShopRecv::processCashShopPoints, 0);
packet(SMSG_NPC_CASH_SCHEDULE, 0x08ca, -1, &CashShopRecv::processCashShopSchedule, 0);
-packet(SMSG_NPC_CASH_SHOP_OPEN, 0x0287, -1, &CashShopRecv::processCashShopOpen, 0);
+
+// 20150000 or near
packet(SMSG_NPC_CASH_TAB_PRICE_LIST, 0x08c0, -1, &CashShopRecv::processCashShopTabPriceList, 0);
packet(SMSG_NPC_CHOICE, 0x00b7, -1, &Ea::NpcRecv::processNpcChoice, 0);
packet(SMSG_NPC_CLOSE, 0x00b6, 6, &Ea::NpcRecv::processNpcClose, 0);