using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using HarmonyLib;
using LethalAPI.LibTerminal.Interactions;
using LethalAPI.LibTerminal.Models;
using Microsoft.CodeAnalysis;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("Azx")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Allows the player to purchase an extra day via the terminal. This mod's uniqueness is that It tries to add functionality that will give you the option to extend the deadline but with some price on it.")]
[assembly: AssemblyFileVersion("2.2.2.0")]
[assembly: AssemblyInformationalVersion("2.2.2")]
[assembly: AssemblyProduct("LethalAPITerminalFix")]
[assembly: AssemblyTitle("LethalAPITerminalFix")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("2.2.2.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
internal sealed class RefSafetyRulesAttribute : Attribute
{
public readonly int Version;
public RefSafetyRulesAttribute(int P_0)
{
Version = P_0;
}
}
}
namespace Azx.LethalAPITerminalFix
{
[HarmonyPatch(typeof(ConfirmInteraction))]
internal static class ConfirmInteraction_PrefixMatchPatch
{
[HarmonyPatch("HandleTerminalResponse")]
[HarmonyPrefix]
private static bool HandleTerminalResponsePrefix(ConfirmInteraction __instance, ArgumentStream arguments, ref object __result)
{
//IL_003e: Unknown result type (might be due to invalid IL or missing references)
//IL_0069: Unknown result type (might be due to invalid IL or missing references)
string text = default(string);
if (!arguments.TryReadNext(ref text) || string.IsNullOrWhiteSpace(text))
{
return true;
}
string value = text.Trim();
if ("confirm".StartsWith(value, StringComparison.InvariantCultureIgnoreCase))
{
__result = Invoke(__instance.ConfirmHandler, __instance.Services, arguments);
return false;
}
if ("deny".StartsWith(value, StringComparison.InvariantCultureIgnoreCase))
{
__result = Invoke(__instance.DenyHandler, __instance.Services, arguments);
return false;
}
return true;
}
private static object Invoke(Delegate handler, ServiceCollection services, ArgumentStream args)
{
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
if ((object)handler == null)
{
return string.Empty;
}
Func<object, object> func = default(Func<object, object>);
if (CommandActivator.TryCreateInvoker(args, services, handler.GetMethodInfo(), ref func) && func != null)
{
return func(handler.Target);
}
return null;
}
}
}