Skip to content

Commit

Permalink
Removed some unnecessary lines and fixed some compile warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Latrolage committed Jun 2, 2022
1 parent 2078e93 commit b30ffe6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 15 deletions.
12 changes: 1 addition & 11 deletions autoaccept.cpp
Original file line number Diff line number Diff line change
@@ -1,23 +1,13 @@
#include <iostream>
#include <string>
#include <algorithm>
#include <thread>
#include <cstddef>
#include <fstream>
#include <curl/curl.h>
#include <sstream>
#include <vector>
#include <chrono>
#include <sqlite3.h>

#include "base64.cpp"
#include "leaguefiles.cpp"
#include "curling.cpp"

int main(int argc, char** argv) {
(argc != 1 && static_cast<std::string>(argv[1]) == "--nopkexec") ? : system("pkexec sh -c 'sysctl -w abi.vsyscall32=0' > /dev/null");
if (argc != 1 && static_cast<std::string>(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<std::string> data(getdata(lockfile));
Expand Down
7 changes: 3 additions & 4 deletions curling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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");
Expand All @@ -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);
Expand Down

0 comments on commit b30ffe6

Please sign in to comment.