mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-14 03:11:28 +00:00
[Crash] Fix rarer exception crash issue in PlayerEventLogs::ProcessBatchQueue (#4835)
This commit is contained in:
parent
9be2485330
commit
60a2dd8616
@ -81,7 +81,7 @@ void PlayerEventLogs::Init()
|
|||||||
if (!settings_to_insert.empty()) {
|
if (!settings_to_insert.empty()) {
|
||||||
PlayerEventLogSettingsRepository::ReplaceMany(*m_database, settings_to_insert);
|
PlayerEventLogSettingsRepository::ReplaceMany(*m_database, settings_to_insert);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool processing_in_world = !RuleB(Logging, PlayerEventsQSProcess) && IsWorld();
|
bool processing_in_world = !RuleB(Logging, PlayerEventsQSProcess) && IsWorld();
|
||||||
bool processing_in_qs = RuleB(Logging, PlayerEventsQSProcess) && IsQueryServ();
|
bool processing_in_qs = RuleB(Logging, PlayerEventsQSProcess) && IsQueryServ();
|
||||||
|
|
||||||
@ -181,9 +181,17 @@ void PlayerEventLogs::ProcessBatchQueue()
|
|||||||
|
|
||||||
// Helper to deserialize event data
|
// Helper to deserialize event data
|
||||||
auto Deserialize = [](const std::string &data, auto &out) {
|
auto Deserialize = [](const std::string &data, auto &out) {
|
||||||
std::stringstream ss(data);
|
if (!Strings::IsValidJson(data)) {
|
||||||
cereal::JSONInputArchive ar(ss);
|
return;
|
||||||
out.serialize(ar);
|
}
|
||||||
|
|
||||||
|
// cpp exceptions are terrible, don't ever use them
|
||||||
|
try {
|
||||||
|
std::stringstream ss(data);
|
||||||
|
cereal::JSONInputArchive ar(ss);
|
||||||
|
out.serialize(ar);
|
||||||
|
}
|
||||||
|
catch (const std::exception &e) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Helper to assign ETL table ID
|
// Helper to assign ETL table ID
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user