mirror of
https://github.com/BeamMP/BeamMP-Launcher.git
synced 2025-07-01 07:25:34 +00:00
add debug print and dont try new format if the packet looks invalid
This commit is contained in:
parent
885061f73d
commit
dd3622170e
@ -377,7 +377,7 @@ struct ModInfo {
|
||||
}
|
||||
} catch (const std::exception& e) {
|
||||
debug(std::string("Failed to receive mod list: ") + e.what());
|
||||
warn("Failed to receive new mod list format! This server may be outdated, but everything will still work as expected.");
|
||||
warn("Failed to receive new mod list format! This server may be outdated, but everything should still work as expected.");
|
||||
return {};
|
||||
}
|
||||
return modInfos;
|
||||
@ -511,11 +511,15 @@ void NewSyncResources(SOCKET Sock, const std::string& Mods, const std::vector<Mo
|
||||
void SyncResources(SOCKET Sock) {
|
||||
std::string Ret = Auth(Sock);
|
||||
|
||||
auto ModInfos = ModInfo::ParseModInfosFromPacket(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);
|
||||
|
||||
if (!ModInfos.empty()) {
|
||||
NewSyncResources(Sock, Ret, ModInfos);
|
||||
return;
|
||||
if (!ModInfos.empty()) {
|
||||
NewSyncResources(Sock, Ret, ModInfos);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (Ret.empty())
|
||||
|
Loading…
x
Reference in New Issue
Block a user