mirror of
https://github.com/BeamMP/BeamMP-Launcher.git
synced 2026-02-16 02:30:44 +00:00
Make new CheckVer & GetEN compatible with linux (#195)
Fixes issues for linux that came from PR #167 --- By creating this pull request, I understand that code that is AI generated or otherwise automatically generated may be rejected without further discussion. I declare that I fully understand all code I pushed into this PR, and wrote all this code myself and own the rights to this code.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
#pragma once
|
||||
#include <string>
|
||||
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();
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -73,7 +73,11 @@ Version::Version(const std::array<uint8_t, 3>& 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() {
|
||||
|
||||
Reference in New Issue
Block a user