diff --git a/changelog.txt b/changelog.txt index f0622291d..53e9bb3da 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,7 +1,10 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- +== 01/27/2015 == +Uleat: Finished ClientVersion update to include patch file and namespace updates - don't forget to copy the renamed 'patch_UF.conf' into your eqemu directory.) + == 01/26/2015 == -Uleat: Changed Corpse::MoveItemToCorpse() to allow 'by address' passing of removed item slot list. Fixed a bug that would 'unattune' soulbound items inside of binds +Uleat: Changed Corpse::MoveItemToCorpse() to allow 'by address' passing of removed item slot list. Fixed a bug that kept soul-bound items inside of bags from attuning properly == 01/25/2015 == Trevius: Fixed an issue where Mercenaries were causing several DB queries per second while suspended. @@ -10,7 +13,7 @@ Trevius: Added Logs::Mercenaries to the new Logging System. Logging of Mercenar == 01/24/2015 == Uleat: Added equipment light source functionality to all mob derived classes (may still need tweaking...) Notes: - - In addition to equipment light sources, innate npc type light sources have already been activated + - In addition to equipment light sources, innate npc_type light sources have already been activated - Valid light source values are 0 thru 15 (values are bitmask checked and limited to 0x0F) - Not all classes handle equipment light sources the same way due to their equipment/loot list configurations - Spell (casting?) light sources may be implemented at some point..more information is needed @@ -21,7 +24,7 @@ Notes: Akkadius: Massive Log System overhaul, see: http://wiki.eqemulator.org/p?Logging_System_Overhaul&frm=Main == 01/21/2015 == -Uleat: Added `light` field to npctypes load query (all six clients tested positive for functionality.) +Uleat: Added `light` field to npc_types load query (all six clients tested positive for functionality.) Note: This only affects 'innate' light. Equipment (other) light is still in-work. Optional SQL: utils/sql/git/optional/2015_01_21_NPC_Types_Light_Field_Primer.sql diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index a9ae3fce3..f847957db 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -71,7 +71,7 @@ SET(common_sources patches/rof.cpp patches/rof2.cpp patches/titanium.cpp - patches/underfoot.cpp + patches/uf.cpp SocketLib/Base64.cpp SocketLib/File.cpp SocketLib/HttpdCookies.cpp @@ -216,11 +216,11 @@ SET(common_headers patches/titanium_itemfields.h patches/titanium_ops.h patches/titanium_structs.h - patches/underfoot.h - patches/underfoot_constants.h - patches/underfoot_itemfields.h - patches/underfoot_ops.h - patches/underfoot_structs.h + patches/uf.h + patches/uf_constants.h + patches/uf_itemfields.h + patches/uf_ops.h + patches/uf_structs.h SocketLib/Base64.h SocketLib/File.h SocketLib/HttpdCookies.h @@ -269,18 +269,18 @@ SOURCE_GROUP(Patches FILES patches/titanium_ops.h patches/titanium_constants.h patches/titanium_structs.h - patches/underfoot.h - patches/underfoot_itemfields.h - patches/underfoot_ops.h - patches/underfoot_constants.h - patches/underfoot_structs.h + patches/uf.h + patches/uf_itemfields.h + patches/uf_ops.h + patches/uf_constants.h + patches/uf_structs.h patches/patches.cpp patches/sod.cpp patches/sof.cpp patches/rof.cpp patches/rof2.cpp patches/titanium.cpp - patches/underfoot.cpp + patches/uf.cpp ) SOURCE_GROUP(SocketLib FILES @@ -330,7 +330,7 @@ ADD_LIBRARY(common ${common_sources} ${common_headers}) IF(UNIX) ADD_DEFINITIONS(-fPIC) SET_SOURCE_FILES_PROPERTIES("SocketLib/Mime.cpp" PROPERTY COMPILE_FLAGS -Wno-unused-result) - SET_SOURCE_FILES_PROPERTIES("patches/sod.cpp" "patches/sof.cpp" "patches/rof.cpp" "patches/rof2.cpp" "patches/underfoot.cpp" PROPERTIES COMPILE_FLAGS -O0) + SET_SOURCE_FILES_PROPERTIES("patches/sod.cpp" "patches/sof.cpp" "patches/rof.cpp" "patches/rof2.cpp" "patches/uf.cpp" PROPERTIES COMPILE_FLAGS -O0) ENDIF(UNIX) diff --git a/common/clientversions.h b/common/clientversions.h index a124ceae7..d0b5f7c41 100644 --- a/common/clientversions.h +++ b/common/clientversions.h @@ -7,14 +7,14 @@ static const uint32 BIT_Client62 = 1; static const uint32 BIT_Titanium = 2; static const uint32 BIT_SoF = 4; static const uint32 BIT_SoD = 8; -static const uint32 BIT_Underfoot = 16; +static const uint32 BIT_UF = 16; static const uint32 BIT_RoF = 32; static const uint32 BIT_RoF2 = 64; static const uint32 BIT_TitaniumAndEarlier = 0x00000003; static const uint32 BIT_SoFAndLater = 0xFFFFFFFC; static const uint32 BIT_SoDAndLater = 0xFFFFFFF8; -static const uint32 BIT_UnderfootAndLater = 0xFFFFFFF0; +static const uint32 BIT_UFAndLater = 0xFFFFFFF0; static const uint32 BIT_RoFAndLater = 0xFFFFFFE0; static const uint32 BIT_RoF2AndLater = 0xFFFFFFC0; static const uint32 BIT_AllClients = 0xFFFFFFFF; @@ -23,10 +23,10 @@ enum class ClientVersion { Unknown = 0, Client62, // Build: 'Aug 4 2005 15:40:59' - Tit, // Build: 'Oct 31 2005 10:33:37' + Titanium, // Build: 'Oct 31 2005 10:33:37' SoF, // Build: 'Sep 7 2007 09:11:49' SoD, // Build: 'Dec 19 2008 15:22:49' - Und, // Build: 'Jun 8 2010 16:44:32' + UF, // Build: 'Jun 8 2010 16:44:32' RoF, // Build: 'Dec 10 2012 17:35:44' RoF2, // Build: 'May 10 2013 23:30:08' @@ -49,14 +49,14 @@ static const char* ClientVersionName(ClientVersion version) return "ClientVersion::Unknown"; case ClientVersion::Client62: return "ClientVersion::Client62"; - case ClientVersion::Tit: - return "ClientVersion::Tit"; + case ClientVersion::Titanium: + return "ClientVersion::Titanium"; case ClientVersion::SoF: return "ClientVersion::SoF"; case ClientVersion::SoD: return "ClientVersion::SoD"; - case ClientVersion::Und: - return "ClientVersion::Und"; + case ClientVersion::UF: + return "ClientVersion::UF"; case ClientVersion::RoF: return "ClientVersion::RoF"; case ClientVersion::RoF2: diff --git a/common/eq_dictionary.cpp b/common/eq_dictionary.cpp index 986f17848..ed3253260 100644 --- a/common/eq_dictionary.cpp +++ b/common/eq_dictionary.cpp @@ -492,7 +492,7 @@ uint16 EQLimits::InventoryMapSize(int16 indexMap, ClientVersion clientVersion) { /*Titanium*/ Titanium::consts::MAP_CORPSE_SIZE, /*SoF*/ SoF::consts::MAP_CORPSE_SIZE, /*SoD*/ SoD::consts::MAP_CORPSE_SIZE, -/*Underfoot*/ Underfoot::consts::MAP_CORPSE_SIZE, +/*Underfoot*/ UF::consts::MAP_CORPSE_SIZE, /*RoF*/ RoF::consts::MAP_CORPSE_SIZE, /*RoF2*/ RoF2::consts::MAP_CORPSE_SIZE, @@ -522,7 +522,7 @@ uint16 EQLimits::InventoryMapSize(int16 indexMap, ClientVersion clientVersion) { /*Titanium*/ Titanium::consts::MAP_INSPECT_SIZE, /*SoF*/ SoF::consts::MAP_INSPECT_SIZE, /*SoD*/ SoD::consts::MAP_INSPECT_SIZE, -/*Underfoot*/ Underfoot::consts::MAP_INSPECT_SIZE, +/*Underfoot*/ UF::consts::MAP_INSPECT_SIZE, /*RoF*/ RoF::consts::MAP_INSPECT_SIZE, /*RoF2*/ RoF2::consts::MAP_INSPECT_SIZE, @@ -800,7 +800,7 @@ bool EQLimits::AllowsEmptyBagInBag(ClientVersion clientVersion) { /*Titanium*/ Titanium::limits::ALLOWS_EMPTY_BAG_IN_BAG, /*SoF*/ SoF::limits::ALLOWS_EMPTY_BAG_IN_BAG, /*SoD*/ SoD::limits::ALLOWS_EMPTY_BAG_IN_BAG, -/*Underfoot*/ Underfoot::limits::ALLOWS_EMPTY_BAG_IN_BAG, +/*Underfoot*/ UF::limits::ALLOWS_EMPTY_BAG_IN_BAG, /*RoF*/ RoF::limits::ALLOWS_EMPTY_BAG_IN_BAG, /*RoF2*/ RoF2::limits::ALLOWS_EMPTY_BAG_IN_BAG, @@ -821,7 +821,7 @@ bool EQLimits::AllowsClickCastFromBag(ClientVersion clientVersion) { /*Titanium*/ Titanium::limits::ALLOWS_CLICK_CAST_FROM_BAG, /*SoF*/ SoF::limits::ALLOWS_CLICK_CAST_FROM_BAG, /*SoD*/ SoD::limits::ALLOWS_CLICK_CAST_FROM_BAG, -/*Underfoot*/ Underfoot::limits::ALLOWS_CLICK_CAST_FROM_BAG, +/*Underfoot*/ UF::limits::ALLOWS_CLICK_CAST_FROM_BAG, /*RoF*/ RoF::limits::ALLOWS_CLICK_CAST_FROM_BAG, /*RoF2*/ RoF2::limits::ALLOWS_CLICK_CAST_FROM_BAG, @@ -882,7 +882,7 @@ bool EQLimits::CoinHasWeight(ClientVersion clientVersion) { /*Titanium*/ Titanium::limits::COIN_HAS_WEIGHT, /*SoF*/ SoF::limits::COIN_HAS_WEIGHT, /*SoD*/ SoD::limits::COIN_HAS_WEIGHT, -/*Underfoot*/ Underfoot::limits::COIN_HAS_WEIGHT, +/*Underfoot*/ UF::limits::COIN_HAS_WEIGHT, /*RoF*/ RoF::limits::COIN_HAS_WEIGHT, /*RoF2*/ RoF::limits::COIN_HAS_WEIGHT, diff --git a/common/eq_dictionary.h b/common/eq_dictionary.h index a61eb7bfd..d1337856e 100644 --- a/common/eq_dictionary.h +++ b/common/eq_dictionary.h @@ -29,7 +29,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include "../common/patches/titanium_constants.h" #include "../common/patches/sof_constants.h" #include "../common/patches/sod_constants.h" -#include "../common/patches/underfoot_constants.h" +#include "../common/patches/uf_constants.h" #include "../common/patches/rof_constants.h" #include "../common/patches/rof2_constants.h" diff --git a/common/patches/patches.cpp b/common/patches/patches.cpp index 55c0d4e8b..3147b89f6 100644 --- a/common/patches/patches.cpp +++ b/common/patches/patches.cpp @@ -3,7 +3,7 @@ #include "patches.h" #include "titanium.h" -#include "underfoot.h" +#include "uf.h" #include "sof.h" #include "sod.h" #include "rof.h" @@ -13,7 +13,7 @@ void RegisterAllPatches(EQStreamIdentifier &into) { Titanium::Register(into); SoF::Register(into); SoD::Register(into); - Underfoot::Register(into); + UF::Register(into); RoF::Register(into); RoF2::Register(into); } @@ -22,7 +22,7 @@ void ReloadAllPatches() { Titanium::Reload(); SoF::Reload(); SoD::Reload(); - Underfoot::Reload(); + UF::Reload(); RoF::Reload(); RoF2::Reload(); } diff --git a/common/patches/rof.cpp b/common/patches/rof.cpp index 3440ee3d0..9494c5048 100644 --- a/common/patches/rof.cpp +++ b/common/patches/rof.cpp @@ -25,14 +25,14 @@ namespace RoF char* SerializeItem(const ItemInst *inst, int16 slot_id, uint32 *length, uint8 depth); // server to client inventory location converters - static inline structs::ItemSlotStruct ServerToRoFSlot(uint32 ServerSlot); - static inline structs::MainInvItemSlotStruct ServerToRoFMainInvSlot(uint32 ServerSlot); - static inline uint32 ServerToRoFCorpseSlot(uint32 ServerCorpse); + static inline structs::ItemSlotStruct ServerToRoFSlot(uint32 serverSlot); + static inline structs::MainInvItemSlotStruct ServerToRoFMainInvSlot(uint32 serverSlot); + static inline uint32 ServerToRoFCorpseSlot(uint32 serverCorpseSlot); // client to server inventory location converters - static inline uint32 RoFToServerSlot(structs::ItemSlotStruct RoFSlot); - static inline uint32 RoFToServerMainInvSlot(structs::MainInvItemSlotStruct RoFSlot); - static inline uint32 RoFToServerCorpseSlot(uint32 RoFCorpse); + static inline uint32 RoFToServerSlot(structs::ItemSlotStruct rofSlot); + static inline uint32 RoFToServerMainInvSlot(structs::MainInvItemSlotStruct rofSlot); + static inline uint32 RoFToServerCorpseSlot(uint32 rofCorpseSlot); // server to client text link converter static inline void ServerToRoFTextLink(std::string& rofTextLink, const std::string& serverTextLink); @@ -4650,7 +4650,7 @@ namespace RoF SETUP_DIRECT_DECODE(MoveItem_Struct, structs::MoveItem_Struct); //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot.MainSlot, eq->to_slot.MainSlot); - Log.Out(Logs::General, Logs::Netcode, "[ERROR] MoveItem SlotType from %i to %i, MainSlot from %i to %i, SubSlot from %i to %i, AugSlot from %i to %i, Unknown01 from %i to %i, Number %u", eq->from_slot.SlotType, eq->to_slot.SlotType, eq->from_slot.MainSlot, eq->to_slot.MainSlot, eq->from_slot.SubSlot, eq->to_slot.SubSlot, eq->from_slot.AugSlot, eq->to_slot.AugSlot, eq->from_slot.Unknown01, eq->to_slot.Unknown01, eq->number_in_stack); + Log.Out(Logs::General, Logs::Netcode, "[RoF] MoveItem SlotType from %i to %i, MainSlot from %i to %i, SubSlot from %i to %i, AugSlot from %i to %i, Unknown01 from %i to %i, Number %u", eq->from_slot.SlotType, eq->to_slot.SlotType, eq->from_slot.MainSlot, eq->to_slot.MainSlot, eq->from_slot.SubSlot, eq->to_slot.SubSlot, eq->from_slot.AugSlot, eq->to_slot.AugSlot, eq->from_slot.Unknown01, eq->to_slot.Unknown01, eq->number_in_stack); emu->from_slot = RoFToServerSlot(eq->from_slot); emu->to_slot = RoFToServerSlot(eq->to_slot); IN(number_in_stack); @@ -5507,7 +5507,7 @@ namespace RoF return item_serial; } - static inline structs::ItemSlotStruct ServerToRoFSlot(uint32 ServerSlot) + static inline structs::ItemSlotStruct ServerToRoFSlot(uint32 serverSlot) { structs::ItemSlotStruct RoFSlot; RoFSlot.SlotType = INVALID_INDEX; @@ -5519,17 +5519,17 @@ namespace RoF uint32 TempSlot = 0; - if (ServerSlot < 56 || ServerSlot == MainPowerSource) { // Main Inventory and Cursor + if (serverSlot < 56 || serverSlot == MainPowerSource) { // Main Inventory and Cursor RoFSlot.SlotType = maps::MapPossessions; - RoFSlot.MainSlot = ServerSlot; + RoFSlot.MainSlot = serverSlot; - if (ServerSlot == MainPowerSource) + if (serverSlot == MainPowerSource) RoFSlot.MainSlot = slots::MainPowerSource; - else if (ServerSlot >= MainCursor) // Cursor and Extended Corpse Inventory + else if (serverSlot >= MainCursor) // Cursor and Extended Corpse Inventory RoFSlot.MainSlot += 3; - else if (ServerSlot >= MainAmmo) // (> 20) + else if (serverSlot >= MainAmmo) // (> 20) RoFSlot.MainSlot += 1; } @@ -5538,9 +5538,9 @@ namespace RoF RoFSlot.MainSlot = ServerSlot - 31; }*/ - else if (ServerSlot >= EmuConstants::GENERAL_BAGS_BEGIN && ServerSlot <= EmuConstants::CURSOR_BAG_END) { // (> 250 && < 341) + else if (serverSlot >= EmuConstants::GENERAL_BAGS_BEGIN && serverSlot <= EmuConstants::CURSOR_BAG_END) { // (> 250 && < 341) RoFSlot.SlotType = maps::MapPossessions; - TempSlot = ServerSlot - 1; + TempSlot = serverSlot - 1; RoFSlot.MainSlot = int(TempSlot / EmuConstants::ITEM_CONTAINER_SIZE) - 2; RoFSlot.SubSlot = TempSlot - ((RoFSlot.MainSlot + 2) * EmuConstants::ITEM_CONTAINER_SIZE); @@ -5548,14 +5548,14 @@ namespace RoF RoFSlot.MainSlot = slots::MainCursor; } - else if (ServerSlot >= EmuConstants::TRIBUTE_BEGIN && ServerSlot <= EmuConstants::TRIBUTE_END) { // Tribute + else if (serverSlot >= EmuConstants::TRIBUTE_BEGIN && serverSlot <= EmuConstants::TRIBUTE_END) { // Tribute RoFSlot.SlotType = maps::MapTribute; - RoFSlot.MainSlot = ServerSlot - EmuConstants::TRIBUTE_BEGIN; + RoFSlot.MainSlot = serverSlot - EmuConstants::TRIBUTE_BEGIN; } - else if (ServerSlot >= EmuConstants::BANK_BEGIN && ServerSlot <= EmuConstants::BANK_BAGS_END) { + else if (serverSlot >= EmuConstants::BANK_BEGIN && serverSlot <= EmuConstants::BANK_BAGS_END) { RoFSlot.SlotType = maps::MapBank; - TempSlot = ServerSlot - EmuConstants::BANK_BEGIN; + TempSlot = serverSlot - EmuConstants::BANK_BEGIN; RoFSlot.MainSlot = TempSlot; if (TempSlot > 30) { // (> 30) @@ -5564,9 +5564,9 @@ namespace RoF } } - else if (ServerSlot >= EmuConstants::SHARED_BANK_BEGIN && ServerSlot <= EmuConstants::SHARED_BANK_BAGS_END) { + else if (serverSlot >= EmuConstants::SHARED_BANK_BEGIN && serverSlot <= EmuConstants::SHARED_BANK_BAGS_END) { RoFSlot.SlotType = maps::MapSharedBank; - TempSlot = ServerSlot - EmuConstants::SHARED_BANK_BEGIN; + TempSlot = serverSlot - EmuConstants::SHARED_BANK_BEGIN; RoFSlot.MainSlot = TempSlot; if (TempSlot > 30) { // (> 30) @@ -5575,9 +5575,9 @@ namespace RoF } } - else if (ServerSlot >= EmuConstants::TRADE_BEGIN && ServerSlot <= EmuConstants::TRADE_BAGS_END) { + else if (serverSlot >= EmuConstants::TRADE_BEGIN && serverSlot <= EmuConstants::TRADE_BAGS_END) { RoFSlot.SlotType = maps::MapTrade; - TempSlot = ServerSlot - EmuConstants::TRADE_BEGIN; + TempSlot = serverSlot - EmuConstants::TRADE_BEGIN; RoFSlot.MainSlot = TempSlot; if (TempSlot > 30) { @@ -5599,18 +5599,18 @@ namespace RoF */ } - else if (ServerSlot >= EmuConstants::WORLD_BEGIN && ServerSlot <= EmuConstants::WORLD_END) { + else if (serverSlot >= EmuConstants::WORLD_BEGIN && serverSlot <= EmuConstants::WORLD_END) { RoFSlot.SlotType = maps::MapWorld; - TempSlot = ServerSlot - EmuConstants::WORLD_BEGIN; + TempSlot = serverSlot - EmuConstants::WORLD_BEGIN; RoFSlot.MainSlot = TempSlot; } - Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert Server Slot %i to RoF Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i", ServerSlot, RoFSlot.SlotType, RoFSlot.Unknown02, RoFSlot.MainSlot, RoFSlot.SubSlot, RoFSlot.AugSlot, RoFSlot.Unknown01); + Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert Server Slot %i to RoF Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i", serverSlot, RoFSlot.SlotType, RoFSlot.Unknown02, RoFSlot.MainSlot, RoFSlot.SubSlot, RoFSlot.AugSlot, RoFSlot.Unknown01); return RoFSlot; } - static inline structs::MainInvItemSlotStruct ServerToRoFMainInvSlot(uint32 ServerSlot) + static inline structs::MainInvItemSlotStruct ServerToRoFMainInvSlot(uint32 serverSlot) { structs::MainInvItemSlotStruct RoFSlot; RoFSlot.MainSlot = INVALID_INDEX; @@ -5620,16 +5620,16 @@ namespace RoF uint32 TempSlot = 0; - if (ServerSlot < 56 || ServerSlot == MainPowerSource) { // (< 52) - RoFSlot.MainSlot = ServerSlot; + if (serverSlot < 56 || serverSlot == MainPowerSource) { // (< 52) + RoFSlot.MainSlot = serverSlot; - if (ServerSlot == MainPowerSource) + if (serverSlot == MainPowerSource) RoFSlot.MainSlot = slots::MainPowerSource; - else if (ServerSlot >= MainCursor) // Cursor and Extended Corpse Inventory + else if (serverSlot >= MainCursor) // Cursor and Extended Corpse Inventory RoFSlot.MainSlot += 3; - else if (ServerSlot >= MainAmmo) // Ammo and Personl Inventory + else if (serverSlot >= MainAmmo) // Ammo and Personl Inventory RoFSlot.MainSlot += 1; /*else if (ServerSlot >= MainCursor) { // Cursor @@ -5640,33 +5640,33 @@ namespace RoF }*/ } - else if (ServerSlot >= EmuConstants::GENERAL_BAGS_BEGIN && ServerSlot <= EmuConstants::CURSOR_BAG_END) { - TempSlot = ServerSlot - 1; + else if (serverSlot >= EmuConstants::GENERAL_BAGS_BEGIN && serverSlot <= EmuConstants::CURSOR_BAG_END) { + TempSlot = serverSlot - 1; RoFSlot.MainSlot = int(TempSlot / EmuConstants::ITEM_CONTAINER_SIZE) - 2; RoFSlot.SubSlot = TempSlot - ((RoFSlot.MainSlot + 2) * EmuConstants::ITEM_CONTAINER_SIZE); } - Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert Server Slot %i to RoF Slots: Main %i, Sub %i, Aug %i, Unk1 %i", ServerSlot, RoFSlot.MainSlot, RoFSlot.SubSlot, RoFSlot.AugSlot, RoFSlot.Unknown01); + Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert Server Slot %i to RoF Slots: Main %i, Sub %i, Aug %i, Unk1 %i", serverSlot, RoFSlot.MainSlot, RoFSlot.SubSlot, RoFSlot.AugSlot, RoFSlot.Unknown01); return RoFSlot; } - static inline uint32 ServerToRoFCorpseSlot(uint32 ServerCorpse) + static inline uint32 ServerToRoFCorpseSlot(uint32 serverCorpseSlot) { - return (ServerCorpse + 1); + return (serverCorpseSlot + 1); } - static inline uint32 RoFToServerSlot(structs::ItemSlotStruct RoFSlot) + static inline uint32 RoFToServerSlot(structs::ItemSlotStruct rofSlot) { uint32 ServerSlot = INVALID_INDEX; uint32 TempSlot = 0; - if (RoFSlot.SlotType == maps::MapPossessions && RoFSlot.MainSlot < 57) { // Worn/Personal Inventory and Cursor (< 51) - if (RoFSlot.MainSlot == slots::MainPowerSource) + if (rofSlot.SlotType == maps::MapPossessions && rofSlot.MainSlot < 57) { // Worn/Personal Inventory and Cursor (< 51) + if (rofSlot.MainSlot == slots::MainPowerSource) TempSlot = MainPowerSource; - else if (RoFSlot.MainSlot >= slots::MainCursor) // Cursor and Extended Corpse Inventory - TempSlot = RoFSlot.MainSlot - 3; + else if (rofSlot.MainSlot >= slots::MainCursor) // Cursor and Extended Corpse Inventory + TempSlot = rofSlot.MainSlot - 3; /*else if (RoFSlot.MainSlot == slots::MainGeneral9 || RoFSlot.MainSlot == slots::MainGeneral10) { // 9th and 10th RoF inventory/corpse slots // Need to figure out what to do when we get these @@ -5679,61 +5679,61 @@ namespace RoF // For now, it's probably best to leave as-is and let this work itself out in the inventory rework. }*/ - else if (RoFSlot.MainSlot >= slots::MainAmmo) // Ammo and Main Inventory - TempSlot = RoFSlot.MainSlot - 1; + else if (rofSlot.MainSlot >= slots::MainAmmo) // Ammo and Main Inventory + TempSlot = rofSlot.MainSlot - 1; else // Worn Slots - TempSlot = RoFSlot.MainSlot; + TempSlot = rofSlot.MainSlot; - if (RoFSlot.SubSlot >= SUB_BEGIN) // Bag Slots - TempSlot = ((TempSlot + 3) * EmuConstants::ITEM_CONTAINER_SIZE) + RoFSlot.SubSlot + 1; + if (rofSlot.SubSlot >= SUB_BEGIN) // Bag Slots + TempSlot = ((TempSlot + 3) * EmuConstants::ITEM_CONTAINER_SIZE) + rofSlot.SubSlot + 1; ServerSlot = TempSlot; } - else if (RoFSlot.SlotType == maps::MapBank) { + else if (rofSlot.SlotType == maps::MapBank) { TempSlot = EmuConstants::BANK_BEGIN; - if (RoFSlot.SubSlot >= SUB_BEGIN) - TempSlot += ((RoFSlot.MainSlot + 3) * EmuConstants::ITEM_CONTAINER_SIZE) + RoFSlot.SubSlot + 1; + if (rofSlot.SubSlot >= SUB_BEGIN) + TempSlot += ((rofSlot.MainSlot + 3) * EmuConstants::ITEM_CONTAINER_SIZE) + rofSlot.SubSlot + 1; else - TempSlot += RoFSlot.MainSlot; + TempSlot += rofSlot.MainSlot; ServerSlot = TempSlot; } - else if (RoFSlot.SlotType == maps::MapSharedBank) { + else if (rofSlot.SlotType == maps::MapSharedBank) { TempSlot = EmuConstants::SHARED_BANK_BEGIN; - if (RoFSlot.SubSlot >= SUB_BEGIN) - TempSlot += ((RoFSlot.MainSlot + 3) * EmuConstants::ITEM_CONTAINER_SIZE) + RoFSlot.SubSlot + 1; + if (rofSlot.SubSlot >= SUB_BEGIN) + TempSlot += ((rofSlot.MainSlot + 3) * EmuConstants::ITEM_CONTAINER_SIZE) + rofSlot.SubSlot + 1; else - TempSlot += RoFSlot.MainSlot; + TempSlot += rofSlot.MainSlot; ServerSlot = TempSlot; } - else if (RoFSlot.SlotType == maps::MapTrade) { + else if (rofSlot.SlotType == maps::MapTrade) { TempSlot = EmuConstants::TRADE_BEGIN; - if (RoFSlot.SubSlot >= SUB_BEGIN) - TempSlot += ((RoFSlot.MainSlot + 3) * EmuConstants::ITEM_CONTAINER_SIZE) + RoFSlot.SubSlot + 1; + if (rofSlot.SubSlot >= SUB_BEGIN) + TempSlot += ((rofSlot.MainSlot + 3) * EmuConstants::ITEM_CONTAINER_SIZE) + rofSlot.SubSlot + 1; // OLD CODE: //TempSlot += 100 + (RoFSlot.MainSlot * EmuConstants::ITEM_CONTAINER_SIZE) + RoFSlot.SubSlot; else - TempSlot += RoFSlot.MainSlot; + TempSlot += rofSlot.MainSlot; ServerSlot = TempSlot; } - else if (RoFSlot.SlotType == maps::MapWorld) { + else if (rofSlot.SlotType == maps::MapWorld) { TempSlot = EmuConstants::WORLD_BEGIN; - if (RoFSlot.MainSlot >= SUB_BEGIN) - TempSlot += RoFSlot.MainSlot; + if (rofSlot.MainSlot >= SUB_BEGIN) + TempSlot += rofSlot.MainSlot; ServerSlot = TempSlot; } @@ -5747,26 +5747,26 @@ namespace RoF ServerSlot = TempSlot; }*/ - else if (RoFSlot.SlotType == maps::MapGuildTribute) { + else if (rofSlot.SlotType == maps::MapGuildTribute) { ServerSlot = INVALID_INDEX; } - Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert RoF Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", RoFSlot.SlotType, RoFSlot.Unknown02, RoFSlot.MainSlot, RoFSlot.SubSlot, RoFSlot.AugSlot, RoFSlot.Unknown01, ServerSlot); + Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert RoF Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", rofSlot.SlotType, rofSlot.Unknown02, rofSlot.MainSlot, rofSlot.SubSlot, rofSlot.AugSlot, rofSlot.Unknown01, ServerSlot); return ServerSlot; } - static inline uint32 RoFToServerMainInvSlot(structs::MainInvItemSlotStruct RoFSlot) + static inline uint32 RoFToServerMainInvSlot(structs::MainInvItemSlotStruct rofSlot) { uint32 ServerSlot = INVALID_INDEX; uint32 TempSlot = 0; - if (RoFSlot.MainSlot < 57) { // Worn/Personal Inventory and Cursor (< 33) - if (RoFSlot.MainSlot == slots::MainPowerSource) + if (rofSlot.MainSlot < 57) { // Worn/Personal Inventory and Cursor (< 33) + if (rofSlot.MainSlot == slots::MainPowerSource) TempSlot = MainPowerSource; - else if (RoFSlot.MainSlot >= slots::MainCursor) // Cursor and Extended Corpse Inventory - TempSlot = RoFSlot.MainSlot - 3; + else if (rofSlot.MainSlot >= slots::MainCursor) // Cursor and Extended Corpse Inventory + TempSlot = rofSlot.MainSlot - 3; /*else if (RoFSlot.MainSlot == slots::MainGeneral9 || RoFSlot.MainSlot == slots::MainGeneral10) { // 9th and 10th RoF inventory slots // Need to figure out what to do when we get these @@ -5774,26 +5774,26 @@ namespace RoF // Same as above }*/ - else if (RoFSlot.MainSlot >= slots::MainAmmo) // Main Inventory and Ammo Slots - TempSlot = RoFSlot.MainSlot - 1; + else if (rofSlot.MainSlot >= slots::MainAmmo) // Main Inventory and Ammo Slots + TempSlot = rofSlot.MainSlot - 1; else - TempSlot = RoFSlot.MainSlot; + TempSlot = rofSlot.MainSlot; - if (RoFSlot.SubSlot >= SUB_BEGIN) // Bag Slots - TempSlot = ((TempSlot + 3) * EmuConstants::ITEM_CONTAINER_SIZE) + RoFSlot.SubSlot + 1; + if (rofSlot.SubSlot >= SUB_BEGIN) // Bag Slots + TempSlot = ((TempSlot + 3) * EmuConstants::ITEM_CONTAINER_SIZE) + rofSlot.SubSlot + 1; ServerSlot = TempSlot; } - Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert RoF Slots: Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", RoFSlot.MainSlot, RoFSlot.SubSlot, RoFSlot.AugSlot, RoFSlot.Unknown01, ServerSlot); + Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert RoF Slots: Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", rofSlot.MainSlot, rofSlot.SubSlot, rofSlot.AugSlot, rofSlot.Unknown01, ServerSlot); return ServerSlot; } - static inline uint32 RoFToServerCorpseSlot(uint32 RoFCorpse) + static inline uint32 RoFToServerCorpseSlot(uint32 rofCorpseSlot) { - return (RoFCorpse - 1); + return (rofCorpseSlot - 1); } static inline void ServerToRoFTextLink(std::string& rofTextLink, const std::string& serverTextLink) diff --git a/common/patches/rof.h b/common/patches/rof.h index 328e5f7f1..4ac7d3532 100644 --- a/common/patches/rof.h +++ b/common/patches/rof.h @@ -1,5 +1,5 @@ -#ifndef RoF_H_ -#define RoF_H_ +#ifndef ROF_H_ +#define ROF_H_ #include "../struct_strategy.h" @@ -32,6 +32,4 @@ namespace RoF { }; - - -#endif /*RoF_H_*/ +#endif /*ROF_H_*/ diff --git a/common/patches/rof2.cpp b/common/patches/rof2.cpp index 8c93cc4c7..d4c619942 100644 --- a/common/patches/rof2.cpp +++ b/common/patches/rof2.cpp @@ -25,14 +25,14 @@ namespace RoF2 char* SerializeItem(const ItemInst *inst, int16 slot_id, uint32 *length, uint8 depth, ItemPacketType packet_type); // server to client inventory location converters - static inline structs::ItemSlotStruct ServerToRoF2Slot(uint32 ServerSlot, ItemPacketType PacketType = ItemPacketInvalid); - static inline structs::MainInvItemSlotStruct ServerToRoF2MainInvSlot(uint32 ServerSlot); - static inline uint32 ServerToRoF2CorpseSlot(uint32 ServerCorpse); + static inline structs::ItemSlotStruct ServerToRoF2Slot(uint32 serverSlot, ItemPacketType PacketType = ItemPacketInvalid); + static inline structs::MainInvItemSlotStruct ServerToRoF2MainInvSlot(uint32 serverSlot); + static inline uint32 ServerToRoF2CorpseSlot(uint32 serverCorpseSlot); // client to server inventory location converters - static inline uint32 RoF2ToServerSlot(structs::ItemSlotStruct RoF2Slot, ItemPacketType PacketType = ItemPacketInvalid); - static inline uint32 RoF2ToServerMainInvSlot(structs::MainInvItemSlotStruct RoF2Slot); - static inline uint32 RoF2ToServerCorpseSlot(uint32 RoF2Corpse); + static inline uint32 RoF2ToServerSlot(structs::ItemSlotStruct rof2Slot, ItemPacketType PacketType = ItemPacketInvalid); + static inline uint32 RoF2ToServerMainInvSlot(structs::MainInvItemSlotStruct rof2Slot); + static inline uint32 RoF2ToServerCorpseSlot(uint32 rof2CorpseSlot); // server to client text link converter static inline void ServerToRoF2TextLink(std::string& rof2TextLink, const std::string& serverTextLink); @@ -4720,7 +4720,7 @@ namespace RoF2 DECODE_LENGTH_EXACT(structs::MoveItem_Struct); SETUP_DIRECT_DECODE(MoveItem_Struct, structs::MoveItem_Struct); - Log.Out(Logs::General, Logs::Netcode, "[ERROR] MoveItem SlotType from %i to %i, MainSlot from %i to %i, SubSlot from %i to %i, AugSlot from %i to %i, Unknown01 from %i to %i, Number %u", eq->from_slot.SlotType, eq->to_slot.SlotType, eq->from_slot.MainSlot, eq->to_slot.MainSlot, eq->from_slot.SubSlot, eq->to_slot.SubSlot, eq->from_slot.AugSlot, eq->to_slot.AugSlot, eq->from_slot.Unknown01, eq->to_slot.Unknown01, eq->number_in_stack); + Log.Out(Logs::General, Logs::Netcode, "[RoF2] MoveItem SlotType from %i to %i, MainSlot from %i to %i, SubSlot from %i to %i, AugSlot from %i to %i, Unknown01 from %i to %i, Number %u", eq->from_slot.SlotType, eq->to_slot.SlotType, eq->from_slot.MainSlot, eq->to_slot.MainSlot, eq->from_slot.SubSlot, eq->to_slot.SubSlot, eq->from_slot.AugSlot, eq->to_slot.AugSlot, eq->from_slot.Unknown01, eq->to_slot.Unknown01, eq->number_in_stack); emu->from_slot = RoF2ToServerSlot(eq->from_slot); emu->to_slot = RoF2ToServerSlot(eq->to_slot); IN(number_in_stack); @@ -5589,7 +5589,7 @@ namespace RoF2 return item_serial; } - static inline structs::ItemSlotStruct ServerToRoF2Slot(uint32 ServerSlot, ItemPacketType PacketType) + static inline structs::ItemSlotStruct ServerToRoF2Slot(uint32 serverSlot, ItemPacketType PacketType) { structs::ItemSlotStruct RoF2Slot; RoF2Slot.SlotType = INVALID_INDEX; @@ -5601,25 +5601,25 @@ namespace RoF2 uint32 TempSlot = 0; - if (ServerSlot < 56 || ServerSlot == MainPowerSource) { // Main Inventory and Cursor + if (serverSlot < 56 || serverSlot == MainPowerSource) { // Main Inventory and Cursor if (PacketType == ItemPacketLoot) { RoF2Slot.SlotType = maps::MapCorpse; - RoF2Slot.MainSlot = ServerSlot - EmuConstants::CORPSE_BEGIN; + RoF2Slot.MainSlot = serverSlot - EmuConstants::CORPSE_BEGIN; } else { RoF2Slot.SlotType = maps::MapPossessions; - RoF2Slot.MainSlot = ServerSlot; + RoF2Slot.MainSlot = serverSlot; } - if (ServerSlot == MainPowerSource) + if (serverSlot == MainPowerSource) RoF2Slot.MainSlot = slots::MainPowerSource; - else if (ServerSlot >= MainCursor && PacketType != ItemPacketLoot) // Cursor and Extended Corpse Inventory + else if (serverSlot >= MainCursor && PacketType != ItemPacketLoot) // Cursor and Extended Corpse Inventory RoF2Slot.MainSlot += 3; - else if (ServerSlot >= MainAmmo) // (> 20) + else if (serverSlot >= MainAmmo) // (> 20) RoF2Slot.MainSlot += 1; } @@ -5628,9 +5628,9 @@ namespace RoF2 RoF2Slot.MainSlot = ServerSlot - 31; }*/ - else if (ServerSlot >= EmuConstants::GENERAL_BAGS_BEGIN && ServerSlot <= EmuConstants::CURSOR_BAG_END) { // (> 250 && < 341) + else if (serverSlot >= EmuConstants::GENERAL_BAGS_BEGIN && serverSlot <= EmuConstants::CURSOR_BAG_END) { // (> 250 && < 341) RoF2Slot.SlotType = maps::MapPossessions; - TempSlot = ServerSlot - 1; + TempSlot = serverSlot - 1; RoF2Slot.MainSlot = int(TempSlot / EmuConstants::ITEM_CONTAINER_SIZE) - 2; RoF2Slot.SubSlot = TempSlot - ((RoF2Slot.MainSlot + 2) * EmuConstants::ITEM_CONTAINER_SIZE); @@ -5638,14 +5638,14 @@ namespace RoF2 RoF2Slot.MainSlot = slots::MainCursor; } - else if (ServerSlot >= EmuConstants::TRIBUTE_BEGIN && ServerSlot <= EmuConstants::TRIBUTE_END) { // Tribute + else if (serverSlot >= EmuConstants::TRIBUTE_BEGIN && serverSlot <= EmuConstants::TRIBUTE_END) { // Tribute RoF2Slot.SlotType = maps::MapTribute; - RoF2Slot.MainSlot = ServerSlot - EmuConstants::TRIBUTE_BEGIN; + RoF2Slot.MainSlot = serverSlot - EmuConstants::TRIBUTE_BEGIN; } - else if (ServerSlot >= EmuConstants::BANK_BEGIN && ServerSlot <= EmuConstants::BANK_BAGS_END) { + else if (serverSlot >= EmuConstants::BANK_BEGIN && serverSlot <= EmuConstants::BANK_BAGS_END) { RoF2Slot.SlotType = maps::MapBank; - TempSlot = ServerSlot - EmuConstants::BANK_BEGIN; + TempSlot = serverSlot - EmuConstants::BANK_BEGIN; RoF2Slot.MainSlot = TempSlot; if (TempSlot > 30) { // (> 30) @@ -5654,9 +5654,9 @@ namespace RoF2 } } - else if (ServerSlot >= EmuConstants::SHARED_BANK_BEGIN && ServerSlot <= EmuConstants::SHARED_BANK_BAGS_END) { + else if (serverSlot >= EmuConstants::SHARED_BANK_BEGIN && serverSlot <= EmuConstants::SHARED_BANK_BAGS_END) { RoF2Slot.SlotType = maps::MapSharedBank; - TempSlot = ServerSlot - EmuConstants::SHARED_BANK_BEGIN; + TempSlot = serverSlot - EmuConstants::SHARED_BANK_BEGIN; RoF2Slot.MainSlot = TempSlot; if (TempSlot > 30) { // (> 30) @@ -5665,9 +5665,9 @@ namespace RoF2 } } - else if (ServerSlot >= EmuConstants::TRADE_BEGIN && ServerSlot <= EmuConstants::TRADE_BAGS_END) { + else if (serverSlot >= EmuConstants::TRADE_BEGIN && serverSlot <= EmuConstants::TRADE_BAGS_END) { RoF2Slot.SlotType = maps::MapTrade; - TempSlot = ServerSlot - EmuConstants::TRADE_BEGIN; + TempSlot = serverSlot - EmuConstants::TRADE_BEGIN; RoF2Slot.MainSlot = TempSlot; if (TempSlot > 30) { @@ -5689,18 +5689,18 @@ namespace RoF2 */ } - else if (ServerSlot >= EmuConstants::WORLD_BEGIN && ServerSlot <= EmuConstants::WORLD_END) { + else if (serverSlot >= EmuConstants::WORLD_BEGIN && serverSlot <= EmuConstants::WORLD_END) { RoF2Slot.SlotType = maps::MapWorld; - TempSlot = ServerSlot - EmuConstants::WORLD_BEGIN; + TempSlot = serverSlot - EmuConstants::WORLD_BEGIN; RoF2Slot.MainSlot = TempSlot; } - Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert Server Slot %i to RoF2 Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i", ServerSlot, RoF2Slot.SlotType, RoF2Slot.Unknown02, RoF2Slot.MainSlot, RoF2Slot.SubSlot, RoF2Slot.AugSlot, RoF2Slot.Unknown01); + Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert Server Slot %i to RoF2 Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i", serverSlot, RoF2Slot.SlotType, RoF2Slot.Unknown02, RoF2Slot.MainSlot, RoF2Slot.SubSlot, RoF2Slot.AugSlot, RoF2Slot.Unknown01); return RoF2Slot; } - static inline structs::MainInvItemSlotStruct ServerToRoF2MainInvSlot(uint32 ServerSlot) + static inline structs::MainInvItemSlotStruct ServerToRoF2MainInvSlot(uint32 serverSlot) { structs::MainInvItemSlotStruct RoF2Slot; RoF2Slot.MainSlot = INVALID_INDEX; @@ -5710,16 +5710,16 @@ namespace RoF2 uint32 TempSlot = 0; - if (ServerSlot < 56 || ServerSlot == MainPowerSource) { // (< 52) - RoF2Slot.MainSlot = ServerSlot; + if (serverSlot < 56 || serverSlot == MainPowerSource) { // (< 52) + RoF2Slot.MainSlot = serverSlot; - if (ServerSlot == MainPowerSource) + if (serverSlot == MainPowerSource) RoF2Slot.MainSlot = slots::MainPowerSource; - else if (ServerSlot >= MainCursor) // Cursor and Extended Corpse Inventory + else if (serverSlot >= MainCursor) // Cursor and Extended Corpse Inventory RoF2Slot.MainSlot += 3; - else if (ServerSlot >= MainAmmo) // Ammo and Personl Inventory + else if (serverSlot >= MainAmmo) // Ammo and Personl Inventory RoF2Slot.MainSlot += 1; /*else if (ServerSlot >= MainCursor) { // Cursor @@ -5730,33 +5730,33 @@ namespace RoF2 }*/ } - else if (ServerSlot >= EmuConstants::GENERAL_BAGS_BEGIN && ServerSlot <= EmuConstants::CURSOR_BAG_END) { - TempSlot = ServerSlot - 1; + else if (serverSlot >= EmuConstants::GENERAL_BAGS_BEGIN && serverSlot <= EmuConstants::CURSOR_BAG_END) { + TempSlot = serverSlot - 1; RoF2Slot.MainSlot = int(TempSlot / EmuConstants::ITEM_CONTAINER_SIZE) - 2; RoF2Slot.SubSlot = TempSlot - ((RoF2Slot.MainSlot + 2) * EmuConstants::ITEM_CONTAINER_SIZE); } - Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert Server Slot %i to RoF2 Slots: Main %i, Sub %i, Aug %i, Unk1 %i", ServerSlot, RoF2Slot.MainSlot, RoF2Slot.SubSlot, RoF2Slot.AugSlot, RoF2Slot.Unknown01); + Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert Server Slot %i to RoF2 Slots: Main %i, Sub %i, Aug %i, Unk1 %i", serverSlot, RoF2Slot.MainSlot, RoF2Slot.SubSlot, RoF2Slot.AugSlot, RoF2Slot.Unknown01); return RoF2Slot; } - static inline uint32 ServerToRoF2CorpseSlot(uint32 ServerCorpse) + static inline uint32 ServerToRoF2CorpseSlot(uint32 serverCorpseSlot) { - return (ServerCorpse - EmuConstants::CORPSE_BEGIN + 1); + return (serverCorpseSlot - EmuConstants::CORPSE_BEGIN + 1); } - static inline uint32 RoF2ToServerSlot(structs::ItemSlotStruct RoF2Slot, ItemPacketType PacketType) + static inline uint32 RoF2ToServerSlot(structs::ItemSlotStruct rof2Slot, ItemPacketType PacketType) { uint32 ServerSlot = INVALID_INDEX; uint32 TempSlot = 0; - if (RoF2Slot.SlotType == maps::MapPossessions && RoF2Slot.MainSlot < 57) { // Worn/Personal Inventory and Cursor (< 51) - if (RoF2Slot.MainSlot == slots::MainPowerSource) + if (rof2Slot.SlotType == maps::MapPossessions && rof2Slot.MainSlot < 57) { // Worn/Personal Inventory and Cursor (< 51) + if (rof2Slot.MainSlot == slots::MainPowerSource) TempSlot = MainPowerSource; - else if (RoF2Slot.MainSlot >= slots::MainCursor) // Cursor and Extended Corpse Inventory - TempSlot = RoF2Slot.MainSlot - 3; + else if (rof2Slot.MainSlot >= slots::MainCursor) // Cursor and Extended Corpse Inventory + TempSlot = rof2Slot.MainSlot - 3; /*else if (RoF2Slot.MainSlot == slots::MainGeneral9 || RoF2Slot.MainSlot == slots::MainGeneral10) { // 9th and 10th RoF2 inventory/corpse slots // Need to figure out what to do when we get these @@ -5769,61 +5769,61 @@ namespace RoF2 // For now, it's probably best to leave as-is and let this work itself out in the inventory rework. }*/ - else if (RoF2Slot.MainSlot >= slots::MainAmmo) // Ammo and Main Inventory - TempSlot = RoF2Slot.MainSlot - 1; + else if (rof2Slot.MainSlot >= slots::MainAmmo) // Ammo and Main Inventory + TempSlot = rof2Slot.MainSlot - 1; else // Worn Slots - TempSlot = RoF2Slot.MainSlot; + TempSlot = rof2Slot.MainSlot; - if (RoF2Slot.SubSlot >= SUB_BEGIN) // Bag Slots - TempSlot = ((TempSlot + 3) * EmuConstants::ITEM_CONTAINER_SIZE) + RoF2Slot.SubSlot + 1; + if (rof2Slot.SubSlot >= SUB_BEGIN) // Bag Slots + TempSlot = ((TempSlot + 3) * EmuConstants::ITEM_CONTAINER_SIZE) + rof2Slot.SubSlot + 1; ServerSlot = TempSlot; } - else if (RoF2Slot.SlotType == maps::MapBank) { + else if (rof2Slot.SlotType == maps::MapBank) { TempSlot = EmuConstants::BANK_BEGIN; - if (RoF2Slot.SubSlot >= SUB_BEGIN) - TempSlot += ((RoF2Slot.MainSlot + 3) * EmuConstants::ITEM_CONTAINER_SIZE) + RoF2Slot.SubSlot + 1; + if (rof2Slot.SubSlot >= SUB_BEGIN) + TempSlot += ((rof2Slot.MainSlot + 3) * EmuConstants::ITEM_CONTAINER_SIZE) + rof2Slot.SubSlot + 1; else - TempSlot += RoF2Slot.MainSlot; + TempSlot += rof2Slot.MainSlot; ServerSlot = TempSlot; } - else if (RoF2Slot.SlotType == maps::MapSharedBank) { + else if (rof2Slot.SlotType == maps::MapSharedBank) { TempSlot = EmuConstants::SHARED_BANK_BEGIN; - if (RoF2Slot.SubSlot >= SUB_BEGIN) - TempSlot += ((RoF2Slot.MainSlot + 3) * EmuConstants::ITEM_CONTAINER_SIZE) + RoF2Slot.SubSlot + 1; + if (rof2Slot.SubSlot >= SUB_BEGIN) + TempSlot += ((rof2Slot.MainSlot + 3) * EmuConstants::ITEM_CONTAINER_SIZE) + rof2Slot.SubSlot + 1; else - TempSlot += RoF2Slot.MainSlot; + TempSlot += rof2Slot.MainSlot; ServerSlot = TempSlot; } - else if (RoF2Slot.SlotType == maps::MapTrade) { + else if (rof2Slot.SlotType == maps::MapTrade) { TempSlot = EmuConstants::TRADE_BEGIN; - if (RoF2Slot.SubSlot >= SUB_BEGIN) - TempSlot += ((RoF2Slot.MainSlot + 3) * EmuConstants::ITEM_CONTAINER_SIZE) + RoF2Slot.SubSlot + 1; + if (rof2Slot.SubSlot >= SUB_BEGIN) + TempSlot += ((rof2Slot.MainSlot + 3) * EmuConstants::ITEM_CONTAINER_SIZE) + rof2Slot.SubSlot + 1; // OLD CODE: //TempSlot += 100 + (RoF2Slot.MainSlot * EmuConstants::ITEM_CONTAINER_SIZE) + RoF2Slot.SubSlot; else - TempSlot += RoF2Slot.MainSlot; + TempSlot += rof2Slot.MainSlot; ServerSlot = TempSlot; } - else if (RoF2Slot.SlotType == maps::MapWorld) { + else if (rof2Slot.SlotType == maps::MapWorld) { TempSlot = EmuConstants::WORLD_BEGIN; - if (RoF2Slot.MainSlot >= SUB_BEGIN) - TempSlot += RoF2Slot.MainSlot; + if (rof2Slot.MainSlot >= SUB_BEGIN) + TempSlot += rof2Slot.MainSlot; ServerSlot = TempSlot; } @@ -5837,30 +5837,30 @@ namespace RoF2 ServerSlot = TempSlot; }*/ - else if (RoF2Slot.SlotType == maps::MapGuildTribute) { + else if (rof2Slot.SlotType == maps::MapGuildTribute) { ServerSlot = INVALID_INDEX; } - else if (RoF2Slot.SlotType == maps::MapCorpse) { - ServerSlot = RoF2Slot.MainSlot + EmuConstants::CORPSE_BEGIN; + else if (rof2Slot.SlotType == maps::MapCorpse) { + ServerSlot = rof2Slot.MainSlot + EmuConstants::CORPSE_BEGIN; } - Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert RoF2 Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", RoF2Slot.SlotType, RoF2Slot.Unknown02, RoF2Slot.MainSlot, RoF2Slot.SubSlot, RoF2Slot.AugSlot, RoF2Slot.Unknown01, ServerSlot); + Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert RoF2 Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", rof2Slot.SlotType, rof2Slot.Unknown02, rof2Slot.MainSlot, rof2Slot.SubSlot, rof2Slot.AugSlot, rof2Slot.Unknown01, ServerSlot); return ServerSlot; } - static inline uint32 RoF2ToServerMainInvSlot(structs::MainInvItemSlotStruct RoF2Slot) + static inline uint32 RoF2ToServerMainInvSlot(structs::MainInvItemSlotStruct rof2Slot) { uint32 ServerSlot = INVALID_INDEX; uint32 TempSlot = 0; - if (RoF2Slot.MainSlot < 57) { // Worn/Personal Inventory and Cursor (< 33) - if (RoF2Slot.MainSlot == slots::MainPowerSource) + if (rof2Slot.MainSlot < 57) { // Worn/Personal Inventory and Cursor (< 33) + if (rof2Slot.MainSlot == slots::MainPowerSource) TempSlot = MainPowerSource; - else if (RoF2Slot.MainSlot >= slots::MainCursor) // Cursor and Extended Corpse Inventory - TempSlot = RoF2Slot.MainSlot - 3; + else if (rof2Slot.MainSlot >= slots::MainCursor) // Cursor and Extended Corpse Inventory + TempSlot = rof2Slot.MainSlot - 3; /*else if (RoF2Slot.MainSlot == slots::MainGeneral9 || RoF2Slot.MainSlot == slots::MainGeneral10) { // 9th and 10th RoF2 inventory slots // Need to figure out what to do when we get these @@ -5868,26 +5868,26 @@ namespace RoF2 // Same as above }*/ - else if (RoF2Slot.MainSlot >= slots::MainAmmo) // Main Inventory and Ammo Slots - TempSlot = RoF2Slot.MainSlot - 1; + else if (rof2Slot.MainSlot >= slots::MainAmmo) // Main Inventory and Ammo Slots + TempSlot = rof2Slot.MainSlot - 1; else - TempSlot = RoF2Slot.MainSlot; + TempSlot = rof2Slot.MainSlot; - if (RoF2Slot.SubSlot >= SUB_BEGIN) // Bag Slots - TempSlot = ((TempSlot + 3) * EmuConstants::ITEM_CONTAINER_SIZE) + RoF2Slot.SubSlot + 1; + if (rof2Slot.SubSlot >= SUB_BEGIN) // Bag Slots + TempSlot = ((TempSlot + 3) * EmuConstants::ITEM_CONTAINER_SIZE) + rof2Slot.SubSlot + 1; ServerSlot = TempSlot; } - Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert RoF2 Slots: Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", RoF2Slot.MainSlot, RoF2Slot.SubSlot, RoF2Slot.AugSlot, RoF2Slot.Unknown01, ServerSlot); + Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert RoF2 Slots: Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", rof2Slot.MainSlot, rof2Slot.SubSlot, rof2Slot.AugSlot, rof2Slot.Unknown01, ServerSlot); return ServerSlot; } - static inline uint32 RoF2ToServerCorpseSlot(uint32 RoF2Corpse) + static inline uint32 RoF2ToServerCorpseSlot(uint32 rof2CorpseSlot) { - return (RoF2Corpse + EmuConstants::CORPSE_BEGIN - 1); + return (rof2CorpseSlot + EmuConstants::CORPSE_BEGIN - 1); } static inline void ServerToRoF2TextLink(std::string& rof2TextLink, const std::string& serverTextLink) diff --git a/common/patches/rof2.h b/common/patches/rof2.h index 888fb3308..8644473db 100644 --- a/common/patches/rof2.h +++ b/common/patches/rof2.h @@ -1,5 +1,5 @@ -#ifndef RoF2_H_ -#define RoF2_H_ +#ifndef ROF2_H_ +#define ROF2_H_ #include "../struct_strategy.h" @@ -32,6 +32,4 @@ namespace RoF2 { }; - - -#endif /*RoF2_H_*/ +#endif /*ROF2_H_*/ diff --git a/common/patches/rof2_constants.h b/common/patches/rof2_constants.h index b4cbb15e0..ca59511a1 100644 --- a/common/patches/rof2_constants.h +++ b/common/patches/rof2_constants.h @@ -19,8 +19,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef RoF2_CONSTANTS_H_ -#define RoF2_CONSTANTS_H_ +#ifndef ROF2_CONSTANTS_H_ +#define ROF2_CONSTANTS_H_ #include "../types.h" @@ -193,7 +193,7 @@ namespace RoF2 { }; //end namespace RoF2 -#endif /*RoF2_CONSTANTS_H_*/ +#endif /*ROF2_CONSTANTS_H_*/ /* RoF2 Notes: diff --git a/common/patches/rof2_itemfields.h b/common/patches/rof2_itemfields.h index b7b2223d3..0a3211898 100644 --- a/common/patches/rof2_itemfields.h +++ b/common/patches/rof2_itemfields.h @@ -439,4 +439,3 @@ These fields must be in the order of how they are serialized! #undef C #undef S #undef F - diff --git a/common/patches/rof2_ops.h b/common/patches/rof2_ops.h index c2a1bb5e6..aa5656f2b 100644 --- a/common/patches/rof2_ops.h +++ b/common/patches/rof2_ops.h @@ -174,5 +174,6 @@ D(OP_WhoAllRequest) D(OP_ZoneChange) D(OP_ZoneEntry) // End RoF Encodes/Decodes + #undef E #undef D diff --git a/common/patches/rof2_structs.h b/common/patches/rof2_structs.h index baf067bbf..d3b3a852d 100644 --- a/common/patches/rof2_structs.h +++ b/common/patches/rof2_structs.h @@ -1,5 +1,5 @@ -#ifndef RoF2_STRUCTS_H_ -#define RoF2_STRUCTS_H_ +#ifndef ROF2_STRUCTS_H_ +#define ROF2_STRUCTS_H_ namespace RoF2 { namespace structs { @@ -4881,4 +4881,4 @@ struct MercenaryMerchantResponse_Struct { }; //end namespace structs }; //end namespace RoF2 -#endif /*RoF2_STRUCTS_H_*/ +#endif /*ROF2_STRUCTS_H_*/ diff --git a/common/patches/rof_constants.h b/common/patches/rof_constants.h index 233a1b36c..92c019bad 100644 --- a/common/patches/rof_constants.h +++ b/common/patches/rof_constants.h @@ -19,8 +19,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef RoF_CONSTANTS_H_ -#define RoF_CONSTANTS_H_ +#ifndef ROF_CONSTANTS_H_ +#define ROF_CONSTANTS_H_ #include "../types.h" @@ -192,7 +192,7 @@ namespace RoF { }; //end namespace RoF -#endif /*RoF_CONSTANTS_H_*/ +#endif /*ROF_CONSTANTS_H_*/ /* RoF Notes: diff --git a/common/patches/rof_itemfields.h b/common/patches/rof_itemfields.h index b7b2223d3..0a3211898 100644 --- a/common/patches/rof_itemfields.h +++ b/common/patches/rof_itemfields.h @@ -439,4 +439,3 @@ These fields must be in the order of how they are serialized! #undef C #undef S #undef F - diff --git a/common/patches/rof_ops.h b/common/patches/rof_ops.h index ce994ea11..8c55cd857 100644 --- a/common/patches/rof_ops.h +++ b/common/patches/rof_ops.h @@ -162,5 +162,6 @@ D(OP_TributeItem) D(OP_WhoAllRequest) D(OP_ZoneChange) D(OP_ZoneEntry) + #undef E #undef D diff --git a/common/patches/rof_structs.h b/common/patches/rof_structs.h index fb2f09615..b2c1c3c6c 100644 --- a/common/patches/rof_structs.h +++ b/common/patches/rof_structs.h @@ -1,5 +1,5 @@ -#ifndef RoF_STRUCTS_H_ -#define RoF_STRUCTS_H_ +#ifndef ROF_STRUCTS_H_ +#define ROF_STRUCTS_H_ namespace RoF { namespace structs { @@ -4897,4 +4897,4 @@ struct MercenaryMerchantResponse_Struct { }; //end namespace structs }; //end namespace RoF -#endif /*RoF_STRUCTS_H_*/ +#endif /*ROF_STRUCTS_H_*/ diff --git a/common/patches/sod.cpp b/common/patches/sod.cpp index 7a67e56c3..2e96719be 100644 --- a/common/patches/sod.cpp +++ b/common/patches/sod.cpp @@ -26,11 +26,11 @@ namespace SoD // server to client inventory location converters static inline uint32 ServerToSoDSlot(uint32 ServerSlot); - static inline uint32 ServerToSoDCorpseSlot(uint32 ServerCorpse); + static inline uint32 ServerToSoDCorpseSlot(uint32 serverCorpseSlot); // client to server inventory location converters - static inline uint32 SoDToServerSlot(uint32 SoDSlot); - static inline uint32 SoDToServerCorpseSlot(uint32 SoDCorpse); + static inline uint32 SoDToServerSlot(uint32 sodSlot); + static inline uint32 SoDToServerCorpseSlot(uint32 sodCorpseSlot); // server to client text link converter static inline void ServerToSoDTextLink(std::string& sodTextLink, const std::string& serverTextLink); @@ -3242,7 +3242,7 @@ namespace SoD DECODE_LENGTH_EXACT(structs::MoveItem_Struct); SETUP_DIRECT_DECODE(MoveItem_Struct, structs::MoveItem_Struct); - Log.Out(Logs::General, Logs::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot, eq->to_slot); + Log.Out(Logs::General, Logs::Netcode, "[SoD] Moved item from %u to %u", eq->from_slot, eq->to_slot); emu->from_slot = SoDToServerSlot(eq->from_slot); emu->to_slot = SoDToServerSlot(eq->to_slot); @@ -3961,54 +3961,54 @@ namespace SoD return item_serial; } - static inline uint32 ServerToSoDSlot(uint32 ServerSlot) + static inline uint32 ServerToSoDSlot(uint32 serverSlot) { uint32 SoDSlot = 0; - if (ServerSlot >= MainAmmo && ServerSlot <= 53) // Cursor/Ammo/Power Source and Normal Inventory Slots - SoDSlot = ServerSlot + 1; - else if (ServerSlot >= EmuConstants::GENERAL_BAGS_BEGIN && ServerSlot <= EmuConstants::CURSOR_BAG_END) - SoDSlot = ServerSlot + 11; - else if (ServerSlot >= EmuConstants::BANK_BAGS_BEGIN && ServerSlot <= EmuConstants::BANK_BAGS_END) - SoDSlot = ServerSlot + 1; - else if (ServerSlot >= EmuConstants::SHARED_BANK_BAGS_BEGIN && ServerSlot <= EmuConstants::SHARED_BANK_BAGS_END) - SoDSlot = ServerSlot + 1; - else if (ServerSlot == MainPowerSource) + if (serverSlot >= MainAmmo && serverSlot <= 53) // Cursor/Ammo/Power Source and Normal Inventory Slots + SoDSlot = serverSlot + 1; + else if (serverSlot >= EmuConstants::GENERAL_BAGS_BEGIN && serverSlot <= EmuConstants::CURSOR_BAG_END) + SoDSlot = serverSlot + 11; + else if (serverSlot >= EmuConstants::BANK_BAGS_BEGIN && serverSlot <= EmuConstants::BANK_BAGS_END) + SoDSlot = serverSlot + 1; + else if (serverSlot >= EmuConstants::SHARED_BANK_BAGS_BEGIN && serverSlot <= EmuConstants::SHARED_BANK_BAGS_END) + SoDSlot = serverSlot + 1; + else if (serverSlot == MainPowerSource) SoDSlot = slots::MainPowerSource; else - SoDSlot = ServerSlot; + SoDSlot = serverSlot; return SoDSlot; } - static inline uint32 ServerToSoDCorpseSlot(uint32 ServerCorpse) + static inline uint32 ServerToSoDCorpseSlot(uint32 serverCorpseSlot) { //uint32 SoDCorpse; - return (ServerCorpse + 1); + return (serverCorpseSlot + 1); } - static inline uint32 SoDToServerSlot(uint32 SoDSlot) + static inline uint32 SoDToServerSlot(uint32 sodSlot) { uint32 ServerSlot = 0; - if (SoDSlot >= slots::MainAmmo && SoDSlot <= consts::CORPSE_END) // Cursor/Ammo/Power Source and Normal Inventory Slots - ServerSlot = SoDSlot - 1; - else if (SoDSlot >= consts::GENERAL_BAGS_BEGIN && SoDSlot <= consts::CURSOR_BAG_END) - ServerSlot = SoDSlot - 11; - else if (SoDSlot >= consts::BANK_BAGS_BEGIN && SoDSlot <= consts::BANK_BAGS_END) - ServerSlot = SoDSlot - 1; - else if (SoDSlot >= consts::SHARED_BANK_BAGS_BEGIN && SoDSlot <= consts::SHARED_BANK_BAGS_END) - ServerSlot = SoDSlot - 1; - else if (SoDSlot == slots::MainPowerSource) + if (sodSlot >= slots::MainAmmo && sodSlot <= consts::CORPSE_END) // Cursor/Ammo/Power Source and Normal Inventory Slots + ServerSlot = sodSlot - 1; + else if (sodSlot >= consts::GENERAL_BAGS_BEGIN && sodSlot <= consts::CURSOR_BAG_END) + ServerSlot = sodSlot - 11; + else if (sodSlot >= consts::BANK_BAGS_BEGIN && sodSlot <= consts::BANK_BAGS_END) + ServerSlot = sodSlot - 1; + else if (sodSlot >= consts::SHARED_BANK_BAGS_BEGIN && sodSlot <= consts::SHARED_BANK_BAGS_END) + ServerSlot = sodSlot - 1; + else if (sodSlot == slots::MainPowerSource) ServerSlot = MainPowerSource; else - ServerSlot = SoDSlot; + ServerSlot = sodSlot; return ServerSlot; } - static inline uint32 SoDToServerCorpseSlot(uint32 SoDCorpse) + static inline uint32 SoDToServerCorpseSlot(uint32 sodCorpseSlot) { //uint32 ServerCorpse; - return (SoDCorpse - 1); + return (sodCorpseSlot - 1); } static inline void ServerToSoDTextLink(std::string& sodTextLink, const std::string& serverTextLink) diff --git a/common/patches/sod.h b/common/patches/sod.h index 9935cbf2f..65d7f951a 100644 --- a/common/patches/sod.h +++ b/common/patches/sod.h @@ -1,5 +1,5 @@ -#ifndef SoD_H_ -#define SoD_H_ +#ifndef SOD_H_ +#define SOD_H_ #include "../struct_strategy.h" @@ -32,6 +32,4 @@ namespace SoD { }; - - -#endif /*SoD_H_*/ +#endif /*SOD_H_*/ diff --git a/common/patches/sod_constants.h b/common/patches/sod_constants.h index 89749fd56..7731d1d1f 100644 --- a/common/patches/sod_constants.h +++ b/common/patches/sod_constants.h @@ -19,8 +19,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef SoD_CONSTANTS_H_ -#define SoD_CONSTANTS_H_ +#ifndef SOD_CONSTANTS_H_ +#define SOD_CONSTANTS_H_ #include "../types.h" @@ -189,7 +189,7 @@ namespace SoD { }; //end namespace SoD -#endif /*SoD_CONSTANTS_H_*/ +#endif /*SOD_CONSTANTS_H_*/ /* SoD Notes: diff --git a/common/patches/sod_itemfields.h b/common/patches/sod_itemfields.h index ccba333b5..5f8c09354 100644 --- a/common/patches/sod_itemfields.h +++ b/common/patches/sod_itemfields.h @@ -436,4 +436,3 @@ These fields must be in the order of how they are serialized! #undef C #undef S #undef F - diff --git a/common/patches/sod_ops.h b/common/patches/sod_ops.h index 3ce2ac2cb..f599885c1 100644 --- a/common/patches/sod_ops.h +++ b/common/patches/sod_ops.h @@ -120,5 +120,6 @@ D(OP_TradeSkillCombine) D(OP_TributeItem) D(OP_WearChange) D(OP_WhoAllRequest) + #undef E #undef D diff --git a/common/patches/sod_structs.h b/common/patches/sod_structs.h index 24ed9c7cc..46cfa871e 100644 --- a/common/patches/sod_structs.h +++ b/common/patches/sod_structs.h @@ -1,5 +1,5 @@ -#ifndef SoD_STRUCTS_H_ -#define SoD_STRUCTS_H_ +#ifndef SOD_STRUCTS_H_ +#define SOD_STRUCTS_H_ namespace SoD { namespace structs { @@ -4412,4 +4412,4 @@ struct MercenaryAssign_Struct { }; //end namespace structs }; //end namespace SoD -#endif /*SoD_STRUCTS_H_*/ +#endif /*SOD_STRUCTS_H_*/ diff --git a/common/patches/sof.cpp b/common/patches/sof.cpp index 094023317..44a87d3cc 100644 --- a/common/patches/sof.cpp +++ b/common/patches/sof.cpp @@ -25,12 +25,12 @@ namespace SoF char* SerializeItem(const ItemInst *inst, int16 slot_id, uint32 *length, uint8 depth); // server to client inventory location converters - static inline uint32 ServerToSoFSlot(uint32 ServerSlot); - static inline uint32 ServerToSoFCorpseSlot(uint32 ServerCorpse); + static inline uint32 ServerToSoFSlot(uint32 serverSlot); + static inline uint32 ServerToSoFCorpseSlot(uint32 serverCorpseSlot); // client to server inventory location converters - static inline uint32 SoFToServerSlot(uint32 SoFSlot); - static inline uint32 SoFToServerCorpseSlot(uint32 SoFCorpse); + static inline uint32 SoFToServerSlot(uint32 sofSlot); + static inline uint32 SoFToServerCorpseSlot(uint32 sofCorpseSlot); // server to client text link converter static inline void ServerToSoFTextLink(std::string& sofTextLink, const std::string& serverTextLink); @@ -2580,7 +2580,7 @@ namespace SoF DECODE_LENGTH_EXACT(structs::MoveItem_Struct); SETUP_DIRECT_DECODE(MoveItem_Struct, structs::MoveItem_Struct); - Log.Out(Logs::General, Logs::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot, eq->to_slot); + Log.Out(Logs::General, Logs::Netcode, "[SoF] Moved item from %u to %u", eq->from_slot, eq->to_slot); emu->from_slot = SoFToServerSlot(eq->from_slot); emu->to_slot = SoFToServerSlot(eq->to_slot); @@ -3281,56 +3281,56 @@ namespace SoF return item_serial; } - static inline uint32 ServerToSoFSlot(uint32 ServerSlot) + static inline uint32 ServerToSoFSlot(uint32 serverSlot) { uint32 SoFSlot = 0; - if (ServerSlot >= MainAmmo && ServerSlot <= 53) // Cursor/Ammo/Power Source and Normal Inventory Slots - SoFSlot = ServerSlot + 1; - else if (ServerSlot >= EmuConstants::GENERAL_BAGS_BEGIN && ServerSlot <= EmuConstants::CURSOR_BAG_END) - SoFSlot = ServerSlot + 11; - else if (ServerSlot >= EmuConstants::BANK_BAGS_BEGIN && ServerSlot <= EmuConstants::BANK_BAGS_END) - SoFSlot = ServerSlot + 1; - else if (ServerSlot >= EmuConstants::SHARED_BANK_BAGS_BEGIN && ServerSlot <= EmuConstants::SHARED_BANK_BAGS_END) - SoFSlot = ServerSlot + 1; - else if (ServerSlot == MainPowerSource) + if (serverSlot >= MainAmmo && serverSlot <= 53) // Cursor/Ammo/Power Source and Normal Inventory Slots + SoFSlot = serverSlot + 1; + else if (serverSlot >= EmuConstants::GENERAL_BAGS_BEGIN && serverSlot <= EmuConstants::CURSOR_BAG_END) + SoFSlot = serverSlot + 11; + else if (serverSlot >= EmuConstants::BANK_BAGS_BEGIN && serverSlot <= EmuConstants::BANK_BAGS_END) + SoFSlot = serverSlot + 1; + else if (serverSlot >= EmuConstants::SHARED_BANK_BAGS_BEGIN && serverSlot <= EmuConstants::SHARED_BANK_BAGS_END) + SoFSlot = serverSlot + 1; + else if (serverSlot == MainPowerSource) SoFSlot = slots::MainPowerSource; else - SoFSlot = ServerSlot; + SoFSlot = serverSlot; return SoFSlot; } - static inline uint32 ServerToSoFCorpseSlot(uint32 ServerCorpse) + static inline uint32 ServerToSoFCorpseSlot(uint32 serverCorpseSlot) { //uint32 SoFCorpse; - return (ServerCorpse + 1); + return (serverCorpseSlot + 1); } - static inline uint32 SoFToServerSlot(uint32 SoFSlot) + static inline uint32 SoFToServerSlot(uint32 sofSlot) { uint32 ServerSlot = 0; - if (SoFSlot >= slots::MainAmmo && SoFSlot <= consts::CORPSE_END) // Cursor/Ammo/Power Source and Normal Inventory Slots - ServerSlot = SoFSlot - 1; - else if (SoFSlot >= consts::GENERAL_BAGS_BEGIN && SoFSlot <= consts::CURSOR_BAG_END) - ServerSlot = SoFSlot - 11; - else if (SoFSlot >= consts::BANK_BAGS_BEGIN && SoFSlot <= consts::BANK_BAGS_END) - ServerSlot = SoFSlot - 1; - else if (SoFSlot >= consts::SHARED_BANK_BAGS_BEGIN && SoFSlot <= consts::SHARED_BANK_BAGS_END) - ServerSlot = SoFSlot - 1; - else if (SoFSlot == slots::MainPowerSource) + if (sofSlot >= slots::MainAmmo && sofSlot <= consts::CORPSE_END) // Cursor/Ammo/Power Source and Normal Inventory Slots + ServerSlot = sofSlot - 1; + else if (sofSlot >= consts::GENERAL_BAGS_BEGIN && sofSlot <= consts::CURSOR_BAG_END) + ServerSlot = sofSlot - 11; + else if (sofSlot >= consts::BANK_BAGS_BEGIN && sofSlot <= consts::BANK_BAGS_END) + ServerSlot = sofSlot - 1; + else if (sofSlot >= consts::SHARED_BANK_BAGS_BEGIN && sofSlot <= consts::SHARED_BANK_BAGS_END) + ServerSlot = sofSlot - 1; + else if (sofSlot == slots::MainPowerSource) ServerSlot = MainPowerSource; else - ServerSlot = SoFSlot; + ServerSlot = sofSlot; return ServerSlot; } - static inline uint32 SoFToServerCorpseSlot(uint32 SoFCorpse) + static inline uint32 SoFToServerCorpseSlot(uint32 sofCorpseSlot) { //uint32 ServerCorpse; - return (SoFCorpse - 1); + return (sofCorpseSlot - 1); } static inline void ServerToSoFTextLink(std::string& sofTextLink, const std::string& serverTextLink) diff --git a/common/patches/sof.h b/common/patches/sof.h index 15b9aa90c..6a67009d1 100644 --- a/common/patches/sof.h +++ b/common/patches/sof.h @@ -1,5 +1,5 @@ -#ifndef SoF_H_ -#define SoF_H_ +#ifndef SOF_H_ +#define SOF_H_ #include "../struct_strategy.h" @@ -32,6 +32,4 @@ namespace SoF { }; - - -#endif /*SoF_H_*/ +#endif /*SOF_H_*/ diff --git a/common/patches/sof_constants.h b/common/patches/sof_constants.h index 5e0f4b18a..b20e57196 100644 --- a/common/patches/sof_constants.h +++ b/common/patches/sof_constants.h @@ -19,8 +19,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef SoF_CONSTANTS_H_ -#define SoF_CONSTANTS_H_ +#ifndef SOF_CONSTANTS_H_ +#define SOF_CONSTANTS_H_ #include "../types.h" @@ -189,7 +189,7 @@ namespace SoF { }; //end namespace SoF -#endif /*SoF_CONSTANTS_H_*/ +#endif /*SOF_CONSTANTS_H_*/ /* SoF Notes: diff --git a/common/patches/sof_itemfields.h b/common/patches/sof_itemfields.h index ccba333b5..5f8c09354 100644 --- a/common/patches/sof_itemfields.h +++ b/common/patches/sof_itemfields.h @@ -436,4 +436,3 @@ These fields must be in the order of how they are serialized! #undef C #undef S #undef F - diff --git a/common/patches/sof_opcode_list.h b/common/patches/sof_opcode_list.h index 15236862f..b52e973ad 100644 --- a/common/patches/sof_opcode_list.h +++ b/common/patches/sof_opcode_list.h @@ -1226,4 +1226,3 @@ 0xFFFFFFFF, // 1217 (0x4c1) opcodes counted - diff --git a/common/patches/sof_ops.h b/common/patches/sof_ops.h index 14ad69a8b..f7077f05b 100644 --- a/common/patches/sof_ops.h +++ b/common/patches/sof_ops.h @@ -103,5 +103,6 @@ D(OP_TradeSkillCombine) D(OP_TributeItem) D(OP_WearChange) D(OP_WhoAllRequest) + #undef E #undef D diff --git a/common/patches/sof_structs.h b/common/patches/sof_structs.h index 4e84998b7..c5b354ca1 100644 --- a/common/patches/sof_structs.h +++ b/common/patches/sof_structs.h @@ -1,5 +1,5 @@ -#ifndef SoF_STRUCTS_H_ -#define SoF_STRUCTS_H_ +#ifndef SOF_STRUCTS_H_ +#define SOF_STRUCTS_H_ namespace SoF { namespace structs { @@ -4118,4 +4118,4 @@ struct AltCurrencySellItem_Struct { }; //end namespace structs }; //end namespace SoF -#endif /*SoF_STRUCTS_H_*/ +#endif /*SOF_STRUCTS_H_*/ diff --git a/common/patches/titanium.cpp b/common/patches/titanium.cpp index 09e8b22fd..aa5d3d7fb 100644 --- a/common/patches/titanium.cpp +++ b/common/patches/titanium.cpp @@ -23,12 +23,12 @@ namespace Titanium char* SerializeItem(const ItemInst *inst, int16 slot_id_in, uint32 *length, uint8 depth); // server to client inventory location converters - static inline int16 ServerToTitaniumSlot(uint32 ServerSlot); - static inline int16 ServerToTitaniumCorpseSlot(uint32 ServerCorpse); + static inline int16 ServerToTitaniumSlot(uint32 serverSlot); + static inline int16 ServerToTitaniumCorpseSlot(uint32 serverCorpseSlot); // client to server inventory location converters - static inline uint32 TitaniumToServerSlot(int16 TitaniumSlot); - static inline uint32 TitaniumToServerCorpseSlot(int16 TitaniumCorpse); + static inline uint32 TitaniumToServerSlot(int16 titaniumSlot); + static inline uint32 TitaniumToServerCorpseSlot(int16 titaniumCorpseSlot); // server to client text link converter static inline void ServerToTitaniumTextLink(std::string& titaniumTextLink, const std::string& serverTextLink); @@ -113,7 +113,7 @@ namespace Titanium const ClientVersion Strategy::GetClientVersion() const { - return ClientVersion::Tit; + return ClientVersion::Titanium; } #include "ss_define.h" @@ -1774,7 +1774,7 @@ namespace Titanium DECODE_LENGTH_EXACT(structs::MoveItem_Struct); SETUP_DIRECT_DECODE(MoveItem_Struct, structs::MoveItem_Struct); - Log.Out(Logs::General, Logs::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot, eq->to_slot); + Log.Out(Logs::General, Logs::Netcode, "[Titanium] Moved item from %u to %u", eq->from_slot, eq->to_slot); emu->from_slot = TitaniumToServerSlot(eq->from_slot); emu->to_slot = TitaniumToServerSlot(eq->to_slot); @@ -2062,34 +2062,34 @@ namespace Titanium return serialization; } - static inline int16 ServerToTitaniumSlot(uint32 ServerSlot) + static inline int16 ServerToTitaniumSlot(uint32 serverSlot) { //int16 TitaniumSlot; - if (ServerSlot == INVALID_INDEX) + if (serverSlot == INVALID_INDEX) return INVALID_INDEX; - return ServerSlot; // deprecated + return serverSlot; // deprecated } - static inline int16 ServerToTitaniumCorpseSlot(uint32 ServerCorpse) + static inline int16 ServerToTitaniumCorpseSlot(uint32 serverCorpseSlot) { //int16 TitaniumCorpse; - return ServerCorpse; + return serverCorpseSlot; } - static inline uint32 TitaniumToServerSlot(int16 TitaniumSlot) + static inline uint32 TitaniumToServerSlot(int16 titaniumSlot) { //uint32 ServerSlot; - if (TitaniumSlot == INVALID_INDEX) + if (titaniumSlot == INVALID_INDEX) return INVALID_INDEX; - return TitaniumSlot; // deprecated + return titaniumSlot; // deprecated } - static inline uint32 TitaniumToServerCorpseSlot(int16 TitaniumCorpse) + static inline uint32 TitaniumToServerCorpseSlot(int16 titaniumCorpseSlot) { //uint32 ServerCorpse; - return TitaniumCorpse; + return titaniumCorpseSlot; } static inline void ServerToTitaniumTextLink(std::string& titaniumTextLink, const std::string& serverTextLink) diff --git a/common/patches/titanium.h b/common/patches/titanium.h index de8131545..4b5164330 100644 --- a/common/patches/titanium.h +++ b/common/patches/titanium.h @@ -1,5 +1,5 @@ -#ifndef Titanium_H_ -#define Titanium_H_ +#ifndef TITANIUM_H_ +#define TITANIUM_H_ #include "../struct_strategy.h" @@ -32,6 +32,4 @@ namespace Titanium { }; - - -#endif /*Titanium_H_*/ +#endif /*TITANIUM_H_*/ diff --git a/common/patches/titanium_constants.h b/common/patches/titanium_constants.h index ff44513c2..15338e220 100644 --- a/common/patches/titanium_constants.h +++ b/common/patches/titanium_constants.h @@ -19,8 +19,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef Titanium_CONSTANTS_H_ -#define Titanium_CONSTANTS_H_ +#ifndef TITANIUM_CONSTANTS_H_ +#define TITANIUM_CONSTANTS_H_ #include "../types.h" @@ -188,7 +188,7 @@ namespace Titanium { }; //end namespace Titanium -#endif /*Titanium_CONSTANTS_H_*/ +#endif /*TITANIUM_CONSTANTS_H_*/ /* Titanium Notes: diff --git a/common/patches/titanium_itemfields.h b/common/patches/titanium_itemfields.h index 8030de887..dc87a714e 100644 --- a/common/patches/titanium_itemfields.h +++ b/common/patches/titanium_itemfields.h @@ -167,8 +167,8 @@ These fields must be in the order of how they are serialized! /* 156 */ I(Scroll.Level2) /* 157 */ I(Scroll.Level) /* 158 */ C("0") + #undef I #undef C #undef S #undef F - diff --git a/common/patches/titanium_ops.h b/common/patches/titanium_ops.h index 88c12e3ac..3d8dfbf79 100644 --- a/common/patches/titanium_ops.h +++ b/common/patches/titanium_ops.h @@ -75,5 +75,6 @@ D(OP_TradeSkillCombine) D(OP_TributeItem) D(OP_WearChange) D(OP_WhoAllRequest) + #undef E #undef D diff --git a/common/patches/titanium_structs.h b/common/patches/titanium_structs.h index 7d21ba998..54aae91ec 100644 --- a/common/patches/titanium_structs.h +++ b/common/patches/titanium_structs.h @@ -1,5 +1,5 @@ -#ifndef Titanium_STRUCTS_H_ -#define Titanium_STRUCTS_H_ +#ifndef TITANIUM_STRUCTS_H_ +#define TITANIUM_STRUCTS_H_ namespace Titanium { namespace structs { @@ -3332,4 +3332,4 @@ struct LFGuild_GuildToggle_Struct }; //end namespace structs }; //end namespace Titanium -#endif /*Titanium_STRUCTS_H_*/ +#endif /*TITANIUM_STRUCTS_H_*/ diff --git a/common/patches/underfoot.cpp b/common/patches/uf.cpp similarity index 94% rename from common/patches/underfoot.cpp rename to common/patches/uf.cpp index b3fa83419..3f297534d 100644 --- a/common/patches/underfoot.cpp +++ b/common/patches/uf.cpp @@ -1,6 +1,6 @@ #include "../global_define.h" #include "../eqemu_logsys.h" -#include "underfoot.h" +#include "uf.h" #include "../opcodemgr.h" #include "../eq_stream_ident.h" @@ -10,33 +10,33 @@ #include "../misc_functions.h" #include "../string_util.h" #include "../item.h" -#include "underfoot_structs.h" +#include "uf_structs.h" #include "../rulesys.h" #include #include -namespace Underfoot +namespace UF { - static const char *name = "Underfoot"; + static const char *name = "UF"; static OpcodeManager *opcodes = nullptr; static Strategy struct_strategy; char* SerializeItem(const ItemInst *inst, int16 slot_id, uint32 *length, uint8 depth); // server to client inventory location converters - static inline uint32 ServerToUnderfootSlot(uint32 ServerSlot); - static inline uint32 ServerToUnderFootCorpseSlot(uint32 ServerCorpse); + static inline uint32 ServerToUFSlot(uint32 serverSlot); + static inline uint32 ServerToUFCorpseSlot(uint32 serverCorpseSlot); // client to server inventory location converters - static inline uint32 UnderfootToServerSlot(uint32 UnderfootSlot); - static inline uint32 UnderfootToServerCorpseSlot(uint32 UnderfootCorpse); + static inline uint32 UFToServerSlot(uint32 ufSlot); + static inline uint32 UFToServerCorpseSlot(uint32 ufCorpseSlot); // server to client text link converter - static inline void ServerToUnderfootTextLink(std::string& underfootTextLink, const std::string& serverTextLink); + static inline void ServerToUFTextLink(std::string& ufTextLink, const std::string& serverTextLink); // client to server text link converter - static inline void UnderfootToServerTextLink(std::string& serverTextLink, const std::string& underfootTextLink); + static inline void UFToServerTextLink(std::string& serverTextLink, const std::string& ufTextLink); void Register(EQStreamIdentifier &into) { @@ -102,7 +102,7 @@ namespace Underfoot { //all opcodes default to passthrough. #include "ss_register.h" -#include "underfoot_ops.h" +#include "uf_ops.h" } std::string Strategy::Describe() const @@ -115,7 +115,7 @@ namespace Underfoot const ClientVersion Strategy::GetClientVersion() const { - return ClientVersion::Und; + return ClientVersion::UF; } #include "ss_define.h" @@ -164,7 +164,7 @@ namespace Underfoot eq->unknown000 = 1; OUT(npcid); - eq->slot = ServerToUnderfootSlot(emu->slot); + eq->slot = ServerToUFSlot(emu->slot); OUT(charges); OUT(sell_price); @@ -215,7 +215,7 @@ namespace Underfoot SETUP_DIRECT_ENCODE(AltCurrencySellItem_Struct, structs::AltCurrencySellItem_Struct); OUT(merchant_entity_id); - eq->slot_id = ServerToUnderfootSlot(emu->slot_id); + eq->slot_id = ServerToUFSlot(emu->slot_id); OUT(charges); OUT(cost); @@ -227,7 +227,7 @@ namespace Underfoot ENCODE_LENGTH_EXACT(ApplyPoison_Struct); SETUP_DIRECT_ENCODE(ApplyPoison_Struct, structs::ApplyPoison_Struct); - eq->inventorySlot = ServerToUnderfootSlot(emu->inventorySlot); + eq->inventorySlot = ServerToUFSlot(emu->inventorySlot); OUT(success); FINISH_ENCODE(); @@ -441,7 +441,7 @@ namespace Underfoot std::string old_message = emu->message; std::string new_message; - ServerToUnderfootTextLink(new_message, old_message); + ServerToUFTextLink(new_message, old_message); //in->size = strlen(emu->sender) + 1 + strlen(emu->targetname) + 1 + strlen(emu->message) + 1 + 36; in->size = strlen(emu->sender) + strlen(emu->targetname) + new_message.length() + 39; @@ -593,8 +593,8 @@ namespace Underfoot ENCODE_LENGTH_EXACT(DeleteItem_Struct); SETUP_DIRECT_ENCODE(DeleteItem_Struct, structs::DeleteItem_Struct); - eq->from_slot = ServerToUnderfootSlot(emu->from_slot); - eq->to_slot = ServerToUnderfootSlot(emu->to_slot); + eq->from_slot = ServerToUFSlot(emu->from_slot); + eq->to_slot = ServerToUFSlot(emu->to_slot); OUT(number_in_stack); FINISH_ENCODE(); @@ -755,7 +755,7 @@ namespace Underfoot std::string old_message = emu->message; std::string new_message; - ServerToUnderfootTextLink(new_message, old_message); + ServerToUFTextLink(new_message, old_message); //if (new_message.length() > 512) // length restricted in packet building function due vari-length name size (no nullterm) // new_message = new_message.substr(0, 512); @@ -807,7 +807,7 @@ namespace Underfoot for (int i = 0; i < 9; ++i) { if (old_message_array[i].length() == 0) { break; } - ServerToUnderfootTextLink(new_message_array[i], old_message_array[i]); + ServerToUFTextLink(new_message_array[i], old_message_array[i]); new_message_size += new_message_array[i].length() + 1; } @@ -1287,7 +1287,7 @@ namespace Underfoot ENCODE_LENGTH_EXACT(ItemVerifyReply_Struct); SETUP_DIRECT_ENCODE(ItemVerifyReply_Struct, structs::ItemVerifyReply_Struct); - eq->slot = ServerToUnderfootSlot(emu->slot); + eq->slot = ServerToUFSlot(emu->slot); OUT(spell); OUT(target); @@ -1344,7 +1344,7 @@ namespace Underfoot OUT(lootee); OUT(looter); - eq->slot_id = ServerToUnderFootCorpseSlot(emu->slot_id); + eq->slot_id = ServerToUFCorpseSlot(emu->slot_id); OUT(auto_loot); FINISH_ENCODE(); @@ -1506,8 +1506,8 @@ namespace Underfoot ENCODE_LENGTH_EXACT(MoveItem_Struct); SETUP_DIRECT_ENCODE(MoveItem_Struct, structs::MoveItem_Struct); - eq->from_slot = ServerToUnderfootSlot(emu->from_slot); - eq->to_slot = ServerToUnderfootSlot(emu->to_slot); + eq->from_slot = ServerToUFSlot(emu->from_slot); + eq->to_slot = ServerToUFSlot(emu->to_slot); OUT(number_in_stack); FINISH_ENCODE(); @@ -2093,7 +2093,7 @@ namespace Underfoot else eq->window = emu->window; OUT(type); - eq->invslot = ServerToUnderfootSlot(emu->invslot); + eq->invslot = ServerToUFSlot(emu->invslot); strn0cpy(eq->txtfile, emu->booktext, sizeof(eq->txtfile)); FINISH_ENCODE(); @@ -2290,7 +2290,7 @@ namespace Underfoot SETUP_DIRECT_ENCODE(Merchant_Purchase_Struct, structs::Merchant_Purchase_Struct); OUT(npcid); - eq->itemslot = ServerToUnderfootSlot(emu->itemslot); + eq->itemslot = ServerToUFSlot(emu->itemslot); OUT(quantity); OUT(price); @@ -2399,7 +2399,7 @@ namespace Underfoot std::string old_message = &emu->message[strlen(emu->sayer)]; std::string new_message; - ServerToUnderfootTextLink(new_message, old_message); + ServerToUFTextLink(new_message, old_message); //in->size = 3 + 4 + 4 + strlen(emu->sayer) + 1 + 12 + new_message.length() + 1; in->size = strlen(emu->sayer) + new_message.length() + 25; @@ -2469,7 +2469,7 @@ namespace Underfoot std::string old_message = InBuffer; // start 'Reward' as string std::string new_message; - ServerToUnderfootTextLink(new_message, old_message); + ServerToUFTextLink(new_message, old_message); in->size = sizeof(TaskDescriptionHeader_Struct) + sizeof(TaskDescriptionData1_Struct)+ sizeof(TaskDescriptionData2_Struct) + sizeof(TaskDescriptionTrailer_Struct)+ @@ -2570,7 +2570,7 @@ namespace Underfoot ENCODE_LENGTH_EXACT(TributeItem_Struct); SETUP_DIRECT_ENCODE(TributeItem_Struct, structs::TributeItem_Struct); - eq->slot = ServerToUnderfootSlot(emu->slot); + eq->slot = ServerToUFSlot(emu->slot); OUT(quantity); OUT(tribute_master_id); OUT(tribute_points); @@ -3060,7 +3060,7 @@ namespace Underfoot SETUP_DIRECT_DECODE(Adventure_Sell_Struct, structs::Adventure_Sell_Struct); IN(npcid); - emu->slot = UnderfootToServerSlot(eq->slot); + emu->slot = UFToServerSlot(eq->slot); IN(charges); IN(sell_price); @@ -3073,7 +3073,7 @@ namespace Underfoot SETUP_DIRECT_DECODE(AltCurrencySellItem_Struct, structs::AltCurrencySellItem_Struct); IN(merchant_entity_id); - emu->slot_id = UnderfootToServerSlot(eq->slot_id); + emu->slot_id = UFToServerSlot(eq->slot_id); IN(charges); IN(cost); @@ -3086,7 +3086,7 @@ namespace Underfoot SETUP_DIRECT_DECODE(AltCurrencySelectItem_Struct, structs::AltCurrencySelectItem_Struct); IN(merchant_entity_id); - emu->slot_id = UnderfootToServerSlot(eq->slot_id); + emu->slot_id = UFToServerSlot(eq->slot_id); FINISH_DIRECT_DECODE(); } @@ -3096,7 +3096,7 @@ namespace Underfoot DECODE_LENGTH_EXACT(structs::ApplyPoison_Struct); SETUP_DIRECT_DECODE(ApplyPoison_Struct, structs::ApplyPoison_Struct); - emu->inventorySlot = UnderfootToServerSlot(eq->inventorySlot); + emu->inventorySlot = UFToServerSlot(eq->inventorySlot); IN(success); FINISH_DIRECT_DECODE(); @@ -3118,7 +3118,7 @@ namespace Underfoot DECODE_LENGTH_EXACT(structs::AugmentItem_Struct); SETUP_DIRECT_DECODE(AugmentItem_Struct, structs::AugmentItem_Struct); - emu->container_slot = UnderfootToServerSlot(eq->container_slot); + emu->container_slot = UFToServerSlot(eq->container_slot); emu->augment_slot = eq->augment_slot; FINISH_DIRECT_DECODE(); @@ -3184,7 +3184,7 @@ namespace Underfoot IN(slot); IN(spell_id); - emu->inventoryslot = UnderfootToServerSlot(eq->inventoryslot); + emu->inventoryslot = UFToServerSlot(eq->inventoryslot); IN(target_id); IN(cs_unknown1); IN(cs_unknown2); @@ -3218,7 +3218,7 @@ namespace Underfoot std::string old_message = InBuffer; std::string new_message; - UnderfootToServerTextLink(new_message, old_message); + UFToServerTextLink(new_message, old_message); //__packet->size = sizeof(ChannelMessage_Struct)+strlen(InBuffer) + 1; __packet->size = sizeof(ChannelMessage_Struct) + new_message.length() + 1; @@ -3312,7 +3312,7 @@ namespace Underfoot DECODE_LENGTH_EXACT(structs::Consume_Struct); SETUP_DIRECT_DECODE(Consume_Struct, structs::Consume_Struct); - emu->slot = UnderfootToServerSlot(eq->slot); + emu->slot = UFToServerSlot(eq->slot); IN(auto_consumed); IN(type); @@ -3339,8 +3339,8 @@ namespace Underfoot DECODE_LENGTH_EXACT(structs::DeleteItem_Struct); SETUP_DIRECT_DECODE(DeleteItem_Struct, structs::DeleteItem_Struct); - emu->from_slot = UnderfootToServerSlot(eq->from_slot); - emu->to_slot = UnderfootToServerSlot(eq->to_slot); + emu->from_slot = UFToServerSlot(eq->from_slot); + emu->to_slot = UFToServerSlot(eq->to_slot); IN(number_in_stack); FINISH_DIRECT_DECODE(); @@ -3352,7 +3352,7 @@ namespace Underfoot std::string old_message = (char *)&__eq_buffer[4]; // unknown01 offset std::string new_message; - UnderfootToServerTextLink(new_message, old_message); + UFToServerTextLink(new_message, old_message); __packet->size = sizeof(Emote_Struct); __packet->pBuffer = new unsigned char[__packet->size]; @@ -3519,7 +3519,7 @@ namespace Underfoot DECODE_LENGTH_EXACT(structs::ItemVerifyRequest_Struct); SETUP_DIRECT_DECODE(ItemVerifyRequest_Struct, structs::ItemVerifyRequest_Struct); - emu->slot = UnderfootToServerSlot(eq->slot); + emu->slot = UFToServerSlot(eq->slot); IN(target); FINISH_DIRECT_DECODE(); @@ -3546,7 +3546,7 @@ namespace Underfoot IN(lootee); IN(looter); - emu->slot_id = UnderfootToServerCorpseSlot(eq->slot_id); + emu->slot_id = UFToServerCorpseSlot(eq->slot_id); IN(auto_loot); FINISH_DIRECT_DECODE(); @@ -3557,10 +3557,10 @@ namespace Underfoot DECODE_LENGTH_EXACT(structs::MoveItem_Struct); SETUP_DIRECT_DECODE(MoveItem_Struct, structs::MoveItem_Struct); - Log.Out(Logs::General, Logs::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot, eq->to_slot); + Log.Out(Logs::General, Logs::Netcode, "[UF] Moved item from %u to %u", eq->from_slot, eq->to_slot); - emu->from_slot = UnderfootToServerSlot(eq->from_slot); - emu->to_slot = UnderfootToServerSlot(eq->to_slot); + emu->from_slot = UFToServerSlot(eq->from_slot); + emu->to_slot = UFToServerSlot(eq->to_slot); IN(number_in_stack); FINISH_DIRECT_DECODE(); @@ -3622,7 +3622,7 @@ namespace Underfoot SETUP_DIRECT_DECODE(BookRequest_Struct, structs::BookRequest_Struct); IN(type); - emu->invslot = UnderfootToServerSlot(eq->invslot); + emu->invslot = UFToServerSlot(eq->invslot); emu->window = (uint8)eq->window; strn0cpy(emu->txtfile, eq->txtfile, sizeof(emu->txtfile)); @@ -3672,7 +3672,7 @@ namespace Underfoot SETUP_DIRECT_DECODE(Merchant_Purchase_Struct, structs::Merchant_Purchase_Struct); IN(npcid); - emu->itemslot = UnderfootToServerSlot(eq->itemslot); + emu->itemslot = UFToServerSlot(eq->itemslot); IN(quantity); IN(price); @@ -3700,7 +3700,7 @@ namespace Underfoot DECODE_LENGTH_EXACT(structs::NewCombine_Struct); SETUP_DIRECT_DECODE(NewCombine_Struct, structs::NewCombine_Struct); - emu->container_slot = UnderfootToServerSlot(eq->container_slot); + emu->container_slot = UFToServerSlot(eq->container_slot); IN(guildtribute_slot); FINISH_DIRECT_DECODE(); @@ -3711,7 +3711,7 @@ namespace Underfoot DECODE_LENGTH_EXACT(structs::TributeItem_Struct); SETUP_DIRECT_DECODE(TributeItem_Struct, structs::TributeItem_Struct); - emu->slot = UnderfootToServerSlot(eq->slot); + emu->slot = UFToServerSlot(eq->slot); IN(quantity); IN(tribute_master_id); IN(tribute_points); @@ -3781,11 +3781,11 @@ namespace Underfoot const Item_Struct *item = inst->GetUnscaledItem(); //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Serialize called for: %s", item->Name); - Underfoot::structs::ItemSerializationHeader hdr; + UF::structs::ItemSerializationHeader hdr; hdr.stacksize = stackable ? charges : 1; hdr.unknown004 = 0; - int32 slot_id = ServerToUnderfootSlot(slot_id_in); + int32 slot_id = ServerToUFSlot(slot_id_in); hdr.slot = (merchant_slot == 0) ? slot_id : merchant_slot; hdr.price = inst->GetPrice(); @@ -3800,10 +3800,10 @@ namespace Underfoot hdr.unknown048 = 0; hdr.unknown052 = 0; hdr.isEvolving = item->EvolvingLevel > 0 ? 1 : 0; - ss.write((const char*)&hdr, sizeof(Underfoot::structs::ItemSerializationHeader)); + ss.write((const char*)&hdr, sizeof(UF::structs::ItemSerializationHeader)); if (item->EvolvingLevel > 0) { - Underfoot::structs::EvolvingItem evotop; + UF::structs::EvolvingItem evotop; evotop.unknown001 = 0; evotop.unknown002 = 0; evotop.unknown003 = 0; @@ -3812,7 +3812,7 @@ namespace Underfoot evotop.progress = 95.512; evotop.Activated = 1; evotop.evomaxlevel = 7; - ss.write((const char*)&evotop, sizeof(Underfoot::structs::EvolvingItem)); + ss.write((const char*)&evotop, sizeof(UF::structs::EvolvingItem)); } //ORNAMENT IDFILE / ICON - uint16 ornaIcon = 0; @@ -3832,13 +3832,13 @@ namespace Underfoot ss.write((const char*)&null_term, sizeof(uint8)); //no idfile } - Underfoot::structs::ItemSerializationHeaderFinish hdrf; + UF::structs::ItemSerializationHeaderFinish hdrf; hdrf.ornamentIcon = ornaIcon; hdrf.unknown060 = 0; //This is Always 0.. or it breaks shit.. hdrf.unknown061 = 0; //possibly ornament / special ornament hdrf.isCopied = 0; //Flag for item to be 'Copied' hdrf.ItemClass = item->ItemClass; - ss.write((const char*)&hdrf, sizeof(Underfoot::structs::ItemSerializationHeaderFinish)); + ss.write((const char*)&hdrf, sizeof(UF::structs::ItemSerializationHeaderFinish)); if (strlen(item->Name) > 0) { @@ -3870,8 +3870,8 @@ namespace Underfoot ss.write((const char*)&null_term, sizeof(uint8)); } - Underfoot::structs::ItemBodyStruct ibs; - memset(&ibs, 0, sizeof(Underfoot::structs::ItemBodyStruct)); + UF::structs::ItemBodyStruct ibs; + memset(&ibs, 0, sizeof(UF::structs::ItemBodyStruct)); ibs.id = item->ID; ibs.weight = item->Weight; @@ -3956,7 +3956,7 @@ namespace Underfoot ibs.FactionAmt4 = item->FactionAmt4; ibs.FactionMod4 = item->FactionMod4; - ss.write((const char*)&ibs, sizeof(Underfoot::structs::ItemBodyStruct)); + ss.write((const char*)&ibs, sizeof(UF::structs::ItemBodyStruct)); //charm text if (strlen(item->CharmFile) > 0) @@ -3969,8 +3969,8 @@ namespace Underfoot ss.write((const char*)&null_term, sizeof(uint8)); } - Underfoot::structs::ItemSecondaryBodyStruct isbs; - memset(&isbs, 0, sizeof(Underfoot::structs::ItemSecondaryBodyStruct)); + UF::structs::ItemSecondaryBodyStruct isbs; + memset(&isbs, 0, sizeof(UF::structs::ItemSecondaryBodyStruct)); isbs.augtype = item->AugType; isbs.augrestrict = item->AugRestrict; @@ -3996,7 +3996,7 @@ namespace Underfoot isbs.book = item->Book; isbs.booktype = item->BookType; - ss.write((const char*)&isbs, sizeof(Underfoot::structs::ItemSecondaryBodyStruct)); + ss.write((const char*)&isbs, sizeof(UF::structs::ItemSecondaryBodyStruct)); if (strlen(item->Filename) > 0) { @@ -4008,8 +4008,8 @@ namespace Underfoot ss.write((const char*)&null_term, sizeof(uint8)); } - Underfoot::structs::ItemTertiaryBodyStruct itbs; - memset(&itbs, 0, sizeof(Underfoot::structs::ItemTertiaryBodyStruct)); + UF::structs::ItemTertiaryBodyStruct itbs; + memset(&itbs, 0, sizeof(UF::structs::ItemTertiaryBodyStruct)); itbs.loregroup = item->LoreGroup; itbs.artifact = item->ArtifactFlag; @@ -4030,13 +4030,13 @@ namespace Underfoot itbs.no_transfer = item->NoTransfer; itbs.expendablearrow = item->ExpendableArrow; - ss.write((const char*)&itbs, sizeof(Underfoot::structs::ItemTertiaryBodyStruct)); + ss.write((const char*)&itbs, sizeof(UF::structs::ItemTertiaryBodyStruct)); // Effect Structures Broken down to allow variable length strings for effect names int32 effect_unknown = 0; - Underfoot::structs::ClickEffectStruct ices; - memset(&ices, 0, sizeof(Underfoot::structs::ClickEffectStruct)); + UF::structs::ClickEffectStruct ices; + memset(&ices, 0, sizeof(UF::structs::ClickEffectStruct)); ices.effect = item->Click.Effect; ices.level2 = item->Click.Level2; @@ -4047,7 +4047,7 @@ namespace Underfoot ices.recast = item->RecastDelay; ices.recast_type = item->RecastType; - ss.write((const char*)&ices, sizeof(Underfoot::structs::ClickEffectStruct)); + ss.write((const char*)&ices, sizeof(UF::structs::ClickEffectStruct)); if (strlen(item->ClickName) > 0) { @@ -4061,8 +4061,8 @@ namespace Underfoot ss.write((const char*)&effect_unknown, sizeof(int32)); // clickunk7 - Underfoot::structs::ProcEffectStruct ipes; - memset(&ipes, 0, sizeof(Underfoot::structs::ProcEffectStruct)); + UF::structs::ProcEffectStruct ipes; + memset(&ipes, 0, sizeof(UF::structs::ProcEffectStruct)); ipes.effect = item->Proc.Effect; ipes.level2 = item->Proc.Level2; @@ -4070,7 +4070,7 @@ namespace Underfoot ipes.level = item->Proc.Level; ipes.procrate = item->ProcRate; - ss.write((const char*)&ipes, sizeof(Underfoot::structs::ProcEffectStruct)); + ss.write((const char*)&ipes, sizeof(UF::structs::ProcEffectStruct)); if (strlen(item->ProcName) > 0) { @@ -4084,15 +4084,15 @@ namespace Underfoot ss.write((const char*)&effect_unknown, sizeof(int32)); // unknown5 - Underfoot::structs::WornEffectStruct iwes; - memset(&iwes, 0, sizeof(Underfoot::structs::WornEffectStruct)); + UF::structs::WornEffectStruct iwes; + memset(&iwes, 0, sizeof(UF::structs::WornEffectStruct)); iwes.effect = item->Worn.Effect; iwes.level2 = item->Worn.Level2; iwes.type = item->Worn.Type; iwes.level = item->Worn.Level; - ss.write((const char*)&iwes, sizeof(Underfoot::structs::WornEffectStruct)); + ss.write((const char*)&iwes, sizeof(UF::structs::WornEffectStruct)); if (strlen(item->WornName) > 0) { @@ -4106,15 +4106,15 @@ namespace Underfoot ss.write((const char*)&effect_unknown, sizeof(int32)); // unknown6 - Underfoot::structs::WornEffectStruct ifes; - memset(&ifes, 0, sizeof(Underfoot::structs::WornEffectStruct)); + UF::structs::WornEffectStruct ifes; + memset(&ifes, 0, sizeof(UF::structs::WornEffectStruct)); ifes.effect = item->Focus.Effect; ifes.level2 = item->Focus.Level2; ifes.type = item->Focus.Type; ifes.level = item->Focus.Level; - ss.write((const char*)&ifes, sizeof(Underfoot::structs::WornEffectStruct)); + ss.write((const char*)&ifes, sizeof(UF::structs::WornEffectStruct)); if (strlen(item->FocusName) > 0) { @@ -4128,15 +4128,15 @@ namespace Underfoot ss.write((const char*)&effect_unknown, sizeof(int32)); // unknown6 - Underfoot::structs::WornEffectStruct ises; - memset(&ises, 0, sizeof(Underfoot::structs::WornEffectStruct)); + UF::structs::WornEffectStruct ises; + memset(&ises, 0, sizeof(UF::structs::WornEffectStruct)); ises.effect = item->Scroll.Effect; ises.level2 = item->Scroll.Level2; ises.type = item->Scroll.Type; ises.level = item->Scroll.Level; - ss.write((const char*)&ises, sizeof(Underfoot::structs::WornEffectStruct)); + ss.write((const char*)&ises, sizeof(UF::structs::WornEffectStruct)); if (strlen(item->ScrollName) > 0) { @@ -4151,8 +4151,8 @@ namespace Underfoot ss.write((const char*)&effect_unknown, sizeof(int32)); // unknown6 // Bard Effect? - Underfoot::structs::WornEffectStruct ibes; - memset(&ibes, 0, sizeof(Underfoot::structs::WornEffectStruct)); + UF::structs::WornEffectStruct ibes; + memset(&ibes, 0, sizeof(UF::structs::WornEffectStruct)); ibes.effect = item->Bard.Effect; ibes.level2 = item->Bard.Level2; @@ -4160,7 +4160,7 @@ namespace Underfoot ibes.level = item->Bard.Level; //ibes.unknown6 = 0xffffffff; - ss.write((const char*)&ibes, sizeof(Underfoot::structs::WornEffectStruct)); + ss.write((const char*)&ibes, sizeof(UF::structs::WornEffectStruct)); /* if(strlen(item->BardName) > 0) @@ -4174,8 +4174,8 @@ namespace Underfoot ss.write((const char*)&effect_unknown, sizeof(int32)); // unknown6 // End of Effects - Underfoot::structs::ItemQuaternaryBodyStruct iqbs; - memset(&iqbs, 0, sizeof(Underfoot::structs::ItemQuaternaryBodyStruct)); + UF::structs::ItemQuaternaryBodyStruct iqbs; + memset(&iqbs, 0, sizeof(UF::structs::ItemQuaternaryBodyStruct)); iqbs.scriptfileid = item->ScriptFileID; iqbs.quest_item = item->QuestItemFlag; @@ -4240,7 +4240,7 @@ namespace Underfoot } } - ss.write((const char*)&iqbs, sizeof(Underfoot::structs::ItemQuaternaryBodyStruct)); + ss.write((const char*)&iqbs, sizeof(UF::structs::ItemQuaternaryBodyStruct)); for (int x = 0; x < 10; ++x) { @@ -4262,62 +4262,62 @@ namespace Underfoot return item_serial; } - static inline uint32 ServerToUnderfootSlot(uint32 ServerSlot) + static inline uint32 ServerToUFSlot(uint32 serverSlot) { uint32 UnderfootSlot = 0; - if (ServerSlot >= MainAmmo && ServerSlot <= 53) // Cursor/Ammo/Power Source and Normal Inventory Slots - UnderfootSlot = ServerSlot + 1; - else if (ServerSlot >= EmuConstants::GENERAL_BAGS_BEGIN && ServerSlot <= EmuConstants::CURSOR_BAG_END) - UnderfootSlot = ServerSlot + 11; - else if (ServerSlot >= EmuConstants::BANK_BAGS_BEGIN && ServerSlot <= EmuConstants::BANK_BAGS_END) - UnderfootSlot = ServerSlot + 1; - else if (ServerSlot >= EmuConstants::SHARED_BANK_BAGS_BEGIN && ServerSlot <= EmuConstants::SHARED_BANK_BAGS_END) - UnderfootSlot = ServerSlot + 1; - else if (ServerSlot == MainPowerSource) + if (serverSlot >= MainAmmo && serverSlot <= 53) // Cursor/Ammo/Power Source and Normal Inventory Slots + UnderfootSlot = serverSlot + 1; + else if (serverSlot >= EmuConstants::GENERAL_BAGS_BEGIN && serverSlot <= EmuConstants::CURSOR_BAG_END) + UnderfootSlot = serverSlot + 11; + else if (serverSlot >= EmuConstants::BANK_BAGS_BEGIN && serverSlot <= EmuConstants::BANK_BAGS_END) + UnderfootSlot = serverSlot + 1; + else if (serverSlot >= EmuConstants::SHARED_BANK_BAGS_BEGIN && serverSlot <= EmuConstants::SHARED_BANK_BAGS_END) + UnderfootSlot = serverSlot + 1; + else if (serverSlot == MainPowerSource) UnderfootSlot = slots::MainPowerSource; else - UnderfootSlot = ServerSlot; + UnderfootSlot = serverSlot; return UnderfootSlot; } - static inline uint32 ServerToUnderFootCorpseSlot(uint32 ServerCorpse) + static inline uint32 ServerToUFCorpseSlot(uint32 serverCorpseSlot) { //uint32 UnderfootCorpse; - return (ServerCorpse + 1); + return (serverCorpseSlot + 1); } - static inline uint32 UnderfootToServerSlot(uint32 UnderfootSlot) + static inline uint32 UFToServerSlot(uint32 ufSlot) { uint32 ServerSlot = 0; - if (UnderfootSlot >= slots::MainAmmo && UnderfootSlot <= consts::CORPSE_END) // Cursor/Ammo/Power Source and Normal Inventory Slots - ServerSlot = UnderfootSlot - 1; - else if (UnderfootSlot >= consts::GENERAL_BAGS_BEGIN && UnderfootSlot <= consts::CURSOR_BAG_END) - ServerSlot = UnderfootSlot - 11; - else if (UnderfootSlot >= consts::BANK_BAGS_BEGIN && UnderfootSlot <= consts::BANK_BAGS_END) - ServerSlot = UnderfootSlot - 1; - else if (UnderfootSlot >= consts::SHARED_BANK_BAGS_BEGIN && UnderfootSlot <= consts::SHARED_BANK_BAGS_END) - ServerSlot = UnderfootSlot - 1; - else if (UnderfootSlot == slots::MainPowerSource) + if (ufSlot >= slots::MainAmmo && ufSlot <= consts::CORPSE_END) // Cursor/Ammo/Power Source and Normal Inventory Slots + ServerSlot = ufSlot - 1; + else if (ufSlot >= consts::GENERAL_BAGS_BEGIN && ufSlot <= consts::CURSOR_BAG_END) + ServerSlot = ufSlot - 11; + else if (ufSlot >= consts::BANK_BAGS_BEGIN && ufSlot <= consts::BANK_BAGS_END) + ServerSlot = ufSlot - 1; + else if (ufSlot >= consts::SHARED_BANK_BAGS_BEGIN && ufSlot <= consts::SHARED_BANK_BAGS_END) + ServerSlot = ufSlot - 1; + else if (ufSlot == slots::MainPowerSource) ServerSlot = MainPowerSource; else - ServerSlot = UnderfootSlot; + ServerSlot = ufSlot; return ServerSlot; } - static inline uint32 UnderfootToServerCorpseSlot(uint32 UnderfootCorpse) + static inline uint32 UFToServerCorpseSlot(uint32 ufCorpseSlot) { //uint32 ServerCorpse; - return (UnderfootCorpse - 1); + return (ufCorpseSlot - 1); } - static inline void ServerToUnderfootTextLink(std::string& underfootTextLink, const std::string& serverTextLink) + static inline void ServerToUFTextLink(std::string& ufTextLink, const std::string& serverTextLink) { if ((consts::TEXT_LINK_BODY_LENGTH == EmuConstants::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) { - underfootTextLink = serverTextLink; + ufTextLink = serverTextLink; return; } @@ -4326,7 +4326,7 @@ namespace Underfoot for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) { if (segment_iter & 1) { if (segments[segment_iter].length() <= EmuConstants::TEXT_LINK_BODY_LENGTH) { - underfootTextLink.append(segments[segment_iter]); + ufTextLink.append(segments[segment_iter]); // TODO: log size mismatch error continue; } @@ -4336,32 +4336,32 @@ namespace Underfoot // SoF: X XXXXX XXXXX XXXXX XXXXX XXXXX XXXXX X XXXX X XXXXX XXXXXXXX (50) // Diff: ^^^^^ ^ - underfootTextLink.push_back('\x12'); - underfootTextLink.append(segments[segment_iter].substr(0, 31)); - underfootTextLink.append(segments[segment_iter].substr(36, 5)); + ufTextLink.push_back('\x12'); + ufTextLink.append(segments[segment_iter].substr(0, 31)); + ufTextLink.append(segments[segment_iter].substr(36, 5)); if (segments[segment_iter][41] == '0') - underfootTextLink.push_back(segments[segment_iter][42]); + ufTextLink.push_back(segments[segment_iter][42]); else - underfootTextLink.push_back('F'); + ufTextLink.push_back('F'); - underfootTextLink.append(segments[segment_iter].substr(43)); - underfootTextLink.push_back('\x12'); + ufTextLink.append(segments[segment_iter].substr(43)); + ufTextLink.push_back('\x12'); } else { - underfootTextLink.append(segments[segment_iter]); + ufTextLink.append(segments[segment_iter]); } } } - static inline void UnderfootToServerTextLink(std::string& serverTextLink, const std::string& underfootTextLink) + static inline void UFToServerTextLink(std::string& serverTextLink, const std::string& ufTextLink) { - if ((EmuConstants::TEXT_LINK_BODY_LENGTH == consts::TEXT_LINK_BODY_LENGTH) || (underfootTextLink.find('\x12') == std::string::npos)) { - serverTextLink = underfootTextLink; + if ((EmuConstants::TEXT_LINK_BODY_LENGTH == consts::TEXT_LINK_BODY_LENGTH) || (ufTextLink.find('\x12') == std::string::npos)) { + serverTextLink = ufTextLink; return; } - auto segments = SplitString(underfootTextLink, '\x12'); + auto segments = SplitString(ufTextLink, '\x12'); for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) { if (segment_iter & 1) { @@ -4390,4 +4390,4 @@ namespace Underfoot } } } -// end namespace Underfoot +// end namespace UF diff --git a/common/patches/underfoot.h b/common/patches/uf.h similarity index 82% rename from common/patches/underfoot.h rename to common/patches/uf.h index 4bf00b0e8..26e2346a7 100644 --- a/common/patches/underfoot.h +++ b/common/patches/uf.h @@ -1,11 +1,11 @@ -#ifndef Underfoot_H_ -#define Underfoot_H_ +#ifndef UF_H_ +#define UF_H_ #include "../struct_strategy.h" class EQStreamIdentifier; -namespace Underfoot { +namespace UF { //these are the only public member of this namespace. extern void Register(EQStreamIdentifier &into); @@ -27,11 +27,9 @@ namespace Underfoot { //magic macro to declare our opcode processors #include "ss_declare.h" - #include "underfoot_ops.h" + #include "uf_ops.h" }; }; - - -#endif /*Underfoot_H_*/ +#endif /*UF_H_*/ diff --git a/common/patches/underfoot_constants.h b/common/patches/uf_constants.h similarity index 97% rename from common/patches/underfoot_constants.h rename to common/patches/uf_constants.h index a656c56eb..70b89df18 100644 --- a/common/patches/underfoot_constants.h +++ b/common/patches/uf_constants.h @@ -19,12 +19,12 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef Underfoot_CONSTANTS_H_ -#define Underfoot_CONSTANTS_H_ +#ifndef UF_CONSTANTS_H_ +#define UF_CONSTANTS_H_ #include "../types.h" -namespace Underfoot { +namespace UF { namespace maps { typedef enum : int16 { // this needs work to match actual client equivilents @@ -187,12 +187,12 @@ namespace Underfoot { static const bool COIN_HAS_WEIGHT = false; } -}; //end namespace Underfoot +}; //end namespace UF -#endif /*Underfoot_CONSTANTS_H_*/ +#endif /*UF_CONSTANTS_H_*/ /* -Underfoot Notes: +UF Notes: ** Integer-based inventory ** ok Possessions: 0 - 31 (Corpse: 23 - 54 [Offset 23]) ok [Equipment: 0 - 22] diff --git a/common/patches/underfoot_itemfields.h b/common/patches/uf_itemfields.h similarity index 99% rename from common/patches/underfoot_itemfields.h rename to common/patches/uf_itemfields.h index ccba333b5..5f8c09354 100644 --- a/common/patches/underfoot_itemfields.h +++ b/common/patches/uf_itemfields.h @@ -436,4 +436,3 @@ These fields must be in the order of how they are serialized! #undef C #undef S #undef F - diff --git a/common/patches/underfoot_ops.h b/common/patches/uf_ops.h similarity index 99% rename from common/patches/underfoot_ops.h rename to common/patches/uf_ops.h index 188cf3d9e..7f5f500c5 100644 --- a/common/patches/underfoot_ops.h +++ b/common/patches/uf_ops.h @@ -129,5 +129,6 @@ D(OP_TradeSkillCombine) D(OP_TributeItem) D(OP_WearChange) D(OP_WhoAllRequest) + #undef E #undef D diff --git a/common/patches/underfoot_structs.h b/common/patches/uf_structs.h similarity index 99% rename from common/patches/underfoot_structs.h rename to common/patches/uf_structs.h index 3a63a8c0f..964c0da99 100644 --- a/common/patches/underfoot_structs.h +++ b/common/patches/uf_structs.h @@ -1,7 +1,7 @@ -#ifndef Underfoot_STRUCTS_H_ -#define Underfoot_STRUCTS_H_ +#ifndef UF_STRUCTS_H_ +#define UF_STRUCTS_H_ -namespace Underfoot { +namespace UF { namespace structs { @@ -4531,6 +4531,6 @@ struct MercenaryAssign_Struct { }; }; //end namespace structs -}; //end namespace Underfoot +}; //end namespace UF -#endif /*Underfoot_STRUCTS_H_*/ +#endif /*UF_STRUCTS_H_*/ diff --git a/utils/patches/patch_Underfoot.conf b/utils/patches/patch_UF.conf similarity index 100% rename from utils/patches/patch_Underfoot.conf rename to utils/patches/patch_UF.conf diff --git a/world/client.cpp b/world/client.cpp index 50b56cb0d..32e78175f 100644 --- a/world/client.cpp +++ b/world/client.cpp @@ -845,7 +845,7 @@ bool Client::HandleEnterWorldPacket(const EQApplicationPacket *app) { char ConnectionType; - if(ClientVersionBit & BIT_UnderfootAndLater) + if(ClientVersionBit & BIT_UFAndLater) ConnectionType = 'U'; else if(ClientVersionBit & BIT_SoFAndLater) ConnectionType = 'S'; diff --git a/zone/client.h b/zone/client.h index f7fe0a2f6..49cb56598 100644 --- a/zone/client.h +++ b/zone/client.h @@ -1138,7 +1138,7 @@ public: void HandleLFGuildResponse(ServerPacket *pack); void SendLFGuildStatus(); void SendGuildLFGuildStatus(); - inline bool XTargettingAvailable() const { return ((ClientVersionBit & BIT_UnderfootAndLater) && RuleB(Character, EnableXTargetting)); } + inline bool XTargettingAvailable() const { return ((ClientVersionBit & BIT_UFAndLater) && RuleB(Character, EnableXTargetting)); } inline uint8 GetMaxXTargets() const { return MaxXTargets; } void SetMaxXTargets(uint8 NewMax); bool IsXTarget(const Mob *m) const; diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index 309c273f7..ff701ca16 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -848,7 +848,7 @@ void Client::CompleteConnect() worldserver.SendPacket(pack); delete pack; - if (IsClient() && CastToClient()->GetClientVersionBit() & BIT_UnderfootAndLater) { + if (IsClient() && CastToClient()->GetClientVersionBit() & BIT_UFAndLater) { EQApplicationPacket *outapp = MakeBuffsPacket(false); CastToClient()->FastQueuePacket(&outapp); } @@ -1864,7 +1864,7 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app) safe_delete(outapp); } - if (ClientVersionBit & BIT_UnderfootAndLater) { + if (ClientVersionBit & BIT_UFAndLater) { outapp = new EQApplicationPacket(OP_XTargetResponse, 8); outapp->WriteUInt32(GetMaxXTargets()); outapp->WriteUInt32(0); diff --git a/zone/client_process.cpp b/zone/client_process.cpp index 55d9a9f4e..1f3db5631 100644 --- a/zone/client_process.cpp +++ b/zone/client_process.cpp @@ -2231,7 +2231,7 @@ void Client::ClearHover() entity_list.QueueClients(this, outapp, false); safe_delete(outapp); - if(IsClient() && CastToClient()->GetClientVersionBit() & BIT_UnderfootAndLater) + if(IsClient() && CastToClient()->GetClientVersionBit() & BIT_UFAndLater) { EQApplicationPacket *outapp = MakeBuffsPacket(false); CastToClient()->FastQueuePacket(&outapp); diff --git a/zone/lua_general.cpp b/zone/lua_general.cpp index 70e5c9334..053a928a6 100644 --- a/zone/lua_general.cpp +++ b/zone/lua_general.cpp @@ -1759,12 +1759,11 @@ luabind::scope lua_register_client_version() { .enum_("constants") [ luabind::value("Unknown", static_cast(ClientVersion::Unknown)), - luabind::value("Titanium", static_cast(ClientVersion::Tit)), // deprecated - luabind::value("Tit", static_cast(ClientVersion::Tit)), + luabind::value("Titanium", static_cast(ClientVersion::Titanium)), luabind::value("SoF", static_cast(ClientVersion::SoF)), luabind::value("SoD", static_cast(ClientVersion::SoD)), - luabind::value("Underfoot", static_cast(ClientVersion::Und)), // deprecated - luabind::value("Und", static_cast(ClientVersion::Und)), + luabind::value("Underfoot", static_cast(ClientVersion::UF)), // deprecated + luabind::value("UF", static_cast(ClientVersion::UF)), luabind::value("RoF", static_cast(ClientVersion::RoF)), luabind::value("RoF2", static_cast(ClientVersion::RoF2)) ]; diff --git a/zone/merc.cpp b/zone/merc.cpp index b37e73567..812f3324f 100644 --- a/zone/merc.cpp +++ b/zone/merc.cpp @@ -42,7 +42,7 @@ Merc::Merc(const NPCType* d, float x, float y, float z, float heading) _baseFR = d->FR; _basePR = d->PR; _baseCorrup = d->Corrup; - _OwnerClientVersion = static_cast(ClientVersion::Tit); + _OwnerClientVersion = static_cast(ClientVersion::Titanium); RestRegenHP = 0; RestRegenMana = 0; RestRegenEndurance = 0; diff --git a/zone/spell_effects.cpp b/zone/spell_effects.cpp index 024c938c9..cdcc64488 100644 --- a/zone/spell_effects.cpp +++ b/zone/spell_effects.cpp @@ -134,7 +134,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial) if (spells[spell_id].EndurUpkeep > 0) SetEndurUpkeep(true); - if(IsClient() && CastToClient()->GetClientVersionBit() & BIT_UnderfootAndLater) + if(IsClient() && CastToClient()->GetClientVersionBit() & BIT_UFAndLater) { EQApplicationPacket *outapp = MakeBuffsPacket(false); CastToClient()->FastQueuePacket(&outapp); @@ -3409,7 +3409,7 @@ void Mob::BuffProcess() { CastToClient()->SendBuffDurationPacket(buffs[buffs_i]); // Hack to get UF to play nicer, RoF seems fine without it - if (CastToClient()->GetClientVersion() == ClientVersion::Und && buffs[buffs_i].numhits > 0) + if (CastToClient()->GetClientVersion() == ClientVersion::UF && buffs[buffs_i].numhits > 0) CastToClient()->SendBuffNumHitPacket(buffs[buffs_i], buffs_i); buffs[buffs_i].UpdateClient = false; } @@ -4175,7 +4175,7 @@ void Mob::BuffFadeBySlot(int slot, bool iRecalcBonuses) safe_delete(outapp); } - if(IsClient() && CastToClient()->GetClientVersionBit() & BIT_UnderfootAndLater) + if(IsClient() && CastToClient()->GetClientVersionBit() & BIT_UFAndLater) { EQApplicationPacket *outapp = MakeBuffsPacket(false); CastToClient()->FastQueuePacket(&outapp); diff --git a/zone/spells.cpp b/zone/spells.cpp index 835861f03..2f8010241 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -5248,7 +5248,7 @@ void Client::SendBuffDurationPacket(Buffs_Struct &buff) void Client::SendBuffNumHitPacket(Buffs_Struct &buff, int slot) { // UF+ use this packet - if (GetClientVersion() < ClientVersion::Und) + if (GetClientVersion() < ClientVersion::UF) return; EQApplicationPacket *outapp; outapp = new EQApplicationPacket(OP_BuffCreate, sizeof(BuffIcon_Struct) + sizeof(BuffIconEntry_Struct));