#pragma once #include #include #include /** * The system description the client sends in its login request, as reported by the client. It comes from old Windows * calls and describes what Windows (or Wine) tells a 32-bit program without a compatibility manifest, which is not * necessarily the player's real hardware. docs/Dashboard.md (Client system info) says what each field means. */ namespace ClientSysInfo { /** * The login request's memoryStats text, split into numbers. The client writes these parts one after another with no * separator (numbers are right-aligned to 7 characters): * " p, vbytes." " n-use." " TKb-pmem." " FKb pmem." " TKb pfile." " FKb pfile." * " TKbytes vmem. \n" " FKb vmem." "P p, v." * The client cuts the text at 255 characters, so the last parts can be missing; a part that doesn't match stops the * parse and leaves it and everything after it empty. */ struct MemoryStats { std::optional workingSetBytes; // the client process's working set at login (bytes) std::optional pagefileUsageBytes; // the client process's private (commit) bytes at login std::optional memoryLoadPercent; // how much of the system's memory Windows says is in use std::optional totalPhysKb; // physical memory Windows reports (KB) std::optional availPhysKb; // free physical memory at login (KB) std::optional totalPageFileKb; // commit limit: physical memory plus page files (KB) std::optional availPageFileKb; // free commit at login (KB) std::optional totalVirtualKb; // the 32-bit client's own address space, not the system's (KB) std::optional availVirtualKb; // free address space in the client (KB) std::optional peakWorkingSetBytes; // the client process's peak working set (bytes) std::optional peakPagefileUsageBytes; // the client process's peak private bytes // Every part was read bool complete{}; }; MemoryStats ParseMemoryStats(std::string_view text); }