mirror of
https://github.com/BeamMP/BeamMP-Launcher.git
synced 2025-07-04 00:47:23 +00:00
launcher is now more linux friendly
This commit is contained in:
parent
fda7567044
commit
543183b852
@ -109,11 +109,15 @@ std::string QueryKey(HKEY hKey,int ID){
|
|||||||
LONG dwRes = RegQueryValueEx(hKey, achValue, nullptr, nullptr, buffer, &lpData);
|
LONG dwRes = RegQueryValueEx(hKey, achValue, nullptr, nullptr, buffer, &lpData);
|
||||||
std::string data = (char *)(buffer);
|
std::string data = (char *)(buffer);
|
||||||
std::string key = achValue;
|
std::string key = achValue;
|
||||||
|
|
||||||
switch (ID){
|
switch (ID){
|
||||||
case 1: if(key == "SteamExe"){
|
case 1: if(key == "SteamExe"){
|
||||||
auto p = data.find_last_of('/');
|
auto p = data.find_last_of("/\\");
|
||||||
if(p != std::string::npos)return data.substr(0,p);
|
if(p != std::string::npos){
|
||||||
}break;
|
return data.substr(0,p);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
case 2: if(key == "Name" && data == "BeamNG.drive")return data;break;
|
case 2: if(key == "Name" && data == "BeamNG.drive")return data;break;
|
||||||
case 3: if(key == "rootpath")return data;break;
|
case 3: if(key == "rootpath")return data;break;
|
||||||
case 4: if(key == "userpath_override")return data;
|
case 4: if(key == "userpath_override")return data;
|
||||||
@ -136,7 +140,7 @@ void FileList(std::vector<std::string>&a,const std::string& Path){
|
|||||||
}
|
}
|
||||||
bool Find(const std::string& FName,const std::string& Path){
|
bool Find(const std::string& FName,const std::string& Path){
|
||||||
std::vector<std::string> FS;
|
std::vector<std::string> FS;
|
||||||
FileList(FS,Path+"/userdata");
|
FileList(FS,Path+"\\userdata");
|
||||||
for(std::string&a : FS){
|
for(std::string&a : FS){
|
||||||
if(a.find(FName) != std::string::npos){
|
if(a.find(FName) != std::string::npos){
|
||||||
FS.clear();
|
FS.clear();
|
||||||
@ -223,11 +227,12 @@ std::string GetManifest(const std::string& Man){
|
|||||||
}else return "";
|
}else return "";
|
||||||
}
|
}
|
||||||
bool IDCheck(std::string Man, std::string steam){
|
bool IDCheck(std::string Man, std::string steam){
|
||||||
|
info("IDCheck Called with : " + Man + " and " + steam);
|
||||||
bool a = false,b = true;
|
bool a = false,b = true;
|
||||||
int pos = int(Man.rfind("steamapps"));
|
int pos = int(Man.rfind("steamapps"));
|
||||||
if(pos == -1)Exit(5);
|
if(pos == -1)Exit(5);
|
||||||
Man = Man.substr(0,pos+9) + "/appmanifest_284160.acf";
|
Man = Man.substr(0,pos+9) + "\\appmanifest_284160.acf";
|
||||||
steam += "/config/loginusers.vdf";
|
steam += "\\config\\loginusers.vdf";
|
||||||
if(fs::exists(Man) && fs::exists(steam)){
|
if(fs::exists(Man) && fs::exists(steam)){
|
||||||
for(const std::string&ID : GetID(steam)){
|
for(const std::string&ID : GetID(steam)){
|
||||||
if(ID == GetManifest(Man))b = false;
|
if(ID == GetManifest(Man))b = false;
|
||||||
|
@ -27,7 +27,7 @@ std::string GetVer(){
|
|||||||
return "1.80";
|
return "1.80";
|
||||||
}
|
}
|
||||||
std::string GetPatch(){
|
std::string GetPatch(){
|
||||||
return ".9";
|
return ".10";
|
||||||
}
|
}
|
||||||
void ReLaunch(int argc,char*args[]){
|
void ReLaunch(int argc,char*args[]){
|
||||||
std::string Arg;
|
std::string Arg;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user