From fa7c88e2144910e8bd9eb2b4872264efa161f514 Mon Sep 17 00:00:00 2001 From: gsemaj Date: Fri, 16 Apr 2021 13:28:59 -0400 Subject: [PATCH] Rename Vendor.Xpp -> Vendors.Xpp --- Makefile | 4 ++-- src/NPCManager.cpp | 2 +- src/TableData.cpp | 6 +++--- src/{Vendor.cpp => Vendors.cpp} | 12 ++++++------ src/{Vendor.hpp => Vendors.hpp} | 2 +- src/main.cpp | 4 ++-- 6 files changed, 15 insertions(+), 15 deletions(-) rename src/{Vendor.cpp => Vendors.cpp} (97%) rename src/{Vendor.hpp => Vendors.hpp} (93%) diff --git a/Makefile b/Makefile index bb39380..a6b28bf 100644 --- a/Makefile +++ b/Makefile @@ -71,7 +71,7 @@ CXXSRC=\ src/Buddies.cpp\ src/Groups.cpp\ src/Racing.cpp\ - src/Vendor.cpp\ + src/Vendors.cpp\ src/Trading.cpp\ # headers (for timestamp purposes) @@ -115,7 +115,7 @@ CXXHDR=\ src/Buddies.hpp\ src/Groups.hpp\ src/Racing.hpp\ - src/Vendor.hpp\ + src/Vendors.hpp\ src/Trading.hpp\ COBJ=$(CSRC:.c=.o) diff --git a/src/NPCManager.cpp b/src/NPCManager.cpp index bf50a3d..6fc248b 100644 --- a/src/NPCManager.cpp +++ b/src/NPCManager.cpp @@ -8,7 +8,7 @@ #include "TableData.hpp" #include "Groups.hpp" #include "Racing.hpp" -#include "Vendor.hpp" +#include "Vendors.hpp" #include "Abilities.hpp" #include diff --git a/src/TableData.cpp b/src/TableData.cpp index c8822fd..18444dd 100644 --- a/src/TableData.cpp +++ b/src/TableData.cpp @@ -7,7 +7,7 @@ #include "Chunking.hpp" #include "Nanos.hpp" #include "Racing.hpp" -#include "Vendor.hpp" +#include "Vendors.hpp" #include "Abilities.hpp" #include "Eggs.hpp" @@ -708,10 +708,10 @@ void TableData::init() { for (nlohmann::json::iterator _lst = listings.begin(); _lst != listings.end(); _lst++) { auto lst = _lst.value(); VendorListing vListing = { lst["m_iSortNumber"], lst["m_iItemType"], lst["m_iitemID"] }; - Vendor::VendorTables[lst["m_iNpcNumber"]].push_back(vListing); + Vendors::VendorTables[lst["m_iNpcNumber"]].push_back(vListing); } - std::cout << "[INFO] Loaded " << Vendor::VendorTables.size() << " vendor tables" << std::endl; + std::cout << "[INFO] Loaded " << Vendors::VendorTables.size() << " vendor tables" << std::endl; // load crocpot entries nlohmann::json crocs = xdtData["m_pCombiningTable"]["m_pCombiningData"]; diff --git a/src/Vendor.cpp b/src/Vendors.cpp similarity index 97% rename from src/Vendor.cpp rename to src/Vendors.cpp index 1fb9c18..7d6e93f 100644 --- a/src/Vendor.cpp +++ b/src/Vendors.cpp @@ -1,8 +1,8 @@ -#include "Vendor.hpp" +#include "Vendors.hpp" -using namespace Vendor; +using namespace Vendors; -std::map> Vendor::VendorTables; +std::map> Vendors::VendorTables; static void vendorBuy(CNSocket* sock, CNPacketData* data) { auto req = (sP_CL2FE_REQ_PC_VENDOR_ITEM_BUY*)data->buf; @@ -198,10 +198,10 @@ static void vendorBuyback(CNSocket* sock, CNPacketData* data) { static void vendorTable(CNSocket* sock, CNPacketData* data) { auto req = (sP_CL2FE_REQ_PC_VENDOR_TABLE_UPDATE*)data->buf; - if (req->iVendorID != req->iNPC_ID || Vendor::VendorTables.find(req->iVendorID) == Vendor::VendorTables.end()) + if (req->iVendorID != req->iNPC_ID || Vendors::VendorTables.find(req->iVendorID) == Vendors::VendorTables.end()) return; - std::vector listings = Vendor::VendorTables[req->iVendorID]; + std::vector listings = Vendors::VendorTables[req->iVendorID]; INITSTRUCT(sP_FE2CL_REP_PC_VENDOR_TABLE_UPDATE_SUCC, resp); @@ -360,7 +360,7 @@ static void vendorCombineItems(CNSocket* sock, CNPacketData* data) { sock->sendPacket(resp, P_FE2CL_REP_PC_ITEM_COMBINATION_SUCC); } -void Vendor::init() { +void Vendors::init() { REGISTER_SHARD_PACKET(P_CL2FE_REQ_PC_VENDOR_START, vendorStart); REGISTER_SHARD_PACKET(P_CL2FE_REQ_PC_VENDOR_TABLE_UPDATE, vendorTable); REGISTER_SHARD_PACKET(P_CL2FE_REQ_PC_VENDOR_ITEM_BUY, vendorBuy); diff --git a/src/Vendor.hpp b/src/Vendors.hpp similarity index 93% rename from src/Vendor.hpp rename to src/Vendors.hpp index 2a2c72f..225a3c9 100644 --- a/src/Vendor.hpp +++ b/src/Vendors.hpp @@ -10,7 +10,7 @@ struct VendorListing { int sort, type, iID; }; -namespace Vendor { +namespace Vendors { extern std::map> VendorTables; void init(); diff --git a/src/main.cpp b/src/main.cpp index daf2858..cd09be1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -19,7 +19,7 @@ #include "Racing.hpp" #include "Trading.hpp" #include "Email.hpp" -#include "Vendor.hpp" +#include "Vendors.hpp" #include "Chat.hpp" #include "Eggs.hpp" @@ -111,7 +111,7 @@ int main() { Missions::init(); Nanos::init(); NPCManager::init(); - Vendor::init(); + Vendors::init(); Transport::init(); Buddies::init(); Email::init();