Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <unidokkan/log.h>
- #include <unidokkan/hook.h>
- #include <dokkan/crypto.h>
- /*{
- "events": [ //Events specified but should fetch all base on id L:10
- {
- "banner_image": "https://www.baoulettes.fr/DokkanEvent/image/quest_list_banner_"+ID+".png",
- "event_image": "https://www.baoulettes.fr/DokkanEvent/image/quest_top_banner_"+ID+".png",
- "minibanner_image": "https://www.baoulettes.fr/DokkanEvent/image/quest_event_banner_"+ID+".png",
- "id": *, //Can be anything from 101 to 549 (testing purpose)
- "quests": [ //Should fetch all possible "name" in this "quests" and set name depending on their id (the best would be to fetch database.db !)
- {
- "name": "Event_Name", // Event name usually their id are "id" L:10 and 0xx (xx = 01 to 99 depending the number of stage available)
- }
- ]
- },
- ]
- }*/
- bool ShowEventsBanners(NetworkRequest *request, NetworkResponse *response, bool &short_circuit) {
- auto json_body = UniDokkan::Dokkan::Crypto::DecryptSign(response->jsonBody["sign"]);
- response->jsonBody["banners"][0][5]["banner_image"] = "https://www.baoulettes.fr/DokkanEvent/image/quest_list_banner_132.png";
- response->jsonBody["banners"][0][5]["event_image"] = "https://www.baoulettes.fr/DokkanEvent/image/quest_top_banner_132_category.png";
- response->jsonBody["banners"][0][5]["minibanner_image"] = "https://www.baoulettes.fr/DokkanEvent/image/quest_event_banner_132.png";
- //if (request->jsonBody["banners"][0]["id"].get<int>() >= 0) {}
- auto debug = response->jsonBody["banners"][0][0]["image"];
- response->jsonBody["sign"] = UniDokkan::Dokkan::Crypto::EncryptSign(json_body);
- return true;
- }
- extern "C" {
- int unidokkan_init_v2(HookLib* hook_lib) {
- UD_LOGI("Test craps : Loaded");
- hook_lib->addRequestHook("^/banners$", ShowEventsBanners);
- return 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement