mirror of
https://github.com/RPCS3/discord-bot.git
synced 2024-12-02 16:06:51 +00:00
fix the actually stupid part where an empty value could overwrite the valid one
This commit is contained in:
parent
897142388c
commit
cc37ac833a
@ -42,7 +42,7 @@ namespace CompatBot.EventHandlers.LogParsing
|
||||
["Physical device intialized"] = new Regex(@"Physical device intialized\. GPU=(?<vulkan_gpu>.+), driver=(?<vulkan_driver_version_raw>-?\d+)\r?$", DefaultOptions),
|
||||
["Found vulkan-compatible GPU:"] = new Regex(@"Found vulkan-compatible GPU: (?<vulkan_found_device>'(?<vulkan_compatible_device_name>.+)' running.+)\r?$", DefaultOptions),
|
||||
["Serial:"] = new Regex(@"Serial: (?<serial>[A-z]{4}\d{5})\r?$", DefaultOptions),
|
||||
["Successfully installed PS3 firmware"] = new Regex(@"(?<fw_installed_message>Successfully installed PS3 firmware version (?<fw_version_installed>\d+\.\d+)).*\r?$", DefaultOptions),
|
||||
["Successfully installed PS3 firmware"] = new Regex(@"(?<fw_installed_message>Successfully installed PS3 firmware) version (?<fw_version_installed>\d+\.\d+).*\r?$", DefaultOptions),
|
||||
["Title:"] = new Regex(@"Title: (?<game_title>.*)?\r?$", DefaultOptions),
|
||||
["Category:"] = new Regex(@"Category: (?<game_category>.*)?\r?$", DefaultOptions),
|
||||
["LDR:"] = new Regex(@"(Path|Cache): ((?<win_path>\w:/)|(?<lin_path>/[^/])).*?\r?$", DefaultOptions),
|
||||
@ -194,7 +194,7 @@ namespace CompatBot.EventHandlers.LogParsing
|
||||
}
|
||||
state.WipCollection = new NameValueCollection();
|
||||
Copy(
|
||||
"build_and_specs",
|
||||
"build_and_specs", "fw_version_installed",
|
||||
"vulkan_gpu", "d3d_gpu",
|
||||
"driver_version", "driver_manuf",
|
||||
"driver_manuf_new", "driver_version_new",
|
||||
|
@ -50,16 +50,22 @@ namespace CompatBot.EventHandlers.LogParsing
|
||||
foreach (Group group in match.Groups)
|
||||
if (!string.IsNullOrEmpty(group.Name) && group.Name != "0" && !string.IsNullOrWhiteSpace(group.Value))
|
||||
{
|
||||
var strValue = group.Value.ToUtf8();
|
||||
if (string.IsNullOrEmpty(strValue))
|
||||
continue;
|
||||
|
||||
Config.Log.Debug($"regex {group.Name} = {group.Value}");
|
||||
if (MultiValueItems.Contains(group.Name))
|
||||
{
|
||||
var currentValue = state.WipCollection[group.Name];
|
||||
if (!string.IsNullOrEmpty(currentValue))
|
||||
currentValue += Environment.NewLine;
|
||||
state.WipCollection[group.Name] = currentValue + group.Value.ToUtf8();
|
||||
state.WipCollection[group.Name] = currentValue + strValue;
|
||||
}
|
||||
else
|
||||
state.WipCollection[group.Name] = group.Value.ToUtf8();
|
||||
{
|
||||
state.WipCollection[group.Name] = strValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -18,7 +18,9 @@ namespace CompatBot.Utils.ResultFormatters
|
||||
{
|
||||
items["build_branch"] = m.Groups["branch"].Value.Trim();
|
||||
items["build_commit"] = m.Groups["commit"].Value.Trim();
|
||||
items["fw_version_installed"] = m.Groups["fw_version_installed"].Value;
|
||||
var fwVersion = m.Groups["fw_version_installed"].Value;
|
||||
if (!string.IsNullOrEmpty(fwVersion))
|
||||
items["fw_version_installed"] = fwVersion;
|
||||
items["cpu_model"] = m.Groups["cpu_model"].Value
|
||||
.Replace("(R)", "", StringComparison.InvariantCultureIgnoreCase)
|
||||
.Replace("®", "", StringComparison.InvariantCultureIgnoreCase)
|
||||
|
Loading…
Reference in New Issue
Block a user