From b30ffe6070fd2e28046f0a83da71e18be51112af Mon Sep 17 00:00:00 2001 From: Latrolage Date: Thu, 2 Jun 2022 21:11:51 +1000 Subject: [PATCH] Removed some unnecessary lines and fixed some compile warnings --- autoaccept.cpp | 12 +----------- curling.cpp | 7 +++---- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/autoaccept.cpp b/autoaccept.cpp index 51e3b41..70729f4 100644 --- a/autoaccept.cpp +++ b/autoaccept.cpp @@ -1,23 +1,13 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include "base64.cpp" #include "leaguefiles.cpp" #include "curling.cpp" int main(int argc, char** argv) { - (argc != 1 && static_cast(argv[1]) == "--nopkexec") ? : system("pkexec sh -c 'sysctl -w abi.vsyscall32=0' > /dev/null"); + if (argc != 1 && static_cast(argv[1]) == "--nopkexec") system("pkexec sh -c 'sysctl -w abi.vsyscall32=0' > /dev/null"); std::cout << "STARTED LEAGUEAUTOACCEPT" << std::endl; -// std::cout << std::unitbuf; while (true) { std::ifstream lockfile = getfile(); std::vector data(getdata(lockfile)); diff --git a/curling.cpp b/curling.cpp index a4fce22..021e676 100644 --- a/curling.cpp +++ b/curling.cpp @@ -12,7 +12,7 @@ size_t write_callback(char *ptr, size_t size, size_t nmemb, void *userdata) { return 0; } void curlstuff(const std::string& port, const std::string& pass) { - CURLcode ret; +// CURLcode ret; // unused CURL* curl; struct curl_slist *slist1; slist1 = NULL; @@ -22,8 +22,7 @@ void curlstuff(const std::string& port, const std::string& pass) { urlstring << "https://127.0.0.1:" << port << "/lol-matchmaking/v1/ready-check/accept"; // std::cout << urlstring.str() << std::endl; curl_easy_setopt(curl, CURLOPT_BUFFERSIZE, 102400L); -// curl_easy_setopt(curl, CURLOPT_URL, "https://127.0.0.1:39961/lol-matchmaking/v1/ready-check/accept"); - curl_easy_setopt(curl, CURLOPT_URL, urlstring.str().c_str()); + curl_easy_setopt(curl, CURLOPT_URL, urlstring.str().c_str()); // curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1L); curl_easy_setopt(curl, CURLOPT_HTTPHEADER, slist1); curl_easy_setopt(curl, CURLOPT_USERAGENT, "curl/7.83.1"); @@ -35,7 +34,7 @@ void curlstuff(const std::string& port, const std::string& pass) { curl_easy_setopt(curl, CURLOPT_FTP_SKIP_PASV_IP, 1L); curl_easy_setopt(curl, CURLOPT_TCP_KEEPALIVE, 1L); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_callback); - ret = curl_easy_perform(curl); + curl_easy_perform(curl); curl_easy_cleanup(curl); curl=NULL; curl_slist_free_all(slist1);