Mod info logs and check for old format

This commit is contained in:
Tixx 2024-10-10 21:35:27 +02:00
parent 4fbd25b551
commit 3f12bb757a

View File

@ -383,8 +383,7 @@ struct ModInfo {
} }
} catch (const std::exception& e) { } catch (const std::exception& e) {
debug(std::string("Failed to receive mod list: ") + e.what()); debug(std::string("Failed to receive mod list: ") + e.what());
error("Failed to receive mod list!"); warn("Failed to receive new mod list format! This server may be outdated, but everything should still work as expected.");
// TODO: Cry and die
} }
return std::make_pair(success, modInfos); return std::make_pair(success, modInfos);
} }
@ -526,12 +525,16 @@ void SyncResources(SOCKET Sock) {
debug("Mod info: " + Ret); debug("Mod info: " + Ret);
if (Ret.starts_with("R")) {
debug("This server is likely outdated, not trying to parse new mod info format");
} else {
auto ModInfos = ModInfo::ParseModInfosFromPacket(Ret); auto ModInfos = ModInfo::ParseModInfosFromPacket(Ret);
if (ModInfos.first) { if (ModInfos.first) {
NewSyncResources(Sock, Ret, ModInfos.second); NewSyncResources(Sock, Ret, ModInfos.second);
return; return;
} }
}
if (Ret.empty()) if (Ret.empty())
return; return;