Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a8b5e0148f | |||
| 50413eb420 | |||
| ea49c39e53 | |||
| f599a9a648 |
@@ -14,6 +14,8 @@
|
|||||||
|
|
||||||
#include <nlohmann/json.hpp>
|
#include <nlohmann/json.hpp>
|
||||||
|
|
||||||
|
#define PLACEHOLDER_ITEMID "Anniversary2025Offering"
|
||||||
|
|
||||||
using json = nlohmann::json;
|
using json = nlohmann::json;
|
||||||
|
|
||||||
static std::random_device rd;
|
static std::random_device rd;
|
||||||
@@ -202,7 +204,7 @@ std::string Spoofer::getRandomItem()
|
|||||||
for (auto* s : allSets)
|
for (auto* s : allSets)
|
||||||
if (!s->empty()) validSets.push_back(s);
|
if (!s->empty()) validSets.push_back(s);
|
||||||
|
|
||||||
if (validSets.empty()) return "Spring2024Offering";
|
if (validSets.empty()) return PLACEHOLDER_ITEMID;
|
||||||
|
|
||||||
std::uniform_int_distribution<> setDist(0, static_cast<int>(validSets.size()) - 1);
|
std::uniform_int_distribution<> setDist(0, static_cast<int>(validSets.size()) - 1);
|
||||||
const auto& selectedSet = *validSets[setDist(gen)];
|
const auto& selectedSet = *validSets[setDist(gen)];
|
||||||
@@ -304,10 +306,6 @@ void Spoofer::modifyCharacterData(json& js)
|
|||||||
if (js.contains("bloodWebData")) generateBloodweb(js["bloodWebData"]);
|
if (js.contains("bloodWebData")) generateBloodweb(js["bloodWebData"]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
if (js.value("isEntitled", false) == false) return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
item spoofing
|
item spoofing
|
||||||
@@ -329,9 +327,9 @@ void Spoofer::modifyCharacterData(json& js)
|
|||||||
|
|
||||||
for (auto& item : js["characterItems"])
|
for (auto& item : js["characterItems"])
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
set existing items to rnd number
|
set existing items to rnd number
|
||||||
*/
|
*/
|
||||||
if (item.contains("itemId") && item["itemId"].is_string())
|
if (item.contains("itemId") && item["itemId"].is_string())
|
||||||
{
|
{
|
||||||
std::string itemId = item["itemId"];
|
std::string itemId = item["itemId"];
|
||||||
@@ -541,6 +539,9 @@ void Spoofer::onBloodweb(std::string& body, std::string& respHeaders)
|
|||||||
json doc = json::parse(body, nullptr, false);
|
json doc = json::parse(body, nullptr, false);
|
||||||
if (doc.is_discarded()) return Log::error("JSON parse error for bloodweb response");
|
if (doc.is_discarded()) return Log::error("JSON parse error for bloodweb response");
|
||||||
|
|
||||||
|
/*
|
||||||
|
return fake bloodweb data
|
||||||
|
*/
|
||||||
if (_config.spoofCharacterOwnership)
|
if (_config.spoofCharacterOwnership)
|
||||||
{
|
{
|
||||||
if (body.find("NotAllowedException") != std::string::npos && body.find("not owned") != std::string::npos)
|
if (body.find("NotAllowedException") != std::string::npos && body.find("not owned") != std::string::npos)
|
||||||
@@ -576,6 +577,31 @@ void Spoofer::onBloodweb(std::string& body, std::string& respHeaders)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
bloodweb fixup for perks
|
||||||
|
(if all perks are unlocked, the game will interpret bloodwebs with perks as invalid so perks will be replaced with PLACEHOLDER_ITEMID)
|
||||||
|
*/
|
||||||
|
if (_config.spoofInventory)
|
||||||
|
{
|
||||||
|
if (doc.contains("bloodWebData") && doc["bloodWebData"].contains("ringData"))
|
||||||
|
{
|
||||||
|
for (auto& ring : doc["bloodWebData"]["ringData"])
|
||||||
|
{
|
||||||
|
if (!ring.contains("nodeData")) continue;
|
||||||
|
for (auto& node : ring["nodeData"])
|
||||||
|
{
|
||||||
|
if (!node.contains("contentId")) continue;
|
||||||
|
std::string contentId = node["contentId"];
|
||||||
|
if (_camperPerkIds.contains(contentId) || _slasherPerkIds.contains(contentId))
|
||||||
|
node["contentId"] = PLACEHOLDER_ITEMID;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
prevent bloodweb reqs from overriding inventory values
|
||||||
|
*/
|
||||||
modifyCharacterData(doc);
|
modifyCharacterData(doc);
|
||||||
body = doc.dump();
|
body = doc.dump();
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
|
|||||||
Reference in New Issue
Block a user