mirror of
https://github.com/BeamMP/BeamMP-Launcher.git
synced 2026-08-27 04:37:41 +00:00
Bump version to v2.8.1
This commit is contained in:
@@ -307,7 +307,7 @@ void InvalidResource(const std::string& File) {
|
||||
}
|
||||
|
||||
struct ModInfo {
|
||||
static std::pair<bool, std::vector<ModInfo>> ParseModInfosFromPacket(const std::string& packet) {
|
||||
static std::optional<std::pair<bool, std::vector<ModInfo>>> ParseModInfosFromPacket(const std::string& packet) {
|
||||
bool success = false;
|
||||
std::vector<ModInfo> modInfos;
|
||||
try {
|
||||
@@ -328,6 +328,12 @@ struct ModInfo {
|
||||
modInfo.Protected = entry["protected"];
|
||||
}
|
||||
|
||||
if (auto fsFile = std::filesystem::path(modInfo.FileName);
|
||||
!fsFile.has_filename() || fsFile.filename().string() != modInfo.FileName ||
|
||||
!fsFile.filename().has_extension() || fsFile.filename().extension() != ".zip"){
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
modInfos.push_back(modInfo);
|
||||
success = true;
|
||||
}
|
||||
@@ -616,7 +622,13 @@ void SyncResources(SOCKET Sock) {
|
||||
if (Ret.starts_with("R")) {
|
||||
debug("This server is likely outdated, not trying to parse new mod info format");
|
||||
} else {
|
||||
auto [success, modInfo] = ModInfo::ParseModInfosFromPacket(Ret);
|
||||
auto ParsedInfo = ModInfo::ParseModInfosFromPacket(Ret);
|
||||
if (!ParsedInfo.has_value()) {
|
||||
error("Invalid mod info");
|
||||
Terminate = true;
|
||||
return;
|
||||
}
|
||||
auto [success, modInfo] = ParsedInfo.value();
|
||||
|
||||
if (success) {
|
||||
NewSyncResources(Sock, Ret, modInfo);
|
||||
|
||||
+1
-1
@@ -86,7 +86,7 @@ std::string GetVer() {
|
||||
return "2.8";
|
||||
}
|
||||
std::string GetPatch() {
|
||||
return ".0";
|
||||
return ".1";
|
||||
}
|
||||
|
||||
beammp_fs_string GetEP(const beammp_fs_char* P) {
|
||||
|
||||
Reference in New Issue
Block a user