diff --git a/Clients/GithubClient/GithubClient.csproj b/Clients/GithubClient/GithubClient.csproj
index bf59ba89..31cfa417 100644
--- a/Clients/GithubClient/GithubClient.csproj
+++ b/Clients/GithubClient/GithubClient.csproj
@@ -6,7 +6,7 @@
-
+
diff --git a/CompatBot/Commands/BotMath.cs b/CompatBot/Commands/BotMath.cs
index cb77d0da..b28b4fe9 100644
--- a/CompatBot/Commands/BotMath.cs
+++ b/CompatBot/Commands/BotMath.cs
@@ -1,5 +1,6 @@
using System;
using System.Globalization;
+using System.Threading;
using System.Threading.Tasks;
using CompatBot.Commands.Attributes;
using DSharpPlus.CommandsNext;
@@ -12,6 +13,11 @@ namespace CompatBot.Commands;
[Description("Math, here you go Juhn. Use `math help` for syntax help")]
internal sealed class BotMath : BaseCommandModuleCustom
{
+ static BotMath()
+ {
+ License.iConfirmNonCommercialUse("RPCS3");
+ }
+
[GroupCommand, Priority(9)]
public async Task Expression(CommandContext ctx, [RemainingText, Description("Math expression")] string expression)
{
@@ -35,8 +41,23 @@ public async Task Expression(CommandContext ctx, [RemainingText, Description("Ma
""";
try
{
+ mXparser.resetCancelCurrentCalculationFlag();
var expr = new Expression(expression);
- result = expr.calculate().ToString(CultureInfo.InvariantCulture);
+ const int timeout = 1_000;
+ var cts = new CancellationTokenSource(timeout);
+ // ReSharper disable once MethodSupportsCancellation
+ var delayTask = Task.Delay(timeout);
+ var calcTask = Task.Run(() => expr.calculate().ToString(CultureInfo.InvariantCulture), cts.Token);
+ await Task.WhenAny(calcTask, delayTask).ConfigureAwait(false);
+ if (calcTask.IsCompletedSuccessfully)
+ {
+ result = await calcTask;
+ }
+ else
+ {
+ mXparser.cancelCurrentCalculation();
+ result = "Calculation took too much time and all operations were cancelled";
+ }
}
catch (Exception e)
{
diff --git a/CompatBot/Commands/Warnings.cs b/CompatBot/Commands/Warnings.cs
index 4cc5eb0c..98d7447c 100644
--- a/CompatBot/Commands/Warnings.cs
+++ b/CompatBot/Commands/Warnings.cs
@@ -326,7 +326,8 @@ private static async Task ListUserWarningsAsync(DiscordClient client, DiscordMes
table.Add(warning.Id.ToString(), "+", issuerName, timestamp, warning.Reason, warning.FullReason);
}
}
- var result = new StringBuilder("Warning list for ").Append(userName);
+
+ var result = new StringBuilder("Warning list for ").Append(Formatter.Sanitize(userName));
if (!isPrivate && !isWhitelisted && count > maxWarningsInPublicChannel)
result.Append($" (last {showCount} of {count}, full list in DMs)");
result.AppendLine(":").Append(table);
diff --git a/CompatBot/Utils/ResultFormatters/LogParserResultFormatter.cs b/CompatBot/Utils/ResultFormatters/LogParserResultFormatter.cs
index 4f07416b..5be813a5 100644
--- a/CompatBot/Utils/ResultFormatters/LogParserResultFormatter.cs
+++ b/CompatBot/Utils/ResultFormatters/LogParserResultFormatter.cs
@@ -1032,13 +1032,14 @@ select m
13 => "macOS High Sierra",
14 => "macOS Mojave",
15 => "macOS Catalina",
- _ => null,
+ _ => "Unknown Apple OS",
},
11 => "macOS Big Sur",
12 => "macOS Monterey",
13 => "macOS Ventura",
14 => "macOS Sonoma",
- _ => null,
+ 15 => "macOS Sequoia",
+ _ => "Unknown Apple OS",
};
internal static bool IsAmd(string gpuInfo)