Bump version to v2.8.1

This commit is contained in:
Tixx
2026-08-11 22:19:49 +02:00
parent f532e58ee0
commit a9faac25fc
2 changed files with 15 additions and 3 deletions
+14 -2
View File
@@ -307,7 +307,7 @@ void InvalidResource(const std::string& File) {
} }
struct ModInfo { 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; bool success = false;
std::vector<ModInfo> modInfos; std::vector<ModInfo> modInfos;
try { try {
@@ -328,6 +328,12 @@ struct ModInfo {
modInfo.Protected = entry["protected"]; 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); modInfos.push_back(modInfo);
success = true; success = true;
} }
@@ -616,7 +622,13 @@ void SyncResources(SOCKET Sock) {
if (Ret.starts_with("R")) { if (Ret.starts_with("R")) {
debug("This server is likely outdated, not trying to parse new mod info format"); debug("This server is likely outdated, not trying to parse new mod info format");
} else { } 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) { if (success) {
NewSyncResources(Sock, Ret, modInfo); NewSyncResources(Sock, Ret, modInfo);
+1 -1
View File
@@ -86,7 +86,7 @@ std::string GetVer() {
return "2.8"; return "2.8";
} }
std::string GetPatch() { std::string GetPatch() {
return ".0"; return ".1";
} }
beammp_fs_string GetEP(const beammp_fs_char* P) { beammp_fs_string GetEP(const beammp_fs_char* P) {