Advertisement
Guest User

Untitled

a guest
Jan 8th, 2019
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.86 KB | None | 0 0
  1. #include <iostream>
  2. #include <API/ARK/Ark.h>
  3. #include <fstream>
  4. #include <string>
  5. #include <nlohmann/json.hpp>
  6. #pragma comment(lib, "ArkApi.lib")
  7. DECLARE_HOOK(AShooterGameMode_HandleNewPlayer, bool, AShooterGameMode*, AShooterPlayerController*, UPrimalPlayerData*,
  8. AShooterCharacter*, bool);
  9. void GetCallback(bool Success, std::string Result)
  10. bool Hook_AShooterGameMode_HandleNewPlayer(AShooterGameMode* _this, AShooterPlayerController* new_player,
  11. UPrimalPlayerData* player_data, AShooterCharacter* player_character,
  12. bool is_from_login)
  13.  
  14. {
  15. const uint64 steam_id = ArkApi::IApiUtils::GetSteamIdFromController(new_player);
  16.  
  17.  
  18. {
  19.  
  20. Log::GetLog()->info("LenderSteamID: {}", Result);
  21.  
  22. nlohmann::json Json = nlohmann::json::parse(Result);
  23. if (int LenderSteamID; (LenderSteamID = Json["response"].value("lender_steamid", 0)) != 0)
  24. {
  25.  
  26. const auto banned = ArkApi::GetApiUtils().GetShooterGameMode()->BannedMapField();
  27. bool bHas7 = BannedMap.Contains("lender_steamid";
  28. if bHas7 == true
  29. {
  30.  
  31. }
  32.  
  33. }
  34. }
  35.  
  36. API::Requests::Get().CreateGetRequest(fmt::format("http://api.steampowered.com/IPlayerService/IsPlayingSharedGame/v0001/?key=C1steamid={}&appid_playing=346110&format=json", steam_id), &GetCallback);
  37.  
  38.  
  39. }
  40.  
  41.  
  42. void Load()
  43. {
  44. //Load Function
  45. ArkApi::GetHooks().SetHook("AShooterGameMode.HandleNewPlayer_Implementation",
  46. &Hook_AShooterGameMode_HandleNewPlayer,
  47. &AShooterGameMode_HandleNewPlayer_original);
  48.  
  49.  
  50. }
  51. void Unload()
  52. {
  53. //Unload Function
  54. ArkApi::GetHooks().DisableHook("AShooterGameMode.HandleNewPlayer_Implementation",
  55. &Hook_AShooterGameMode_HandleNewPlayer);
  56.  
  57. }
  58.  
  59.  
  60. BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
  61. {
  62. switch (ul_reason_for_call)
  63. {
  64. case DLL_PROCESS_ATTACH:
  65. Load();
  66. break;
  67. case DLL_PROCESS_DETACH:
  68. Unload();
  69. break;
  70. }
  71. return TRUE;
  72. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement