mirror of
https://github.com/RPCS3/discord-bot.git
synced 2024-11-23 10:19:39 +00:00
commit
60c8ed0a54
@ -119,9 +119,6 @@ internal static class HwInfoProvider
|
||||
}
|
||||
else if (ext.StartsWith("TSX"))
|
||||
{
|
||||
if (ext.Contains("disabled"))
|
||||
continue;
|
||||
|
||||
result |= CpuFeatures.Tsx;
|
||||
if (ext.Contains("TSX-FA"))
|
||||
result |= CpuFeatures.TsxFa;
|
||||
|
@ -33,6 +33,7 @@ internal partial class LogParser
|
||||
["0:00:00.0"] = new(@"(?<first_unicode_dot>·).+\r?$", DefaultOptions),
|
||||
["Operating system:"] = LogParserResult.OsInfoInLog,
|
||||
["Current Time:"] = new(@"Current Time: (?<log_start_timestamp>.+)\r?$", DefaultOptions),
|
||||
["Installation ID:"] = new(@"Installation ID: (?<hw_id>.+)\r?$", DefaultOptions), //todo: fix when it's actually implemented
|
||||
["Physical device intialized"] = new(@"Physical device intialized\. GPU=(?<vulkan_gpu>.+), driver=(?<vulkan_driver_version_raw>-?\d+)\r?$", DefaultOptions),
|
||||
["Found vulkan-compatible GPU:"] = new(@"Found vulkan-compatible GPU: (?<vulkan_found_device>'(?<vulkan_compatible_device_name>.+)' running.+)\r?$", DefaultOptions),
|
||||
["Finished reading database from file:"] = new(@"Finished reading database from file: (?<compat_database_path>.*compat_database.dat).*\r?$", DefaultOptions),
|
||||
|
@ -185,18 +185,13 @@ public static class DiscordClientExtensions
|
||||
if (string.IsNullOrEmpty(emojiName))
|
||||
return fallbackEmoji;
|
||||
|
||||
try
|
||||
{
|
||||
if (!emojiName.StartsWith(":"))
|
||||
emojiName = ":" + emojiName;
|
||||
if (!emojiName.EndsWith(":"))
|
||||
emojiName += ":";
|
||||
return DiscordEmoji.FromName(client, emojiName);
|
||||
}
|
||||
catch
|
||||
{
|
||||
return fallbackEmoji;
|
||||
}
|
||||
if (DiscordEmoji.TryFromName(client, emojiName, true, out var result))
|
||||
return result;
|
||||
else if (DiscordEmoji.TryFromName(client, $":{emojiName}:", true, out result))
|
||||
return result;
|
||||
else if (DiscordEmoji.TryFromUnicode(emojiName, out result))
|
||||
return result;
|
||||
return fallbackEmoji;
|
||||
}
|
||||
|
||||
public static Task SendMessageAsync(this DiscordChannel channel, string message, byte[]? attachment, string? filename)
|
||||
|
@ -19,6 +19,13 @@ internal static partial class LogParserResult
|
||||
systemInfo = string.Join('\n', systemInfo.Split('\n', 4).Take(3)).Trim();
|
||||
items["log_from_ui"] = EnabledMark;
|
||||
}
|
||||
var idxStart = systemInfo.IndexOf('\0');
|
||||
if (idxStart > 0)
|
||||
{
|
||||
var idxEnd = systemInfo.IndexOf(" | ", idxStart);
|
||||
if (idxEnd > 0)
|
||||
systemInfo = systemInfo[..idxStart] + systemInfo[idxEnd..];
|
||||
}
|
||||
var sysInfoParts = systemInfo.Split(NewLineChars, StringSplitOptions.RemoveEmptyEntries);
|
||||
var buildInfo = sysInfoParts.Length > 0 ? BuildInfoInLog.Match(sysInfoParts[0]) : BuildInfoInLog.Match(systemInfo);
|
||||
var cpuInfo = sysInfoParts.Length > 1 ? CpuInfoInLog.Match(sysInfoParts[1]) : CpuInfoInLog.Match(systemInfo);
|
||||
|
@ -35,7 +35,7 @@ internal static partial class LogParserResult
|
||||
@"RPCS3 v(?<version_string>(?<version>(\d|\.)+)(-(?<build>\d+))?-(?<commit>[0-9a-z_]+|unknown)) (?<stage>\w+)( \| (?<branch>[^|]+))?( \| Firmware version: (?<fw_version_installed>[^|\r\n]+))?( \| (?<unknown>.*))?\r?$",
|
||||
DefaultSingleLine);
|
||||
private static readonly Regex CpuInfoInLog = new(
|
||||
@"(\d{1,2}(th|rd|nd|st) Gen)?(?<cpu_model>[^|@]+?)\s*(((CPU\s*)?@\s*(?<cpu_speed>.+)\s*GHz\s*)|((APU|(with )?Radeon) [^|]+)|((\w+[\- ]Core )?Processor))?\s* \| (?<thread_count>\d+) Threads \| (?<memory_amount>[0-9\.\,]+) GiB RAM( \| TSC: (?<tsc>\S+))?( \| (?<cpu_extensions>.*?))?\r?$",
|
||||
@"(\d{1,2}(th|rd|nd|st) Gen)?(?<cpu_model>[^|@]+?)\s*(((CPU\s*)?@\s*(?<cpu_speed>.+)\s*GHz\s*)|((APU with|(with )?Radeon|R\d, \d+ Compute) [^|]+)|((\w+[\- ]Core )?Processor))?\s* \| (?<thread_count>\d+) Threads \| (?<memory_amount>[0-9\.\,]+) GiB RAM( \| TSC: (?<tsc>\S+))?( \| (?<cpu_extensions>.*?))?\r?$",
|
||||
DefaultSingleLine);
|
||||
// Operating system: Windows, Major: 10, Minor: 0, Build: 22000, Service Pack: none, Compatibility mode: 0
|
||||
// Operating system: POSIX, Name: Linux, Release: 5.15.11-zen1-1-zen, Version: #1 ZEN SMP PREEMPT Wed, 22 Dec 2021 09:23:53 +0000
|
||||
@ -348,6 +348,13 @@ internal static partial class LogParserResult
|
||||
if (!string.IsNullOrEmpty(threadSched))
|
||||
items["thread_scheduler"] = threadSched;
|
||||
|
||||
if (items["cpu_model"] is string cpu)
|
||||
{
|
||||
cpu = cpu.Replace("AMD FX -", "AMD FX-");
|
||||
|
||||
items["cpu_model"] = cpu;
|
||||
}
|
||||
|
||||
static string? StripOpenGlMaker(string? gpuName)
|
||||
{
|
||||
if (gpuName is null)
|
||||
|
Loading…
Reference in New Issue
Block a user