| 338 | } |
| 339 | |
| 340 | void RewardUnlockLayer::sendHttpRequest(int chestID) |
| 341 | { |
| 342 | std::string postData = fmt::format("secret=Wmfd2893gb7&udid={}&chk={}&rewardType={}", "JUSTANORMALUDID", "5yQrSBA4DAQAH", chestID); // todo: udid |
| 343 | GameToolbox::log("postData: {}", postData); |
| 344 | |
| 345 | auto _request = new ax::network::HttpRequest(); |
| 346 | _request->setUrl("http://www.boomlings.com/database/getGJRewards.php"); |
| 347 | _request->setRequestType(ax::network::HttpRequest::Type::POST); |
| 348 | _request->setHeaders(std::vector<std::string>{"user-agent: "}); |
| 349 | _request->setRequestData(postData.c_str(), postData.length()); |
| 350 | _request->setResponseCallback(AX_CALLBACK_2(RewardUnlockLayer::onHttpRequestCompleted, this, chestID)); |
| 351 | _request->setTag("valid"); |
| 352 | ax::network::HttpClient::getInstance()->send(_request); |
| 353 | _request->release(); |
| 354 | } |