59 lines
1.8 KiB
C++
59 lines
1.8 KiB
C++
#pragma once
|
|
|
|
#include "proxy.h"
|
|
|
|
#include <unordered_set>
|
|
#include <string>
|
|
|
|
#include <mutex>
|
|
|
|
#include <nlohmann/json_fwd.hpp>
|
|
|
|
class Spoofer
|
|
{
|
|
public:
|
|
void init(Proxy* proxy);
|
|
|
|
private:
|
|
void registerListeners(Proxy* proxy);
|
|
void loadData();
|
|
|
|
bool parseCatalog(std::string data);
|
|
bool parseStackable(std::string data, std::unordered_set<std::string>& camperSet,
|
|
std::unordered_set<std::string>& slasherSet);
|
|
|
|
std::string getRandomItem();
|
|
int getRandomQuantity();
|
|
|
|
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 serverResponseHandler(const std::string& url, std::string& body, std::string& respHeaders);
|
|
void clientRequestHandler(std::string& url, const std::string& body, std::string& reqHeaders);
|
|
|
|
std::unordered_set<std::string> _camperItemIds;
|
|
std::unordered_set<std::string> _slasherPowerIds;
|
|
|
|
std::unordered_set<std::string> _camperOfferingIds;
|
|
std::unordered_set<std::string> _slasherOfferingIds;
|
|
|
|
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::string _lastBloodWebChar = "";
|
|
std::mutex _mtx;
|
|
};
|