Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <API/ARK/Ark.h>
- #include <fstream>
- #include <string>
- #include <nlohmann/json.hpp>
- #pragma comment(lib, "ArkApi.lib")
- DECLARE_HOOK(AShooterGameMode_HandleNewPlayer, bool, AShooterGameMode*, AShooterPlayerController*, UPrimalPlayerData*,
- AShooterCharacter*, bool);
- void GetCallback(bool Success, std::string Result)
- bool Hook_AShooterGameMode_HandleNewPlayer(AShooterGameMode* _this, AShooterPlayerController* new_player,
- UPrimalPlayerData* player_data, AShooterCharacter* player_character,
- bool is_from_login)
- {
- const uint64 steam_id = ArkApi::IApiUtils::GetSteamIdFromController(new_player);
- {
- Log::GetLog()->info("LenderSteamID: {}", Result);
- nlohmann::json Json = nlohmann::json::parse(Result);
- if (int LenderSteamID; (LenderSteamID = Json["response"].value("lender_steamid", 0)) != 0)
- {
- const auto banned = ArkApi::GetApiUtils().GetShooterGameMode()->BannedMapField();
- bool bHas7 = BannedMap.Contains("lender_steamid";
- if bHas7 == true
- {
- }
- }
- }
- API::Requests::Get().CreateGetRequest(fmt::format("http://api.steampowered.com/IPlayerService/IsPlayingSharedGame/v0001/?key=C1steamid={}&appid_playing=346110&format=json", steam_id), &GetCallback);
- }
- void Load()
- {
- //Load Function
- ArkApi::GetHooks().SetHook("AShooterGameMode.HandleNewPlayer_Implementation",
- &Hook_AShooterGameMode_HandleNewPlayer,
- &AShooterGameMode_HandleNewPlayer_original);
- }
- void Unload()
- {
- //Unload Function
- ArkApi::GetHooks().DisableHook("AShooterGameMode.HandleNewPlayer_Implementation",
- &Hook_AShooterGameMode_HandleNewPlayer);
- }
- BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
- {
- switch (ul_reason_for_call)
- {
- case DLL_PROCESS_ATTACH:
- Load();
- break;
- case DLL_PROCESS_DETACH:
- Unload();
- break;
- }
- return TRUE;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement