using System;
using System.CodeDom.Compiler;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using Agents;
using BepInEx;
using BepInEx.Logging;
using BepInEx.Unity.IL2CPP;
using BepInEx.Unity.IL2CPP.Utils.Collections;
using GTFO.API;
using Il2CppSystem;
using LevelGeneration;
using Microsoft.CodeAnalysis;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("NoDoorCheese")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("NoDoorCheese")]
[assembly: AssemblyTitle("NoDoorCheese")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
internal sealed class NullableAttribute : Attribute
{
public readonly byte[] NullableFlags;
public NullableAttribute(byte P_0)
{
NullableFlags = new byte[1] { P_0 };
}
public NullableAttribute(byte[] P_0)
{
NullableFlags = P_0;
}
}
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
internal sealed class NullableContextAttribute : Attribute
{
public readonly byte Flag;
public NullableContextAttribute(byte P_0)
{
Flag = P_0;
}
}
}
namespace NoDoorCheese
{
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInPlugin("hirnukuono-NoDoorCheese", "hirnukuono-NoDoorCheese", "0.0.7")]
public class Plugin : BasePlugin
{
public class NoDoorCheese : MonoBehaviour
{
[CompilerGenerated]
private sealed class <AntiCheese>d__5 : IEnumerator<object>, IDisposable, IEnumerator
{
private int <>1__state;
private object <>2__current;
private List<LG_WeakDoor>.Enumerator <>7__wrap1;
private LG_WeakDoor <door>5__3;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <AntiCheese>d__5(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
int num = <>1__state;
if (num == -3 || (uint)(num - 1) <= 2u)
{
try
{
}
finally
{
<>m__Finally1();
}
}
<>7__wrap1 = default(List<LG_WeakDoor>.Enumerator);
<door>5__3 = null;
<>1__state = -2;
}
private bool MoveNext()
{
//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
//IL_00ef: Expected O, but got Unknown
//IL_012a: Unknown result type (might be due to invalid IL or missing references)
//IL_0131: Invalid comparison between Unknown and I4
//IL_0067: Unknown result type (might be due to invalid IL or missing references)
//IL_006e: Invalid comparison between Unknown and I4
//IL_021b: Unknown result type (might be due to invalid IL or missing references)
//IL_0225: Expected O, but got Unknown
//IL_008e: Unknown result type (might be due to invalid IL or missing references)
//IL_0098: Expected O, but got Unknown
//IL_0173: Unknown result type (might be due to invalid IL or missing references)
//IL_017d: Unknown result type (might be due to invalid IL or missing references)
//IL_0182: Unknown result type (might be due to invalid IL or missing references)
//IL_0191: Unknown result type (might be due to invalid IL or missing references)
//IL_019b: Unknown result type (might be due to invalid IL or missing references)
//IL_01a0: Unknown result type (might be due to invalid IL or missing references)
try
{
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
goto IL_0033;
case 1:
<>1__state = -3;
<door>5__3.TriggerOperate(true);
<door>5__3.m_sync.AttemptDoorInteraction((eDoorInteractionType)0, 0f, 0f, default(Vector3), (Agent)null);
<>2__current = (object)new WaitForSeconds(0.3f);
<>1__state = 2;
return true;
case 2:
<>1__state = -3;
goto IL_0124;
case 3:
<>1__state = -3;
goto IL_0124;
case 4:
<>1__state = -1;
goto IL_0033;
case 5:
{
<>1__state = -1;
break;
}
IL_0124:
if ((int)<door>5__3.LastStatus == 16)
{
<>2__current = null;
<>1__state = 3;
return true;
}
foreach (LG_DoorButton componentsInChild in ((Component)<door>5__3).GetComponentsInChildren<LG_DoorButton>())
{
componentsInChild.m_enabled = false;
}
<door>5__3.m_sync.SetStateUnsynced(new pDoorState
{
status = (eDoorStatus)11
});
<door>5__3.OnSyncDoorStateChange(new pDoorState
{
status = (eDoorStatus)11
}, false);
Log.LogInfo((object)"door cheese prevented. how u like dem apples?");
MapDataManager.Current.m_syncedGUIObjects[<door>5__3.m_mapLookatRevealer.MapGUIObjID].SyncSetStatus((eCM_GuiObjectStatus)3);
unche.Add(<door>5__3);
goto IL_01ec;
IL_01f3:
if (<>7__wrap1.MoveNext())
{
<door>5__3 = <>7__wrap1.Current;
if ((int)<door>5__3.LastStatus == 11 && !unche.Contains(<door>5__3))
{
<>2__current = (object)new WaitForSeconds(3f);
<>1__state = 1;
return true;
}
goto IL_01ec;
}
<>m__Finally1();
<>7__wrap1 = default(List<LG_WeakDoor>.Enumerator);
<>2__current = (object)new WaitForSeconds(1f);
<>1__state = 4;
return true;
IL_01ec:
<door>5__3 = null;
goto IL_01f3;
IL_0033:
<>7__wrap1 = doors.GetEnumerator();
<>1__state = -3;
goto IL_01f3;
}
}
catch
{
//try-fault
((IDisposable)this).Dispose();
throw;
}
((IDisposable)this).Dispose();
return true;
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
private void <>m__Finally1()
{
<>1__state = -1;
((IDisposable)<>7__wrap1).Dispose();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
public static ManualLogSource Log;
public static List<LG_WeakDoor> doors = new List<LG_WeakDoor>();
public static List<LG_WeakDoor> unche = new List<LG_WeakDoor>();
private void Start()
{
Log.LogInfo((object)"the cheese goeth away!");
}
public void Initialize()
{
doors.Clear();
unche.Clear();
foreach (LG_WeakDoor item in Object.FindObjectsOfType<LG_WeakDoor>())
{
doors.Add(item);
}
Log.LogInfo((object)("found weakdoors to monitor and anticheese: " + doors.Count()));
CoroutineManager.StartCoroutine(CollectionExtensions.WrapToIl2Cpp(AntiCheese()), (Action)null);
}
[IteratorStateMachine(typeof(<AntiCheese>d__5))]
public static IEnumerator AntiCheese()
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <AntiCheese>d__5(0);
}
}
public override void Load()
{
NoDoorCheese @object = ((BasePlugin)this).AddComponent<NoDoorCheese>();
NoDoorCheese.Log = ((BasePlugin)this).Log;
EventAPI.OnExpeditionStarted += @object.Initialize;
}
}
[GeneratedCode("VersionInfoGenerator", "2.0.0+git50a4b1a-master")]
[CompilerGenerated]
internal static class VersionInfo
{
public const string RootNamespace = "NoDoorCheese";
public const string Version = "1.0.0";
public const string VersionPrerelease = null;
public const string VersionMetadata = null;
public const string SemVer = "1.0.0";
public const string GitRevShort = null;
public const string GitRevLong = null;
public const string GitBranch = null;
public const string GitTag = null;
public const bool GitIsDirty = false;
}
}