mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-02 10:53:44 +00:00
feat(db): client system info as reported by the client
client_sysinfo (migrations mysql 102, sqlite 85) keeps the system description each account's client sent at login, exactly as sent, plus the physical memory read from it. While nothing but the memory in use changes, the account's newest row gets the new time and one more login; otherwise a new row starts. Log pruning deletes rows not seen for a while (eLog::CLIENT_SYSINFO) and deleting an account deletes its rows. Tests on SQLite alone (dDatabaseSqliteTests) and in the MySQL parity tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
28
migrations/dlu/mysql/102_client_sysinfo.sql
Normal file
28
migrations/dlu/mysql/102_client_sysinfo.sql
Normal file
@@ -0,0 +1,28 @@
|
||||
/* The system description clients send with their login request, exactly as the client reported it (old Windows calls:
|
||||
compatibility values, not necessarily the player's real hardware). Written by the auth server at each successful
|
||||
login: the account's newest row gets last_seen, logins + 1 and the new memory_stats text while everything else is the
|
||||
same; otherwise a new row starts. ip is empty while log_login_addresses is off. memory_total_kb is the physical memory
|
||||
read from memory_stats (0: not read). Rows not seen for log_client_sysinfo_days are deleted by the log pruning task. */
|
||||
CREATE TABLE IF NOT EXISTS client_sysinfo (
|
||||
id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
account_id INT UNSIGNED NOT NULL,
|
||||
first_seen BIGINT NOT NULL,
|
||||
last_seen BIGINT NOT NULL,
|
||||
logins INT UNSIGNED NOT NULL DEFAULT 1,
|
||||
ip VARCHAR(64) NOT NULL DEFAULT '',
|
||||
client_os INT UNSIGNED NOT NULL DEFAULT 0,
|
||||
memory_stats VARCHAR(512) NOT NULL DEFAULT '',
|
||||
memory_total_kb BIGINT UNSIGNED NOT NULL DEFAULT 0,
|
||||
video_card VARCHAR(256) NOT NULL DEFAULT '',
|
||||
number_of_processors INT UNSIGNED NOT NULL DEFAULT 0,
|
||||
processor_type INT UNSIGNED NOT NULL DEFAULT 0,
|
||||
processor_level SMALLINT UNSIGNED NOT NULL DEFAULT 0,
|
||||
processor_revision SMALLINT UNSIGNED NOT NULL DEFAULT 0,
|
||||
os_version_info_size INT UNSIGNED NOT NULL DEFAULT 0,
|
||||
os_major_version INT UNSIGNED NOT NULL DEFAULT 0,
|
||||
os_minor_version INT UNSIGNED NOT NULL DEFAULT 0,
|
||||
os_build_number INT UNSIGNED NOT NULL DEFAULT 0,
|
||||
os_platform_id INT UNSIGNED NOT NULL DEFAULT 0,
|
||||
INDEX client_sysinfo_account (account_id, id),
|
||||
INDEX client_sysinfo_last_seen (last_seen)
|
||||
);
|
||||
24
migrations/dlu/sqlite/85_client_sysinfo.sql
Normal file
24
migrations/dlu/sqlite/85_client_sysinfo.sql
Normal file
@@ -0,0 +1,24 @@
|
||||
/* The system description clients send with their login request, as reported by the client. See the MySQL migration. */
|
||||
CREATE TABLE IF NOT EXISTS client_sysinfo (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
account_id INTEGER NOT NULL,
|
||||
first_seen BIGINT NOT NULL,
|
||||
last_seen BIGINT NOT NULL,
|
||||
logins INTEGER NOT NULL DEFAULT 1,
|
||||
ip TEXT NOT NULL DEFAULT '',
|
||||
client_os INTEGER NOT NULL DEFAULT 0,
|
||||
memory_stats TEXT NOT NULL DEFAULT '',
|
||||
memory_total_kb BIGINT NOT NULL DEFAULT 0,
|
||||
video_card TEXT NOT NULL DEFAULT '',
|
||||
number_of_processors INTEGER NOT NULL DEFAULT 0,
|
||||
processor_type INTEGER NOT NULL DEFAULT 0,
|
||||
processor_level INTEGER NOT NULL DEFAULT 0,
|
||||
processor_revision INTEGER NOT NULL DEFAULT 0,
|
||||
os_version_info_size INTEGER NOT NULL DEFAULT 0,
|
||||
os_major_version INTEGER NOT NULL DEFAULT 0,
|
||||
os_minor_version INTEGER NOT NULL DEFAULT 0,
|
||||
os_build_number INTEGER NOT NULL DEFAULT 0,
|
||||
os_platform_id INTEGER NOT NULL DEFAULT 0
|
||||
);
|
||||
CREATE INDEX IF NOT EXISTS client_sysinfo_account ON client_sysinfo (account_id, id);
|
||||
CREATE INDEX IF NOT EXISTS client_sysinfo_last_seen ON client_sysinfo (last_seen);
|
||||
Reference in New Issue
Block a user