summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-09-26 21:39:01 +0300
committerAndrei Karas <akaras@inbox.ru>2018-09-26 21:39:01 +0300
commit0779cc7854ac04b87aecc3d4bc64f2a9f12833c8 (patch)
treedcca99413f93f69747ccbc998920a557fcd0a4d9 /src
parentfa5c9c6958c8d499678ea9bab24eb4715b824f6e (diff)
downloadplus-0779cc7854ac04b87aecc3d4bc64f2a9f12833c8.tar.gz
plus-0779cc7854ac04b87aecc3d4bc64f2a9f12833c8.tar.bz2
plus-0779cc7854ac04b87aecc3d4bc64f2a9f12833c8.tar.xz
plus-0779cc7854ac04b87aecc3d4bc64f2a9f12833c8.zip
Add packet SMSG_PLAYER_COMBINED_INVENTORY 0x0b09.
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt2
-rw-r--r--src/Makefile.am2
-rw-r--r--src/enums/net/netinventorytype.h (renamed from src/enums/net/inventorytype.h)10
-rw-r--r--src/net/eathena/inventoryrecv.cpp42
-rw-r--r--src/net/eathena/inventoryrecv.h7
-rw-r--r--src/net/eathena/packetsin.inc3
6 files changed, 59 insertions, 7 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 2a002c192..e3be548f9 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -574,7 +574,7 @@ SET(SRCS
enums/net/battlegroundtype.h
enums/net/deleteitemreason.h
enums/net/downloadstatus.h
- enums/net/inventorytype.h
+ enums/net/netinventorytype.h
enums/net/mailmessagetype.h
enums/net/mailopentype.h
enums/net/npcaction.h
diff --git a/src/Makefile.am b/src/Makefile.am
index 7ffdd108b..1dff63e68 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -441,7 +441,7 @@ BASE_SRC += client.h \
enums/net/battlegroundtype.h \
enums/net/deleteitemreason.h \
enums/net/downloadstatus.h \
- enums/net/inventorytype.h \
+ enums/net/netinventorytype.h \
enums/net/mailmessagetype.h \
enums/net/mailopentype.h \
enums/net/npcaction.h \
diff --git a/src/enums/net/inventorytype.h b/src/enums/net/netinventorytype.h
index 1e15f6efc..f1c791509 100644
--- a/src/enums/net/inventorytype.h
+++ b/src/enums/net/netinventorytype.h
@@ -18,18 +18,18 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef ENUMS_NET_INVENTORYTYPE_H
-#define ENUMS_NET_INVENTORYTYPE_H
+#ifndef ENUMS_NET_NETINVENTORYTYPE_H
+#define ENUMS_NET_NETINVENTORYTYPE_H
#include "enums/simpletypes/enumdefines.h"
-enumStart(InventoryType)
+enumStart(NetInventoryType)
{
Inventory = 0,
Cart = 1,
Storage = 2,
GuildStorage = 3
}
-enumEnd(InventoryType);
+enumEnd(NetInventoryType);
-#endif // ENUMS_NET_INVENTORYTYPE_H
+#endif // ENUMS_NET_NETINVENTORYTYPE_H
diff --git a/src/net/eathena/inventoryrecv.cpp b/src/net/eathena/inventoryrecv.cpp
index 358aa2234..2ca1f11c8 100644
--- a/src/net/eathena/inventoryrecv.cpp
+++ b/src/net/eathena/inventoryrecv.cpp
@@ -1547,4 +1547,46 @@ void InventoryRecv::processInventoryEnd2(Net::MessageIn &msg)
msg.readUInt8("flag");
}
+void InventoryRecv::processPlayerCombinedInventory1(Net::MessageIn &msg)
+{
+ UNIMPLEMENTEDPACKET;
+ const int dataLen = msg.readInt32("len") - 4;
+ processInventoryContinue(msg,
+ dataLen,
+ NetInventoryType::Storage);
+}
+
+void InventoryRecv::processPlayerCombinedInventory2(Net::MessageIn &msg)
+{
+ UNIMPLEMENTEDPACKET;
+ const int dataLen = msg.readInt32("len") - 5;
+ const NetInventoryTypeT invType = static_cast<NetInventoryTypeT>(
+ msg.readUInt8("type"));
+ processInventoryContinue(msg,
+ dataLen,
+ invType);
+}
+
+void InventoryRecv::processInventoryContinue(Net::MessageIn &msg,
+ const int len,
+ const NetInventoryTypeT invType
+ A_UNUSED)
+{
+ const int packetLen = 14 + itemIdLen * 5;
+ const int number = len / packetLen;
+
+ for (int loop = 0; loop < number; loop++)
+ {
+ msg.readInt16("item index");
+ msg.readItemId("item id");
+ msg.readUInt8("item type");
+ msg.readInt16("amount");
+ msg.readInt32("wear state / equip");
+ for (int f = 0; f < maxCards; f++)
+ msg.readItemId("card");
+ msg.readInt32("hire expire date");
+ msg.readUInt8("flags");
+ }
+}
+
} // namespace EAthena
diff --git a/src/net/eathena/inventoryrecv.h b/src/net/eathena/inventoryrecv.h
index 9e4c3ce03..37e52a8fe 100644
--- a/src/net/eathena/inventoryrecv.h
+++ b/src/net/eathena/inventoryrecv.h
@@ -25,6 +25,8 @@
#include "net/ea/inventoryitem.h"
+#include "enums/net/netinventorytype.h"
+
namespace Net
{
class MessageIn;
@@ -81,8 +83,13 @@ namespace EAthena
void processInventoryStart3(Net::MessageIn &msg);
void processInventoryEnd1(Net::MessageIn &msg);
void processInventoryEnd2(Net::MessageIn &msg);
+ void processPlayerCombinedInventory1(Net::MessageIn &msg);
+ void processPlayerCombinedInventory2(Net::MessageIn &msg);
int getSlot(const int eAthenaSlot) A_WARN_UNUSED;
+ void processInventoryContinue(Net::MessageIn &msg,
+ const int len,
+ const NetInventoryTypeT invType);
} // namespace InventoryRecv
} // namespace EAthena
diff --git a/src/net/eathena/packetsin.inc b/src/net/eathena/packetsin.inc
index aef5536f6..e8901a7b1 100644
--- a/src/net/eathena/packetsin.inc
+++ b/src/net/eathena/packetsin.inc
@@ -1310,6 +1310,7 @@ if (packetVersionRe >= 20180829)
{
packet(SMSG_INVENTORY_START1, 0x0b08, 26, &InventoryRecv::processInventoryStart1, 20180829);
packet(SMSG_INVENTORY_END1, 0x0b0b, 3, &InventoryRecv::processInventoryEnd1, 20180829);
+ packet(SMSG_PLAYER_COMBINED_INVENTORY1, 0x0b09, -1, &InventoryRecv::processPlayerCombinedInventory1, 20180829);
}
// 20180912 re
@@ -1317,6 +1318,7 @@ if (packetVersionRe >= 20180912)
{
packet(SMSG_INVENTORY_START2, 0x0b08, 27, &InventoryRecv::processInventoryStart2, 20180912);
packet(SMSG_INVENTORY_END2, 0x0b0b, 4, &InventoryRecv::processInventoryEnd2, 20180912);
+ packet(SMSG_PLAYER_COMBINED_INVENTORY2, 0x0b09, -1, &InventoryRecv::processPlayerCombinedInventory2, 20180912);
}
// 20180919 re
@@ -1330,6 +1332,7 @@ if (packetVersionZero >= 20180919)
{
packet(SMSG_INVENTORY_START3, 0x0b08, -1, &InventoryRecv::processInventoryStart3, 20180919);
packet(SMSG_INVENTORY_END2, 0x0b0b, 4, &InventoryRecv::processInventoryEnd2, 20180919);
+ packet(SMSG_PLAYER_COMBINED_INVENTORY2, 0x0b09, -1, &InventoryRecv::processPlayerCombinedInventory2, 20180919);
}
// 0