From 94fbe6914592affed9a77c54299457c0bf6afd84 Mon Sep 17 00:00:00 2001 From: kokekanon <114332266+kokekanon@users.noreply.github.com> Date: Thu, 8 Aug 2024 23:48:31 -0400 Subject: [PATCH 1/9] undo 1340 --- data/setup.otml | 2 +- modules/gamelib/game.lua | 2 +- src/client/protocolgameparse.cpp | 10 ++++++++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/data/setup.otml b/data/setup.otml index 40aee2de22..c165a1f9e1 100644 --- a/data/setup.otml +++ b/data/setup.otml @@ -1,6 +1,6 @@ game sprite-size: 32 - last-supported-version: 1332 + last-supported-version: 1340 draw-typing: false typing-icon: /images/game/console/typing diff --git a/modules/gamelib/game.lua b/modules/gamelib/game.lua index 03a173ece9..c7624fa2dd 100644 --- a/modules/gamelib/game.lua +++ b/modules/gamelib/game.lua @@ -58,7 +58,7 @@ function g_game.getSupportedClients() 1012, 1013, 1020, 1021, 1022, 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1080, 1081, 1082, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1281, 1285, - 1286, 1287, 1291, 1300, 1310, 1311, 1314, 1316, 1320, 1321, 1322, 1332 } + 1286, 1287, 1291, 1300, 1310, 1311, 1314, 1316, 1320, 1321, 1322, 1332 , 1340} end -- The client version and protocol version where diff --git a/src/client/protocolgameparse.cpp b/src/client/protocolgameparse.cpp index 33b26aaf4a..17258c2799 100644 --- a/src/client/protocolgameparse.cpp +++ b/src/client/protocolgameparse.cpp @@ -1156,6 +1156,16 @@ void ProtocolGame::parseOpenContainer(const InputMessagePtr& msg) msg->getU8(); } } + if (g_game.getClientVersion() >= 1340) { + if (containerItem->isMoveable()) { + msg->getU8(); + }else{ + msg->getU8(); + } + + + msg->getU8(); + } g_game.processOpenContainer(containerId, containerItem, name, capacity, hasParent, items, isUnlocked, hasPages, containerSize, firstIndex); } From 1ddc3426dad317edcc380edd262828a3a5f45495 Mon Sep 17 00:00:00 2001 From: kokekanon <114332266+kokekanon@users.noreply.github.com> Date: Thu, 8 Aug 2024 23:51:09 -0400 Subject: [PATCH 2/9] test --- src/client/protocolgameparse.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/client/protocolgameparse.cpp b/src/client/protocolgameparse.cpp index 17258c2799..6cc3366a91 100644 --- a/src/client/protocolgameparse.cpp +++ b/src/client/protocolgameparse.cpp @@ -1162,9 +1162,8 @@ void ProtocolGame::parseOpenContainer(const InputMessagePtr& msg) }else{ msg->getU8(); } - - - msg->getU8(); + + msg->getU8(); // // if (container->getHoldingPlayer()) { // Player holding the item (?) } g_game.processOpenContainer(containerId, containerItem, name, capacity, hasParent, items, isUnlocked, hasPages, containerSize, firstIndex); From 0e9e3d161fa2cd9e93d7c7af29ada54513556978 Mon Sep 17 00:00:00 2001 From: kokekanon <114332266+kokekanon@users.noreply.github.com> Date: Fri, 9 Aug 2024 00:35:17 -0400 Subject: [PATCH 3/9] fix: trade 13.40 --- src/client/protocolgameparse.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/client/protocolgameparse.cpp b/src/client/protocolgameparse.cpp index 6cc3366a91..dceb9b6454 100644 --- a/src/client/protocolgameparse.cpp +++ b/src/client/protocolgameparse.cpp @@ -1283,7 +1283,13 @@ void ProtocolGame::parsePlayerGoods(const InputMessagePtr& msg) const } } - const uint8_t size = msg->getU8(); + uint16_t size = 0; + if (g_game.getClientVersion() >= 1340) { + size = msg->getU16(); + } else { + size = msg->getU8(); + } + for (auto i = -1; ++i < size;) { const uint16_t itemId = msg->getU16(); From a9c5128eff8e3ac97698cb86d7fefd6b6bcec38b Mon Sep 17 00:00:00 2001 From: kokekanon <114332266+kokekanon@users.noreply.github.com> Date: Fri, 9 Aug 2024 01:29:22 -0400 Subject: [PATCH 4/9] Update src/client/protocolgameparse.cpp Co-authored-by: Luan Luciano --- src/client/protocolgameparse.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/client/protocolgameparse.cpp b/src/client/protocolgameparse.cpp index dceb9b6454..abae38a247 100644 --- a/src/client/protocolgameparse.cpp +++ b/src/client/protocolgameparse.cpp @@ -1157,13 +1157,8 @@ void ProtocolGame::parseOpenContainer(const InputMessagePtr& msg) } } if (g_game.getClientVersion() >= 1340) { - if (containerItem->isMoveable()) { - msg->getU8(); - }else{ - msg->getU8(); - } - - msg->getU8(); // // if (container->getHoldingPlayer()) { // Player holding the item (?) + msg->getU8(); + msg->getU8(); } g_game.processOpenContainer(containerId, containerItem, name, capacity, hasParent, items, isUnlocked, hasPages, containerSize, firstIndex); From 808f0ec537ccef9e2f1ebc4f09a33c10e3f54753 Mon Sep 17 00:00:00 2001 From: kokekanon <114332266+kokekanon@users.noreply.github.com> Date: Fri, 9 Aug 2024 01:29:31 -0400 Subject: [PATCH 5/9] Update modules/gamelib/game.lua Co-authored-by: Luan Luciano --- modules/gamelib/game.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/gamelib/game.lua b/modules/gamelib/game.lua index c7624fa2dd..efad32d59c 100644 --- a/modules/gamelib/game.lua +++ b/modules/gamelib/game.lua @@ -58,7 +58,7 @@ function g_game.getSupportedClients() 1012, 1013, 1020, 1021, 1022, 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1080, 1081, 1082, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1281, 1285, - 1286, 1287, 1291, 1300, 1310, 1311, 1314, 1316, 1320, 1321, 1322, 1332 , 1340} + 1286, 1287, 1291, 1300, 1310, 1311, 1314, 1316, 1320, 1321, 1322, 1332, 1334, 1336, 1337, 1340} end -- The client version and protocol version where From 99b9999e9828fc93ab7c141afa49d87869d65f43 Mon Sep 17 00:00:00 2001 From: kokekanon <114332266+kokekanon@users.noreply.github.com> Date: Fri, 9 Aug 2024 01:29:43 -0400 Subject: [PATCH 6/9] Update src/client/protocolgameparse.cpp Co-authored-by: Luan Luciano --- src/client/protocolgameparse.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/protocolgameparse.cpp b/src/client/protocolgameparse.cpp index abae38a247..af4983860c 100644 --- a/src/client/protocolgameparse.cpp +++ b/src/client/protocolgameparse.cpp @@ -1279,7 +1279,7 @@ void ProtocolGame::parsePlayerGoods(const InputMessagePtr& msg) const } uint16_t size = 0; - if (g_game.getClientVersion() >= 1340) { + if (g_game.getClientVersion() >= 1334) { size = msg->getU16(); } else { size = msg->getU8(); From a3c04958a2941c0c31256aaf67c5c1b0fb52bd7c Mon Sep 17 00:00:00 2001 From: kokekanon <114332266+kokekanon@users.noreply.github.com> Date: Fri, 9 Aug 2024 02:27:20 -0400 Subject: [PATCH 7/9] try fix market/cylopedia --- src/client/thingtype.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/client/thingtype.h b/src/client/thingtype.h index 5f84357d50..d41d9028a2 100644 --- a/src/client/thingtype.h +++ b/src/client/thingtype.h @@ -209,7 +209,13 @@ enum ITEM_CATEGORY : uint8_t ITEM_CATEGORY_WANDS_RODS = 21, ITEM_CATEGORY_PREMIUM_SCROLLS = 22, ITEM_CATEGORY_TIBIA_COINS = 23, - ITEM_CATEGORY_CREATURE_PRODUCTS = 24 + ITEM_CATEGORY_CREATURE_PRODUCTS = 24, + ITEM_CATEGORY_QUIVER = 25, + ITEM_CATEGORY_TWOHANDWEAPON = 26, + ITEM_CATEGORY_HELMETS = 27, + ITEM_CATEGORY_BACKPACK = 28, + ITEM_CATEGORY_ONEHANDWEAPON = 29, + ITEM_CATEGORY_ARROW = 30 }; enum SpriteMask :uint8_t From 59e0282e3b2cde84544911b96c45ba5957a27025 Mon Sep 17 00:00:00 2001 From: kokekanon <114332266+kokekanon@users.noreply.github.com> Date: Fri, 9 Aug 2024 08:51:06 -0400 Subject: [PATCH 8/9] try fix market/cylopedia 2 --- src/protobuf/appearances.pb.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/protobuf/appearances.pb.h b/src/protobuf/appearances.pb.h index af1d504e76..29d90efac5 100644 --- a/src/protobuf/appearances.pb.h +++ b/src/protobuf/appearances.pb.h @@ -211,7 +211,13 @@ enum ITEM_CATEGORY : int { ITEM_CATEGORY_WANDS_RODS = 21, ITEM_CATEGORY_PREMIUM_SCROLLS = 22, ITEM_CATEGORY_TIBIA_COINS = 23, - ITEM_CATEGORY_CREATURE_PRODUCTS = 24 + ITEM_CATEGORY_CREATURE_PRODUCTS = 24, + ITEM_CATEGORY_QUIVER = 25, + ITEM_CATEGORY_TWOHANDWEAPON = 26, + ITEM_CATEGORY_HELMETS = 27, + ITEM_CATEGORY_BACKPACK = 28, + ITEM_CATEGORY_ONEHANDWEAPON = 29, + ITEM_CATEGORY_ARROW = 30 }; bool ITEM_CATEGORY_IsValid(int value); constexpr ITEM_CATEGORY ITEM_CATEGORY_MIN = ITEM_CATEGORY_ARMORS; From 7f17a17f802fea305971d8295520651023735b90 Mon Sep 17 00:00:00 2001 From: kokekanon <114332266+kokekanon@users.noreply.github.com> Date: Mon, 12 Aug 2024 13:53:25 -0400 Subject: [PATCH 9/9] fix store in 13.40 --- src/client/protocolgameparse.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/client/protocolgameparse.cpp b/src/client/protocolgameparse.cpp index 2531870eb0..6dbe1f13ad 100644 --- a/src/client/protocolgameparse.cpp +++ b/src/client/protocolgameparse.cpp @@ -708,7 +708,7 @@ void ProtocolGame::parseWorldTime(const InputMessagePtr& msg) void ProtocolGame::parseStore(const InputMessagePtr& msg) const { - if (g_game.getClientVersion() != 1332) { + if (g_game.getClientVersion() <= 1332) { parseCoinBalance(msg); } @@ -719,7 +719,7 @@ void ProtocolGame::parseStore(const InputMessagePtr& msg) const StoreCategory category; category.name = msg->getString(); - if (g_game.getClientVersion() != 1332) { + if (g_game.getClientVersion() <= 1332) { msg->getString(); } @@ -814,7 +814,7 @@ void ProtocolGame::parseCoinBalanceUpdating(const InputMessagePtr& msg) void ProtocolGame::parseCompleteStorePurchase(const InputMessagePtr& msg) const { - if (g_game.getClientVersion() == 1332) { + if (g_game.getClientVersion() >= 1332) { msg->getU8(); const auto& purchaseStatus = msg->getString(); @@ -848,7 +848,7 @@ void ProtocolGame::parseStoreTransactionHistory(const InputMessagePtr& msg) cons std::vector> historyData; for (auto i = -1; ++i < entries;) { - if (g_game.getClientVersion() == 1332) { + if (g_game.getClientVersion() >= 1332) { msg->getU32(); uint32_t time = msg->getU32(); msg->getU8(); @@ -874,7 +874,7 @@ void ProtocolGame::parseStoreTransactionHistory(const InputMessagePtr& msg) cons void ProtocolGame::parseStoreOffers(const InputMessagePtr& msg) { - if (g_game.getClientVersion() == 1332) { + if (g_game.getClientVersion() >= 1332) { StoreData storeData; storeData.categoryName = msg->getString(); storeData.redirectId = msg->getU32();