/** * Client system info (client_sysinfo): the card on an account's page (#sysinfoCard) with every description the * account's client sent at login, and the Client System Info page (#sysinfoPage) with the spread across players. * Everything here is as reported by the client, which often reports compatibility values rather than the real * hardware; each field is shown with what it is worth (the caveats the API sends). */ (function () { 'use strict'; function kb(n) { return n === null || n === undefined ? '-' : fmt.bytes(Number(n) * 1024); } function bytes(n) { return n === null || n === undefined ? '-' : fmt.bytes(n); } function hex(n) { return '0x' + Number(n).toString(16); } function caveat(caveats, key) { return caveats[key] ? '
' + esc(r.memory_stats) + '' + (m.complete ? '' : ' not fully read'), 'memoryStats'],
['Physical memory: total / free', kb(m.total_phys_kb) + ' / ' + kb(m.avail_phys_kb) + (m.memory_load_percent === null ? '' : ' (' + esc(m.memory_load_percent) + '% in use)'), ''],
['Commit limit (pfile): total / free', kb(m.total_pagefile_kb) + ' / ' + kb(m.avail_pagefile_kb), ''],
['Client address space (vmem): total / free', kb(m.total_virtual_kb) + ' / ' + kb(m.avail_virtual_kb), ''],
['Client process: working set / private (peak)', bytes(m.working_set_bytes) + ' / ' + bytes(m.pagefile_usage_bytes) + ' (' + bytes(m.peak_working_set_bytes) + ' / ' + bytes(m.peak_pagefile_usage_bytes) + ')', ''],
['Video card (videoCard)', esc(r.video_card || '(empty)'), 'videoCard'],
['Processors (numberOfProcessors)', esc(r.number_of_processors), 'numberOfProcessors'],
['Processor type (processorType)', esc(r.processor_type), 'processorType'],
['Processor level (processorLevel)', esc(r.processor_level), 'processorLevel'],
['Processor revision (processorRevision)', esc(r.processor_revision) + ' (' + hex(r.processor_revision) + ': model ' + esc(r.processor_model) + ', stepping ' + esc(r.processor_stepping) + ')', 'processorRevision'],
['Windows version (major.minor.build)', esc(r.os_version) + ' ' + esc(r.os_label) + '', 'osVersion'],
['Platform ID (platformID)', esc(r.os_platform_id), 'platformId'],
['Version info size (osVersionInfoSize)', esc(r.os_version_info_size), 'osVersionInfoSize']
];
if (showsIp) list.unshift(['Address', r.ip ? '' + esc(r.ip) + '' : 'not kept', 'ip']);
return list;
}
function accountCard(card) {
var accountId = card.dataset.account;
api.get('/api/accounts/' + accountId + '/client_sysinfo').then(function (d) {
if (!d.success) return;
document.getElementById('sysinfoCount').textContent = d.rows.length;
var list = document.getElementById('sysinfoList');
if (!d.rows.length) {
list.innerHTML = 'Nothing on record: the client sends this at each game login (kept for log_client_sysinfo_days).
'; return; } list.innerHTML = d.rows.map(function (r, i) { var summary = '' + esc(fmt.unix(r.last_seen)) + '' + (r.first_seen !== r.last_seen ? ' since ' + esc(fmt.unix(r.first_seen)) + '' : '') + ' · ' + esc(r.logins) + ' login' + (r.logins === 1 ? '' : 's') + ' · reports Windows ' + esc(r.os_version) + ' · ' + esc(r.video_card || 'no video card') + ' · ' + esc(r.number_of_processors) + ' CPUs · ' + kb(r.memory_total_kb) + (d.showsIp && r.ip ? ' ·' + esc(r.ip) + '' : '');
var rows = fields(r, d.showsIp).map(function (f) {
return '