From f7d3fcf92522b411f683c322d39a14fcd4576b50 Mon Sep 17 00:00:00 2001 From: Tixx <83774803+WiserTixx@users.noreply.github.com> Date: Sun, 29 Jun 2025 10:07:34 +0200 Subject: [PATCH] Make new CheckVer & GetEN compatible with linux --- include/Security/Init.h | 2 +- src/Security/BeamNG.cpp | 4 ++-- src/Startup.cpp | 6 +++++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/include/Security/Init.h b/include/Security/Init.h index 242c929..56bca81 100644 --- a/include/Security/Init.h +++ b/include/Security/Init.h @@ -7,7 +7,7 @@ #pragma once #include void PreGame(const beammp_fs_string& GamePath); -std::string CheckVer(const beammp_fs_string& path); +std::string CheckVer(const std::filesystem::path& path); void InitGame(const beammp_fs_string& Dir); beammp_fs_string GetGameDir(); void LegitimacyCheck(); diff --git a/src/Security/BeamNG.cpp b/src/Security/BeamNG.cpp index 9b6cbe3..ae3d7d7 100644 --- a/src/Security/BeamNG.cpp +++ b/src/Security/BeamNG.cpp @@ -232,9 +232,9 @@ void LegitimacyCheck() { } #endif } -std::string CheckVer(const beammp_fs_string& dir) { +std::string CheckVer(const std::filesystem::path& dir) { std::string temp; - beammp_fs_string Path = dir + beammp_wide("\\integrity.json"); + std::filesystem::path Path = dir / beammp_wide("integrity.json"); std::ifstream f(Path.c_str(), std::ios::binary); int Size = int(std::filesystem::file_size(Path)); std::string vec(Size, 0); diff --git a/src/Startup.cpp b/src/Startup.cpp index e1a3ffc..deef85f 100644 --- a/src/Startup.cpp +++ b/src/Startup.cpp @@ -73,7 +73,11 @@ Version::Version(const std::array& v) } beammp_fs_string GetEN() { - return beammp_wide("BeamMP-Launcher.exe"); +#if defined(_WIN32) + return L"BeamMP-Launcher.exe"; +#elif defined(__linux__) + return "BeamMP-Launcher"; +#endif } std::string GetVer() {