84 lines
2.6 KiB
C++
84 lines
2.6 KiB
C++
#pragma once
|
|
|
|
#include "proxy.h"
|
|
|
|
#include <unordered_set>
|
|
#include <string>
|
|
|
|
#include <mutex>
|
|
|
|
#include <nlohmann/json_fwd.hpp>
|
|
|
|
#include "dbdcrypt.h"
|
|
|
|
struct SpooferConfig
|
|
{
|
|
bool spoofCharacterOwnership = true;
|
|
bool spoofInventory = true;
|
|
bool spoofCustomization = true;
|
|
std::string accessKey = ACCESS_KEY;
|
|
std::string keyId = KEY_ID;
|
|
};
|
|
|
|
class Spoofer
|
|
{
|
|
public:
|
|
void init(Proxy* proxy);
|
|
|
|
private:
|
|
void registerListeners(Proxy* proxy);
|
|
void loadData();
|
|
void loadConfig();
|
|
|
|
bool parseStackable(std::string data, std::unordered_set<std::string>* camperSet,
|
|
std::unordered_set<std::string>* slasherSet, std::unordered_set<std::string>* globalSet);
|
|
bool parseCustomizations(std::string data);
|
|
|
|
std::string getRandomItem();
|
|
int getRandomQuantity();
|
|
|
|
void fixBloodweb(nlohmann::json& data);
|
|
void generateBloodweb(nlohmann::json& data);
|
|
|
|
void modifyCharacterData(nlohmann::json& js);
|
|
|
|
void onGetAll(std::string& body);
|
|
void onInventoryAll(std::string& body);
|
|
void onMessageList(std::string& body);
|
|
void onBloodweb(std::string& body, std::string& respHeaders);
|
|
void onUpdateEntitlements(const std::string& url, std::string& body);
|
|
|
|
void onGetAllClient(std::string& body);
|
|
void onBloodwebClient(std::string& body);
|
|
void onUpdateEntitlementsClient(const std::string& url, std::string& body);
|
|
|
|
void serverResponseHandler(const std::string& url, std::string& body, std::string& respHeaders);
|
|
void clientRequestHandler(const std::string& url, std::string& body, std::string& reqHeaders);
|
|
|
|
SpooferConfig _config;
|
|
|
|
std::unordered_set<std::string> _camperItemIds;
|
|
|
|
std::unordered_set<std::string> _camperOfferingIds;
|
|
std::unordered_set<std::string> _slasherOfferingIds;
|
|
std::unordered_set<std::string> _globalOfferingIds;
|
|
|
|
std::unordered_set<std::string> _camperAddonIds;
|
|
std::unordered_set<std::string> _slasherAddonIds;
|
|
|
|
std::unordered_set<std::string> _camperPerkIds;
|
|
std::unordered_set<std::string> _slasherPerkIds;
|
|
|
|
std::unordered_set<std::string> _catalogOutfitIds;
|
|
std::unordered_set<std::string> _catalogItemIds;
|
|
|
|
std::unordered_set<std::string> _unownedCharacters;
|
|
std::unordered_set<std::string> _characterList;
|
|
|
|
std::unordered_set<std::string> _dlcListGRDK;
|
|
std::unordered_set<std::string> _dlcListEGS;
|
|
|
|
std::string _lastBloodWebChar = "";
|
|
std::mutex _mtx;
|
|
};
|