Skip to content

Commit 4550772

Browse files
committed
Misc changes and keen log fix
1 parent e86cfc4 commit 4550772

2 files changed

Lines changed: 19 additions & 0 deletions

File tree

‎Torch.API/WebAPI/PluginQuery.cs‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,13 @@ namespace Torch.API.WebAPI
1212
{
1313
public class PluginQuery
1414
{
15+
#if DEBUG
16+
private const string ALL_QUERY = "https://torchapi.com/api/plugins?includeArchived=true";
17+
#else
1518
private const string ALL_QUERY = "https://torchapi.com/api/plugins";
19+
#endif
20+
21+
1622
private const string PLUGIN_QUERY = "https://torchapi.com/api/plugins/item/{0}";
1723
private readonly HttpClient _client;
1824
private static readonly Logger Log = LogManager.GetCurrentClassLogger();

‎Torch/Patches/KeenLogPatch.cs‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
using Torch.Managers.PatchManager;
1111
using Torch.Utils;
1212
using VRage.Utils;
13+
using Sandbox.Engine.Multiplayer;
14+
using Sandbox.Game.World;
1315

1416
namespace Torch.Patches
1517
{
@@ -42,6 +44,9 @@ internal static class KeenLogPatch
4244

4345
[ReflectedMethodInfo(typeof(MyLog), nameof(MyLog.WriteLineAndConsole), Parameters = new[] { typeof(string) })]
4446
private static MethodInfo _logWriteLineAndConsole;
47+
48+
[ReflectedMethodInfo(typeof(MyMultiplayerServerBase), nameof(MyMultiplayerServerBase.ValidationFailed), Parameters = new[] { typeof(ulong), typeof(bool), typeof(string), typeof(bool) })]
49+
private static MethodInfo _logSuppressValidationFailed;
4550
#pragma warning restore 649
4651

4752

@@ -58,6 +63,9 @@ public static void Patch(PatchContext context)
5863
context.GetPattern(_logAppendToClosedLogException).Prefixes.Add(Method(nameof(PrefixAppendToClosedLogException)));
5964

6065
context.GetPattern(_logWriteLineOptions).Prefixes.Add(Method(nameof(PrefixWriteLineOptions)));
66+
67+
_log.Info("Suppressing ValidationFailed() - This is a temporary band-aid until keen fix it.");
68+
context.GetPattern(_logSuppressValidationFailed).Prefixes.Add(Method(nameof(SuppressActionBlockedLog)));
6169

6270
}
6371

@@ -168,5 +176,10 @@ private static LogLevel LogLevelFor(MyLogSeverity severity)
168176
return LogLevel.Info;
169177
}
170178
}
179+
180+
private static bool SuppressActionBlockedLog(ulong clientId, bool kick = true, string additionalInfo = null, bool stackTrace = true)
181+
{
182+
return false;
183+
}
171184
}
172185
}

0 commit comments

Comments
 (0)