mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-02 02:43:44 +00:00
Account pages get a Client system info (as reported) card (client_sysinfo): every description the account's client sent at login, newest first, with the raw values, the memory text split into numbers and each field's caveat. The address is only shown with logs_audit. The Client System Info page (Logs & Health) shows the spread across players from each account's newest report: Windows version, video card, memory buckets, processor count and client build, marked as client-reported and approximate. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
38 lines
1.6 KiB
C++
38 lines
1.6 KiB
C++
#pragma once
|
|
|
|
#include <cstdint>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#include "IClientSysInfo.h"
|
|
#include "json.hpp"
|
|
|
|
/**
|
|
* How the dashboard shows the system info clients send at login (client_sysinfo), without the database or web server.
|
|
* Every value is as reported by the client: old Windows calls in a 32-bit program without a compatibility manifest,
|
|
* so several fields are compatibility values rather than the player's real hardware. Caveats() says what each field
|
|
* is worth; the routes are in ClientSysInfoRoutes.cpp.
|
|
*/
|
|
namespace ClientSysInfoView {
|
|
// field -> what it is and how far to trust it, for the page and the API
|
|
const nlohmann::json& Caveats();
|
|
|
|
// One row as the dashboard sends it: the raw values, plus labels and the memory text split into numbers. The
|
|
// address is only included when showIp (logs_audit).
|
|
nlohmann::json RowJson(const IClientSysInfo::SysInfoRow& row, bool showIp);
|
|
|
|
// "6.2.9200", and what Windows version that is reported as
|
|
std::string OsVersion(const IClientSysInfo::SysInfoRow& row);
|
|
std::string OsLabel(const IClientSysInfo::SysInfoRow& row);
|
|
|
|
// A physical memory bucket by the reported total: "Under 2 GB", "2-4 GB", ... "64 GB or more", "Not read"
|
|
std::string MemoryBucket(uint64_t totalKb);
|
|
|
|
/**
|
|
* The spread across players from each account's newest row: {accounts, os: [{label, count}], video: [...],
|
|
* memory: [...], processors: [...], clientOs: [...]}, most common first, at most top entries each (the rest are
|
|
* one "Other" entry).
|
|
*/
|
|
nlohmann::json Spread(const std::vector<IClientSysInfo::SysInfoRow>& latest, size_t top = 20);
|
|
}
|