mirror of
https://github.com/SantaSpeen/BeamMP-Server.git
synced 2026-06-16 23:10:53 +00:00
Support of 1Gps+ internet
This commit is contained in:
@@ -4,7 +4,6 @@
|
||||
#include "Client.hpp"
|
||||
#include "Curl/Http.h"
|
||||
#include "Logger.h"
|
||||
#include "Security/Enc.h"
|
||||
#include "Settings.h"
|
||||
#include <chrono>
|
||||
#include <future>
|
||||
@@ -38,12 +37,11 @@ std::string RunPromise(const std::string& IP, const std::string& R) {
|
||||
std::future<std::string> f1 = task.get_future();
|
||||
std::thread t(std::move(task));
|
||||
t.detach();
|
||||
auto status = f1.wait_for(std::chrono::seconds(10));
|
||||
auto status = f1.wait_for(std::chrono::seconds(15));
|
||||
if (status != std::future_status::timeout)
|
||||
return f1.get();
|
||||
error(Sec("Backend system Timeout please try again later"));
|
||||
std::this_thread::sleep_for(std::chrono::seconds(3));
|
||||
_Exit(0);
|
||||
error("Backend system Timeout please try again later");
|
||||
return "";
|
||||
}
|
||||
|
||||
[[noreturn]] void Heartbeat() {
|
||||
@@ -75,7 +73,7 @@ std::string RunPromise(const std::string& IP, const std::string& R) {
|
||||
WebsocketInit();
|
||||
isAuth = true;
|
||||
}
|
||||
std::this_thread::sleep_for(std::chrono::seconds(1));
|
||||
std::this_thread::sleep_for(std::chrono::seconds(5));
|
||||
}
|
||||
}
|
||||
void HBInit() {
|
||||
|
||||
@@ -15,22 +15,20 @@ std::string FileList;
|
||||
int ModsLoaded = 0;
|
||||
|
||||
void InitRes() {
|
||||
std::string Path = Resource + Sec("/Client");
|
||||
std::string Path = Resource + "/Client";
|
||||
if (!fs::exists(Path))
|
||||
fs::create_directory(Path);
|
||||
for (const auto& entry : fs::directory_iterator(Path)) {
|
||||
auto pos = entry.path().string().find(Sec(".zip"));
|
||||
auto pos = entry.path().string().find(".zip");
|
||||
if (pos != std::string::npos) {
|
||||
if (entry.path().string().length() - pos == 4) {
|
||||
FileList += entry.path().string() + ";";
|
||||
FileSizes += std::to_string(fs::file_size(entry.path())) + ";";
|
||||
MaxModSize += fs::file_size(entry.path());
|
||||
FileSizes += std::to_string(uint64_t(fs::file_size(entry.path()))) + ";";
|
||||
MaxModSize += uint64_t(fs::file_size(entry.path()));
|
||||
ModsLoaded++;
|
||||
}
|
||||
}
|
||||
}
|
||||
std::replace(FileList.begin(), FileList.end(), '\\', '/');
|
||||
if (ModsLoaded) {
|
||||
info(Sec("Loaded ") + std::to_string(ModsLoaded) + Sec(" Mods"));
|
||||
}
|
||||
if(ModsLoaded)info("Loaded " + std::to_string(ModsLoaded) + " Mods");
|
||||
}
|
||||
|
||||
@@ -9,10 +9,10 @@
|
||||
|
||||
std::string CustomIP;
|
||||
std::string GetSVer() {
|
||||
return std::string(Sec("1.20"));
|
||||
return "1.20";
|
||||
}
|
||||
std::string GetCVer() {
|
||||
return std::string(Sec("1.71"));
|
||||
return "1.72";
|
||||
}
|
||||
void Args(int argc, char* argv[]) {
|
||||
info("BeamMP Server Running version " + GetSVer());
|
||||
|
||||
Reference in New Issue
Block a user