From f08d73feaf8ff09b9a7eb3caceeea8e8b1f93ee6 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 24 Jan 2019 03:27:03 +0300 Subject: Add packet SMSG_INVENTORY_EXPANSION_INFO 0x0b18 --- src/defaults.cpp | 1 + src/net/eathena/inventoryrecv.cpp | 12 ++++++++++++ src/net/eathena/inventoryrecv.h | 1 + src/net/eathena/packetsin.inc | 18 ++++++++++++++++++ src/progs/manaplus/client.cpp | 1 + src/settings.h | 2 ++ 6 files changed, 35 insertions(+) (limited to 'src') diff --git a/src/defaults.cpp b/src/defaults.cpp index 3381d10bc..7b5190fe2 100644 --- a/src/defaults.cpp +++ b/src/defaults.cpp @@ -724,6 +724,7 @@ void setPathsDefaults(Configuration &cfg) AddDEF("overweightPercent", 50); AddDEF("playerNameOffset", 64); AddDEF("playerBadgeAtRightOffset", 32); + AddDEF("fixedInventorySize", 100); #ifdef TMWA_SUPPORT AddDEF("gmDefaultLevel", 60); diff --git a/src/net/eathena/inventoryrecv.cpp b/src/net/eathena/inventoryrecv.cpp index ddf4a5925..388a8fe10 100644 --- a/src/net/eathena/inventoryrecv.cpp +++ b/src/net/eathena/inventoryrecv.cpp @@ -1672,4 +1672,16 @@ void InventoryRecv::processShowItemPreview2(Net::MessageIn &msg) } } +void InventoryRecv::processInventoryExpansionInfo(Net::MessageIn &msg) +{ + UNIMPLEMENTEDPACKET; + const int newSize = msg.readInt16("expansion size") + + settings.fixedInventorySize; + Inventory *const inv = PlayerInfo::getInventory(); + if (inv != nullptr) + { + inv->resize(newSize); + } +} + } // namespace EAthena diff --git a/src/net/eathena/inventoryrecv.h b/src/net/eathena/inventoryrecv.h index 0c2cc98fe..72f6ffbe2 100644 --- a/src/net/eathena/inventoryrecv.h +++ b/src/net/eathena/inventoryrecv.h @@ -98,6 +98,7 @@ namespace EAthena A_UNUSED); void processShowItemPreview1(Net::MessageIn &msg); void processShowItemPreview2(Net::MessageIn &msg); + void processInventoryExpansionInfo(Net::MessageIn &msg); } // namespace InventoryRecv } // namespace EAthena diff --git a/src/net/eathena/packetsin.inc b/src/net/eathena/packetsin.inc index b85d5a901..b9dc5c645 100644 --- a/src/net/eathena/packetsin.inc +++ b/src/net/eathena/packetsin.inc @@ -1495,6 +1495,24 @@ if (packetVersionMain >= 20181128) packet(SMSG_PLAYER_SKILL_AUTO_SPELLS, 0x0afb, -1, &SkillRecv::processSkillAutoSpells2, 20181128); } +// 20181212 zero +if (packetVersionZero >= 20181212) +{ + packet(SMSG_INVENTORY_EXPANSION_INFO, 0x0b18, 4, &InventoryRecv::processInventoryExpansionInfo, 20181212); +} + +// 20181219 main +if (packetVersionMain >= 20181219) +{ + packet(SMSG_INVENTORY_EXPANSION_INFO, 0x0b18, 4, &InventoryRecv::processInventoryExpansionInfo, 20181219); +} + +// 20181219 re +if (packetVersionRe >= 20181219) +{ + packet(SMSG_INVENTORY_EXPANSION_INFO, 0x0b18, 4, &InventoryRecv::processInventoryExpansionInfo, 20181219); +} + // 0 // evol always packets packet(SMSG_SERVER_VERSION_RESPONSE, 0x7531, -1, &LoginRecv::processServerVersion, 0); diff --git a/src/progs/manaplus/client.cpp b/src/progs/manaplus/client.cpp index d393b15ba..439e3c94c 100644 --- a/src/progs/manaplus/client.cpp +++ b/src/progs/manaplus/client.cpp @@ -1804,6 +1804,7 @@ void Client::initPaths() if (settings.linkCommandSymbol.empty()) settings.linkCommandSymbol = "="; settings.overweightPercent = paths.getIntValue("overweightPercent"); + settings.fixedInventorySize = paths.getIntValue("fixedInventorySize"); settings.playerNameOffset = paths.getIntValue( "playerNameOffset"); settings.playerBadgeAtRightOffset = paths.getIntValue( diff --git a/src/settings.h b/src/settings.h index 70c2a323a..2e34780d9 100644 --- a/src/settings.h +++ b/src/settings.h @@ -78,6 +78,7 @@ class Settings final crazyMoveState(0U), targetingType(0U), overweightPercent(50U), + fixedInventorySize(100U), playerNameOffset(64), playerBadgeAtRightOffset(32), mapDrawType(MapType::NORMAL), @@ -143,6 +144,7 @@ class Settings final unsigned int crazyMoveState; unsigned int targetingType; unsigned int overweightPercent; + unsigned int fixedInventorySize; int playerNameOffset; int playerBadgeAtRightOffset; MapTypeT mapDrawType; -- cgit v1.2.3-70-g09d2