mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-02 02:43:44 +00:00
fix(dashboard): System Log groups world server logs by zone, not by clone and instance
Each WorldServer_<zone>_<clone>_<instance>_<time>.log (and older WorldServer_<zone>_<instance>_<time>.log) file set made its own server entry; they're now grouped under WorldServer_<zone>, and the file picker still shows the full names. Check: the Server picker lists one entry per zone and its file list holds every clone and instance. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -240,7 +240,11 @@ namespace {
|
||||
const auto stem = entry.path().stem().string();
|
||||
const auto written = std::chrono::duration_cast<std::chrono::seconds>(
|
||||
std::chrono::clock_cast<std::chrono::system_clock>(entry.last_write_time(ec)).time_since_epoch()).count();
|
||||
byServer[stem.substr(0, stem.rfind('_'))].push_back({ entry.path(), written, entry.file_size(ec) });
|
||||
// <Server>_<start time>; world servers are WorldServer_<zone>_<clone>_<instance>_<start time> (older files:
|
||||
// WorldServer_<zone>_<instance>_<start time>) and are grouped by zone alone; the file names still show the rest
|
||||
auto server = stem.substr(0, stem.rfind('_'));
|
||||
if (server.starts_with("WorldServer_")) server = server.substr(0, server.find('_', 12));
|
||||
byServer[server].push_back({ entry.path(), written, entry.file_size(ec) });
|
||||
}
|
||||
for (auto& [server, files] : byServer) std::sort(files.begin(), files.end(), [](const auto& a, const auto& b) { return a.time > b.time; });
|
||||
return byServer;
|
||||
|
||||
Reference in New Issue
Block a user