mtasa-blue icon indicating copy to clipboard operation
mtasa-blue copied to clipboard

Add getSystemInfo function

Open Pirulax opened this issue 3 years ago • 58 comments

This function returns basic information about the client's system in a table. Example:

{
    CPU = {
        MaxClockSpeed = 3200,
        NaNumberOfCores = 6,
        Name = "AMD Ryzen 5 1600 Six-Core Processor",
        NumberOfLogicalProcessors = 12
    },
    GPU = {
        Name = "Radeon RX 570 Series",
        RAM = 419328
    },
    TotalPhysicalMemory = 16727152 -- in bytes. I actually think it should be in MB (as the VRAM size)
}

Note: First call to this function is veeeeeery slow, as it has to query WMI. Subsequent calls are fast, as static variables are used to cache the data.

To clarify, this PR adds:

  • CPU info (table under CPU key)
  • TotalPhysicalMemory
  • GPU info is just here for convenience (already available from dxGetStatus)

Pirulax avatar Jun 18 '21 21:06 Pirulax