mirror of
https://github.com/BeamMP/BeamMP-Launcher.git
synced 2026-04-03 06:16:15 +00:00
Compare commits
32 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ec5e8ed5b3 | ||
|
|
5655164e60 | ||
|
|
3d9b7c2d67 | ||
|
|
764e3ab5c1 | ||
|
|
3314362faf | ||
|
|
e483f520db | ||
|
|
c92e32c0e1 | ||
|
|
cb872f8a41 | ||
|
|
0aae245054 | ||
|
|
480a7d038f | ||
|
|
f62f44d4c0 | ||
|
|
e316b89fb1 | ||
|
|
3b2dbcac1b | ||
|
|
d881c9faf6 | ||
|
|
11d9375f36 | ||
|
|
4207d7adcf | ||
|
|
832b1d66a0 | ||
|
|
cd829f9f22 | ||
|
|
f7c70eb6df | ||
|
|
01960f6470 | ||
|
|
f6065a1c00 | ||
|
|
ba3b7f0ed0 | ||
|
|
056eadbef2 | ||
|
|
2bb2dc9040 | ||
|
|
17553fd412 | ||
|
|
08c1c0f682 | ||
|
|
84959ae9c9 | ||
|
|
c90c102097 | ||
|
|
5b004426ce | ||
|
|
69c9060dd2 | ||
|
|
49870639ff | ||
|
|
0843862af9 |
2
.github/workflows/cmake-windows.yml
vendored
2
.github/workflows/cmake-windows.yml
vendored
@@ -20,7 +20,7 @@ jobs:
|
||||
with:
|
||||
vcpkgArguments: 'discord-rpc zlib rapidjson openssl'
|
||||
vcpkgDirectory: '${{ runner.workspace }}/b/vcpkg'
|
||||
vcpkgGitCommitId: '75522bb1f2e7d863078bcd06322348f053a9e33f'
|
||||
vcpkgGitCommitId: '86ff75c6d8232b54d3ebd0e71525b4634dcd9523'
|
||||
vcpkgTriplet: 'x64-windows-static'
|
||||
|
||||
- name: Create Build Environment
|
||||
|
||||
2
.github/workflows/release-build.yml
vendored
2
.github/workflows/release-build.yml
vendored
@@ -44,7 +44,7 @@ jobs:
|
||||
with:
|
||||
vcpkgArguments: 'discord-rpc zlib rapidjson openssl'
|
||||
vcpkgDirectory: '${{ runner.workspace }}/b/vcpkg'
|
||||
vcpkgGitCommitId: '75522bb1f2e7d863078bcd06322348f053a9e33f'
|
||||
vcpkgGitCommitId: '86ff75c6d8232b54d3ebd0e71525b4634dcd9523'
|
||||
vcpkgTriplet: 'x64-windows-static'
|
||||
|
||||
- name: Create Build Environment
|
||||
|
||||
@@ -58,7 +58,7 @@ void Parse(std::string Data,SOCKET CSocket){
|
||||
NetReset();
|
||||
Terminate = true;
|
||||
TCPTerminate = true;
|
||||
Data = Code + HTTP::Post("https://backend.beammp.com/servers","");
|
||||
Data = Code + HTTP::Get("https://backend.beammp.com/servers-info");
|
||||
break;
|
||||
case 'C':
|
||||
ListOfMods.clear();
|
||||
|
||||
@@ -31,6 +31,7 @@ std::string HTTP::Get(const std::string &IP) {
|
||||
|
||||
httplib::Client cli(IP.substr(0, pos).c_str());
|
||||
cli.set_connection_timeout(std::chrono::seconds(10));
|
||||
cli.set_follow_location(true);
|
||||
auto res = cli.Get(IP.substr(pos).c_str(), ProgressBar);
|
||||
std::string Ret;
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ std::string Auth(SOCKET Sock){
|
||||
|
||||
auto Res = TCPRcv(Sock);
|
||||
|
||||
if(Res.empty() || Res[0] == 'E'){
|
||||
if(Res.empty() || Res[0] == 'E' || Res[0] == 'K'){
|
||||
Abord();
|
||||
return "";
|
||||
}
|
||||
@@ -87,7 +87,7 @@ std::string Auth(SOCKET Sock){
|
||||
|
||||
Res = TCPRcv(Sock);
|
||||
|
||||
if(Res[0] == 'E'){
|
||||
if(Res[0] == 'E' || Res[0] == 'K'){
|
||||
Abord();
|
||||
return "";
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ std::string TCPRcv(SOCKET Sock){
|
||||
#ifdef DEBUG
|
||||
//debug("Parsing from server -> " + std::to_string(Ret.size()));
|
||||
#endif
|
||||
if(Ret[0] == 'E')UUl(Ret.substr(1));
|
||||
if(Ret[0] == 'E' || Ret[0] == 'K')UUl(Ret.substr(1));
|
||||
return Ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ extern bool LoginAuth;
|
||||
std::string Role;
|
||||
|
||||
void UpdateKey(const char* newKey){
|
||||
if(newKey){
|
||||
if(newKey && std::isalnum(newKey[0])){
|
||||
std::ofstream Key("key");
|
||||
if(Key.is_open()){
|
||||
Key << newKey;
|
||||
@@ -88,13 +88,21 @@ void CheckLocalKey(){
|
||||
Key.read(&Buffer[0], Size);
|
||||
Key.close();
|
||||
|
||||
for (char& c : Buffer) {
|
||||
if (!std::isalnum(c) && c != '-') {
|
||||
UpdateKey(nullptr);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Buffer = HTTP::Post("https://auth.beammp.com/userlogin", R"({"pk":")" + Buffer + "\"}");
|
||||
|
||||
json::Document d;
|
||||
d.Parse(Buffer.c_str());
|
||||
if (Buffer == "-1" || Buffer.at(0) != '{' || d.HasParseError()) {
|
||||
error(Buffer);
|
||||
fatal("Invalid answer from authentication servers, please try again later!");
|
||||
info("Invalid answer from authentication servers.");
|
||||
UpdateKey(nullptr);
|
||||
}
|
||||
if(d["success"].GetBool()){
|
||||
LoginAuth = true;
|
||||
|
||||
@@ -29,8 +29,9 @@ std::string GetVer(){
|
||||
return "2.0";
|
||||
}
|
||||
std::string GetPatch(){
|
||||
return ".63";
|
||||
return ".80";
|
||||
}
|
||||
|
||||
std::string GetEP(char*P){
|
||||
static std::string Ret = [&](){
|
||||
std::string path(P);
|
||||
@@ -195,10 +196,6 @@ size_t DirCount(const std::filesystem::path& path){
|
||||
void CheckMP(const std::string& Path) {
|
||||
if (!fs::exists(Path))return;
|
||||
size_t c = DirCount(fs::path(Path));
|
||||
if (c > 3) {
|
||||
warn(std::to_string(c - 1) + " multiplayer mods will be wiped from mods/multiplayer! Close this if you don't want that!");
|
||||
std::this_thread::sleep_for(std::chrono::seconds(15));
|
||||
}
|
||||
try {
|
||||
for (auto& p : fs::directory_iterator(Path)){
|
||||
if(p.exists() && !p.is_directory()){
|
||||
@@ -246,7 +243,7 @@ void EnableMP(){
|
||||
}
|
||||
|
||||
void PreGame(const std::string& GamePath){
|
||||
const std::string CurrVer("0.24.0.1");
|
||||
const std::string CurrVer("0.26.1.0");
|
||||
std::string GameVer = CheckVer(GamePath);
|
||||
info("Game Version : " + GameVer);
|
||||
if(GameVer < CurrVer){
|
||||
|
||||
Reference in New Issue
Block a user