0.23.0.0 support

This commit is contained in:
Anonymous-275 2021-07-01 18:53:50 +03:00
parent 691be8cd08
commit 61759b8531
6 changed files with 43 additions and 11 deletions

View File

@ -8,7 +8,7 @@
#include "Network/network.h"
#include "Security/Init.h"
#include "http.h"
#include "Http.h"
#include <winsock2.h>
#include <ws2tcpip.h>
#include "Startup.h"

View File

@ -10,7 +10,7 @@
#include <iostream>
#include <Logger.h>
#include <fstream>
#include "http.h"
#include "Http.h"
#include <mutex>
#include <cmath>
#include <httplib.h>

View File

@ -6,7 +6,7 @@
/// Created by Anonymous275 on 11/26/2020
///
#include "http.h"
#include "Http.h"
#include <filesystem>
#include "Logger.h"
#include <fstream>

View File

@ -5,6 +5,7 @@
///
/// Created by Anonymous275 on 7/16/2020
///
#include "zip_file.h"
#include <windows.h>
#include "Discord/discord_info.h"
#include "Network/network.h"
@ -14,7 +15,7 @@
#include "Logger.h"
#include <fstream>
#include <thread>
#include "http.h"
#include "Http.h"
#include "Json.h"
extern int TraceBack;
@ -28,7 +29,7 @@ std::string GetVer(){
return "2.0";
}
std::string GetPatch(){
return ".5";
return ".6";
}
std::string GetEP(char*P){
static std::string Ret = [&](){
@ -245,7 +246,7 @@ void EnableMP(){
}
void PreGame(const std::string& GamePath){
const std::string CurrVer("0.22.3.0");
const std::string CurrVer("0.23.0.0");
std::string GameVer = CheckVer(GamePath);
info("Game Version : " + GameVer);
if(GameVer < CurrVer){
@ -265,10 +266,41 @@ void PreGame(const std::string& GamePath){
}catch(std::exception&e){
fatal(e.what());
}
std::string ZipPath(GetGamePath() + R"(mods\multiplayer\BeamMP.zip)");
HTTP::Download("https://backend.beammp.com/builds/client?download=true"
"&pk=" + PublicKey +
"&branch=" + Branch, GetGamePath() + R"(mods\multiplayer\BeamMP.zip)");
"&pk=" + PublicKey + "&branch=" + Branch, ZipPath);
std::string Target(GetGamePath() + "mods/unpacked/beammp");
info("check1");
if(fs::is_directory(Target)) {
fs::remove_all(Target);
}
info("check2");
fs::create_directories(Target);
info("check3");
if (fs::exists(ZipPath)) {
info("check4");
miniz_cpp::zip_file zip{ ZipPath };
info("check5");
fs::create_directories(Target);
info("check6");
for(auto name : zip.namelist()){
info("check7");
if(name.back() == '/' || name.back() == '\\') {
info("check8");
name.erase(std::prev(name.end()));
info("check9");
fs::create_directories(Target + "/" + name);
info("check10");
}
}
info("check11");
zip.extractall(Target);
info("check12");
fs::remove(ZipPath);
info("check13");
}
//HTTP::Download("beammp.com/builds/client", GetGamePath() + R"(mods\multiplayer\BeamMP.zip)");
}

View File

@ -11,7 +11,7 @@
#include <iostream>
#include "Logger.h"
#include <thread>
#include "http.h"
#include "Http.h"
[[noreturn]] void flush(){
while(true){