Advertisement
Baoulettes

Dokkan_el

Mar 1st, 2020
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.80 KB | None | 0 0
  1. #include <unidokkan/log.h>
  2. #include <unidokkan/hook.h>
  3. #include <dokkan/crypto.h>
  4. /*{
  5.     "events": [ //Events specified but should fetch all base on id L:10
  6.         {
  7.             "banner_image": "https://www.baoulettes.fr/DokkanEvent/image/quest_list_banner_"+ID+".png",
  8.             "event_image": "https://www.baoulettes.fr/DokkanEvent/image/quest_top_banner_"+ID+".png",
  9.             "minibanner_image": "https://www.baoulettes.fr/DokkanEvent/image/quest_event_banner_"+ID+".png",
  10.             "id": *, //Can be anything from 101 to 549 (testing purpose)
  11.             "quests": [ //Should fetch all possible "name" in this "quests" and set name depending on their id (the best would be to fetch database.db !)
  12.                 {
  13.                     "name": "Event_Name", // Event name usually their id are "id" L:10 and 0xx (xx = 01 to 99 depending the number of stage available)
  14.  
  15.                 }
  16.             ]
  17.         },
  18.     ]
  19. }*/
  20. bool ShowEventsBanners(NetworkRequest *request, NetworkResponse *response, bool &short_circuit) {
  21.     auto json_body      =   UniDokkan::Dokkan::Crypto::DecryptSign(response->jsonBody["sign"]);
  22.         response->jsonBody["banners"][0][5]["banner_image"] =   "https://www.baoulettes.fr/DokkanEvent/image/quest_list_banner_132.png";
  23.         response->jsonBody["banners"][0][5]["event_image"]  =   "https://www.baoulettes.fr/DokkanEvent/image/quest_top_banner_132_category.png";
  24.         response->jsonBody["banners"][0][5]["minibanner_image"] =   "https://www.baoulettes.fr/DokkanEvent/image/quest_event_banner_132.png";
  25.     //if (request->jsonBody["banners"][0]["id"].get<int>() >= 0) {}
  26.     auto debug = response->jsonBody["banners"][0][0]["image"];
  27.     response->jsonBody["sign"] = UniDokkan::Dokkan::Crypto::EncryptSign(json_body);
  28.     return true;
  29. }
  30. extern "C" {
  31.     int unidokkan_init_v2(HookLib* hook_lib) {
  32.         UD_LOGI("Test craps : Loaded");
  33.         hook_lib->addRequestHook("^/banners$", ShowEventsBanners);
  34.         return 0;
  35.     }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement