Improved Launcher startup

This commit is contained in:
Anonymous275
2020-11-05 22:44:43 +02:00
parent ad91c65b55
commit 82870a23ac
31 changed files with 37 additions and 7844 deletions

View File

@@ -1,10 +1,10 @@
///
/// Created by Anonymous275 on 7/18/2020
///
#define CURL_STATICLIB
#include "Security/Game.h"
#include "Security/Enc.h"
#include "Curl/curl.h"
#include <curl/curl.h>
#include <iostream>
static size_t WriteCallback(void *contents, size_t size, size_t nmemb, void *userp){
((std::string*)userp)->append((char*)contents, size * nmemb);
@@ -64,7 +64,6 @@ int Download(const std::string& URL,const std::string& Path,bool close){
CURL *curl;
CURLcode res;
struct File file = {Path.c_str(),nullptr};
//curl_global_init(CURL_GLOBAL_DEFAULT);
curl = curl_easy_init();
if(curl){
curl_easy_setopt(curl, CURLOPT_URL,URL.c_str());
@@ -77,6 +76,7 @@ int Download(const std::string& URL,const std::string& Path,bool close){
curl_easy_setopt(curl, CURLOPT_USE_SSL, CURLUSESSL_ALL);
res = curl_easy_perform(curl);
curl_easy_cleanup(curl);
if(res != CURLE_OK)return res;
}
if(file.stream)fclose(file.stream);