using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Text.Json;
using System.Text.RegularExpressions;
using AIGraph;
using API;
using Agents;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using BepInEx.Unity.IL2CPP;
using ChainedPuzzles;
using DoubleSidedDoors.BepInEx;
using DoubleSidedDoors.Patches;
using GameData;
using HarmonyLib;
using Il2CppInterop.Runtime.InteropTypes;
using Il2CppSystem;
using Il2CppSystem.Collections.Generic;
using LevelGeneration;
using MTFO.API;
using Microsoft.CodeAnalysis;
using Player;
using UnityEngine;
using UnityEngine.Analytics;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("DoubleSidedDoors")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+76539a66fae8702cc9087365273644ce33224c06")]
[assembly: AssemblyProduct("DoubleSidedDoors")]
[assembly: AssemblyTitle("DoubleSidedDoors")]
[assembly: AssemblyVersion("1.0.0.0")]
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 API
{
[HarmonyPatch(typeof(GameDataInit))]
internal class GameDataInit_Patches
{
[HarmonyPatch("Initialize")]
[HarmonyWrapSafe]
[HarmonyPostfix]
public static void Initialize_Postfix()
{
Analytics.enabled = false;
}
}
internal static class APILogger
{
private static readonly ManualLogSource logger;
static APILogger()
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_0010: Expected O, but got Unknown
logger = new ManualLogSource("Rand-API");
Logger.Sources.Add((ILogSource)(object)logger);
}
private static string Format(string module, object msg)
{
return $"[{module}]: {msg}";
}
public static void Info(string module, object data)
{
logger.LogMessage((object)Format(module, data));
}
public static void Verbose(string module, object data)
{
logger.LogDebug((object)Format(module, data));
}
public static void Log(object data)
{
logger.LogDebug((object)Format("DoubleSidedDoors", data));
}
public static void Debug(object data, bool force = false)
{
if (ConfigManager.Debug || force)
{
Log(data);
}
}
public static void Warn(object data)
{
logger.LogWarning((object)Format("DoubleSidedDoors", data));
}
public static void Error(object data)
{
logger.LogError((object)Format("DoubleSidedDoors", data));
}
}
}
namespace DoubleSidedDoors
{
internal static class JSON
{
private static readonly JsonSerializerOptions _setting;
static JSON()
{
_setting = new JsonSerializerOptions
{
ReadCommentHandling = JsonCommentHandling.Skip,
IncludeFields = false,
PropertyNameCaseInsensitive = true,
WriteIndented = true,
IgnoreReadOnlyProperties = true
};
}
public static T Deserialize<T>(string json)
{
return JsonSerializer.Deserialize<T>(json, _setting);
}
public static object Deserialize(Type type, string json)
{
return JsonSerializer.Deserialize(json, type, _setting);
}
public static string Serialize(object value, Type type)
{
return JsonSerializer.Serialize(value, type, _setting);
}
}
public sealed class LayoutConfig
{
public uint LevelLayoutID { get; set; }
public DoorIdentifier[] Doors { get; set; } = Array.Empty<DoorIdentifier>();
public DoorIdentifier[] AddHandle { get; set; } = Array.Empty<DoorIdentifier>();
public BindDoorToPlayer[] BindDoorToPlayer { get; set; } = Array.Empty<BindDoorToPlayer>();
public DoorIdentifier[] DoorLockedGraphicOverrides { get; set; } = Array.Empty<DoorIdentifier>();
public DoorMessageOverride[] DoorMessageOverrides { get; set; } = Array.Empty<DoorMessageOverride>();
public DoorTriggerOverride[] DoorOverrideTrigger { get; set; } = Array.Empty<DoorTriggerOverride>();
}
public sealed class BindDoorToPlayer
{
public int Slot { get; set; }
public DoorIdentifier? Door { get; set; }
}
public sealed class DoorIdentifier
{
public int To { get; set; }
public int From { get; set; } = -1;
public string Text { get; set; } = "<color=red>BI-DIRECTIONAL ACCESS DISABLED</color>";
public string State { get; set; } = "";
}
public sealed class DoorMessageOverride
{
public DoorIdentifier? Door { get; set; }
public string Message { get; set; } = string.Empty;
}
public sealed class DoorTriggerOverride
{
public DoorIdentifier? Door { get; set; }
public DoorIdentifier? Target { get; set; }
public bool OpenOnTarget { get; set; } = false;
}
}
namespace DoubleSidedDoors.Patches
{
[HarmonyPatch]
internal static class Spawn
{
public static Dictionary<uint, LayoutConfig> data = new Dictionary<uint, LayoutConfig>();
public static Dictionary<int, Dictionary<int, LG_SecurityDoor>> doors = new Dictionary<int, Dictionary<int, LG_SecurityDoor>>();
private static HashSet<int> reversedSecDoors = new HashSet<int>();
private static Dictionary<int, GameObject> reversedGates = new Dictionary<int, GameObject>();
private static Dictionary<int, LG_Area> reversedGenericTerminalItem = new Dictionary<int, LG_Area>();
private static bool onDoorSync = false;
private static Dictionary<int, HashSet<LG_SecurityDoor>> boundDoors = new Dictionary<int, HashSet<LG_SecurityDoor>>();
private static bool IsTargetReachable(AIG_CourseNode source, AIG_CourseNode target)
{
//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
//IL_0114: Unknown result type (might be due to invalid IL or missing references)
//IL_011b: Invalid comparison between Unknown and I4
//IL_011f: Unknown result type (might be due to invalid IL or missing references)
//IL_0126: Invalid comparison between Unknown and I4
if (source == null || target == null)
{
return false;
}
if (source.NodeID == target.NodeID)
{
return true;
}
AIG_SearchID.IncrementSearchID();
ushort searchID = AIG_SearchID.SearchID;
Queue<AIG_CourseNode> queue = new Queue<AIG_CourseNode>();
queue.Enqueue(source);
while (queue.Count > 0)
{
AIG_CourseNode val = queue.Dequeue();
((AIG_CourseGraphMember)val).m_searchID = searchID;
Enumerator<AIG_CoursePortal> enumerator = val.m_portals.GetEnumerator();
while (enumerator.MoveNext())
{
AIG_CoursePortal current = enumerator.Current;
LG_Gate gate = current.Gate;
object obj;
if (gate == null)
{
obj = null;
}
else
{
iLG_Door_Core spawnedDoor = gate.SpawnedDoor;
obj = ((spawnedDoor != null) ? ((Il2CppObjectBase)spawnedDoor).TryCast<LG_SecurityDoor>() : null);
}
LG_SecurityDoor val2 = (LG_SecurityDoor)obj;
if ((Object)(object)val2 != (Object)null)
{
DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(16, 2);
defaultInterpolatedStringHandler.AppendLiteral("SecurityDoor ");
defaultInterpolatedStringHandler.AppendFormatted(val2.m_serialNumber);
defaultInterpolatedStringHandler.AppendLiteral(" - ");
eDoorStatus lastStatus = val2.LastStatus;
defaultInterpolatedStringHandler.AppendFormatted(((object)(eDoorStatus)(ref lastStatus)).ToString());
APILogger.Debug(defaultInterpolatedStringHandler.ToStringAndClear());
if ((int)val2.LastStatus != 10 && (int)val2.LastStatus != 16)
{
continue;
}
}
AIG_CourseNode oppositeNode = current.GetOppositeNode(val);
if (((AIG_CourseGraphMember)oppositeNode).m_searchID != searchID)
{
if (oppositeNode.NodeID == target.NodeID)
{
return true;
}
queue.Enqueue(oppositeNode);
}
}
}
return false;
}
[HarmonyPatch(typeof(SurvivalWave), "GetScoredSpawnPoint_FromElevator")]
[HarmonyPrefix]
private static bool GetScoredSpawnPoint_FromElevator(SurvivalWave __instance, ref ScoredSpawnPoint __result)
{
//IL_0068: Unknown result type (might be due to invalid IL or missing references)
//IL_006e: Unknown result type (might be due to invalid IL or missing references)
//IL_0073: Unknown result type (might be due to invalid IL or missing references)
//IL_0078: Unknown result type (might be due to invalid IL or missing references)
//IL_007c: Unknown result type (might be due to invalid IL or missing references)
//IL_0081: Unknown result type (might be due to invalid IL or missing references)
//IL_0098: Unknown result type (might be due to invalid IL or missing references)
//IL_009d: Unknown result type (might be due to invalid IL or missing references)
//IL_00ab: Expected O, but got Unknown
//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
//IL_00de: Unknown result type (might be due to invalid IL or missing references)
//IL_00e3: 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_00ea: Unknown result type (might be due to invalid IL or missing references)
//IL_0102: Unknown result type (might be due to invalid IL or missing references)
//IL_010c: Unknown result type (might be due to invalid IL or missing references)
//IL_010e: Unknown result type (might be due to invalid IL or missing references)
AIG_CourseNode startCourseNode = __instance.m_courseNode.m_dimension.GetStartCourseNode();
AIG_CourseNode val = null;
Enumerator<PlayerAgent> enumerator = PlayerManager.PlayerAgentsInLevel.GetEnumerator();
while (enumerator.MoveNext())
{
PlayerAgent current = enumerator.Current;
if (IsTargetReachable(startCourseNode, current.m_courseNode))
{
val = current.m_courseNode;
break;
}
}
if (val == null)
{
return true;
}
Vector3 val2 = startCourseNode.Position - val.Position;
Vector3 normalized = ((Vector3)(ref val2)).normalized;
normalized.y = 0f;
List<ScoredSpawnPoint> availableSpawnPointsBetweenElevatorAndNode = __instance.GetAvailableSpawnPointsBetweenElevatorAndNode(val, 20);
ScoredSpawnPoint val3 = new ScoredSpawnPoint
{
totalCost = float.MinValue
};
Vector3 position = val.Position;
float num = 1f;
float num2 = 4f - num;
for (int i = 0; i < availableSpawnPointsBetweenElevatorAndNode.Count; i++)
{
ScoredSpawnPoint val4 = availableSpawnPointsBetweenElevatorAndNode[i];
Vector3 val5 = val4.firstCoursePortal.Position - position;
val5.y = 0f;
((Vector3)(ref val5)).Normalize();
val4.m_dir = val5;
val4.totalCost = Mathf.Clamp01(Vector3.Dot(val5, normalized));
if (val4.pathHeat > num - 0.01f)
{
val4.totalCost += 1f + (1f - Mathf.Clamp(val4.pathHeat - num, 0f, num2) / num2);
}
if (val3 == null)
{
val3 = val4;
}
else if (val4.totalCost > val3.totalCost)
{
val3 = val4;
}
}
if (val3.courseNode == null)
{
val3.courseNode = val;
}
__result = val3;
return false;
}
[HarmonyPatch(typeof(LG_SecurityDoor), "Setup")]
[HarmonyPostfix]
private static void SecurityDoor_Setup(LG_SecurityDoor __instance, LG_Gate gate)
{
int alias = ((LG_ZoneExpander)gate).m_linksFrom.m_zone.Alias;
int alias2 = ((LG_ZoneExpander)gate).m_linksTo.m_zone.Alias;
if (!doors.ContainsKey(alias))
{
doors.Add(alias, new Dictionary<int, LG_SecurityDoor>());
}
doors[alias].Add(alias2, __instance);
}
private static uint GetLayoutIdOfZone(LG_Zone zone)
{
//IL_001c: Unknown result type (might be due to invalid IL or missing references)
//IL_0021: Unknown result type (might be due to invalid IL or missing references)
//IL_0028: Unknown result type (might be due to invalid IL or missing references)
//IL_003a: Expected I4, but got Unknown
//IL_0073: Unknown result type (might be due to invalid IL or missing references)
Dimension dimension = zone.Dimension;
if (dimension.IsMainDimension)
{
LG_LayerType type = zone.Layer.m_type;
ExpeditionInTierData activeExpedition = RundownManager.ActiveExpedition;
return (int)type switch
{
0 => activeExpedition.LevelLayoutData,
1 => activeExpedition.SecondaryLayout,
2 => activeExpedition.ThirdLayout,
_ => throw new NotSupportedException($"LayerType: {type} is not supported!"),
};
}
return dimension.DimensionData.LevelLayoutData;
}
private static bool reverse(uint layerId, int fromAlias, int toAlias)
{
bool flag = false;
if (data.ContainsKey(layerId))
{
flag = data[layerId].Doors.Any((DoorIdentifier d) => d.To == toAlias && (d.From == -1 || d.From == fromAlias));
}
APILogger.Debug($"layerId: {layerId}, fromAlias: {fromAlias}, toAlias: {toAlias} -> {(flag ? "reversed" : "not reversed")}");
return flag;
}
private static bool doubleHandle(uint layerId, int fromAlias, int toAlias)
{
bool flag = false;
if (data.ContainsKey(layerId))
{
flag = data[layerId].AddHandle.Any((DoorIdentifier d) => d.To == toAlias && (d.From == -1 || d.From == fromAlias));
}
APILogger.Debug($"layerId: {layerId}, fromAlias: {fromAlias}, toAlias: {toAlias} -> {(flag ? "doubleHandle" : "not doubleHandle")}");
return flag;
}
private static bool graphic(uint layerId, int fromAlias, int toAlias)
{
bool flag = false;
if (data.ContainsKey(layerId))
{
flag = data[layerId].DoorLockedGraphicOverrides.Any((DoorIdentifier d) => d.To == toAlias && (d.From == -1 || d.From == fromAlias));
}
APILogger.Debug($"layerId: {layerId}, fromAlias: {fromAlias}, toAlias: {toAlias} -> {(flag ? "override handle light" : "leave handle light")}");
return flag;
}
private static bool overrideMessage(uint layerId, int fromAlias, int toAlias)
{
bool flag = false;
if (data.ContainsKey(layerId))
{
flag = data[layerId].DoorMessageOverrides.Any((DoorMessageOverride d) => d.Door != null && d.Door.To == toAlias && (d.Door.From == -1 || d.Door.From == fromAlias));
}
APILogger.Debug($"layerId: {layerId}, fromAlias: {fromAlias}, toAlias: {toAlias} -> {(flag ? "override message" : "not overridden")}");
return flag;
}
private static bool overrideTrigger(uint layerId, int fromAlias, int toAlias)
{
bool flag = false;
if (data.ContainsKey(layerId))
{
flag = data[layerId].DoorOverrideTrigger.Any((DoorTriggerOverride d) => d.Door != null && d.Door.To == toAlias && (d.Door.From == -1 || d.Door.From == fromAlias));
}
APILogger.Debug($"layerId: {layerId}, fromAlias: {fromAlias}, toAlias: {toAlias} -> {(flag ? "override trigger" : "not trigger")}");
return flag;
}
private static bool overrideTriggerOG(uint layerId, int fromAlias, int toAlias)
{
bool flag = false;
if (data.ContainsKey(layerId))
{
flag = data[layerId].DoorOverrideTrigger.Any((DoorTriggerOverride d) => d.Target != null && d.Target.To == toAlias && (d.Target.From == -1 || d.Target.From == fromAlias));
}
APILogger.Debug($"layerId: {layerId}, fromAlias: {fromAlias}, toAlias: {toAlias} -> {(flag ? "OG trigger" : "not OG trigger")}");
return flag;
}
[HarmonyPatch(typeof(LG_SecurityDoor), "OnSyncDoorStatusChange")]
[HarmonyPrefix]
private static void OnSyncDoorStatusChangeOG(LG_SecurityDoor __instance, pDoorState state)
{
//IL_01d5: Unknown result type (might be due to invalid IL or missing references)
//IL_01d6: Unknown result type (might be due to invalid IL or missing references)
//IL_01dd: Invalid comparison between Unknown and I4
//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
//IL_00ad: Invalid comparison between Unknown and I4
//IL_01df: Unknown result type (might be due to invalid IL or missing references)
//IL_01e0: Unknown result type (might be due to invalid IL or missing references)
//IL_01e7: Invalid comparison between Unknown and I4
//IL_01e9: Unknown result type (might be due to invalid IL or missing references)
//IL_01ea: Unknown result type (might be due to invalid IL or missing references)
//IL_01f0: Invalid comparison between Unknown and I4
//IL_019d: Unknown result type (might be due to invalid IL or missing references)
//IL_01a3: Unknown result type (might be due to invalid IL or missing references)
//IL_02c1: Unknown result type (might be due to invalid IL or missing references)
//IL_02c2: Unknown result type (might be due to invalid IL or missing references)
//IL_02c9: Invalid comparison between Unknown and I4
//IL_02fb: Unknown result type (might be due to invalid IL or missing references)
//IL_02fc: Unknown result type (might be due to invalid IL or missing references)
//IL_0303: Invalid comparison between Unknown and I4
//IL_02e6: Unknown result type (might be due to invalid IL or missing references)
//IL_02ec: Unknown result type (might be due to invalid IL or missing references)
//IL_0344: Unknown result type (might be due to invalid IL or missing references)
//IL_0345: Unknown result type (might be due to invalid IL or missing references)
//IL_034b: Invalid comparison between Unknown and I4
//IL_030e: Unknown result type (might be due to invalid IL or missing references)
//IL_0318: Unknown result type (might be due to invalid IL or missing references)
//IL_031d: Unknown result type (might be due to invalid IL or missing references)
//IL_031f: Unknown result type (might be due to invalid IL or missing references)
//IL_0328: Unknown result type (might be due to invalid IL or missing references)
//IL_0338: Unknown result type (might be due to invalid IL or missing references)
//IL_0356: Unknown result type (might be due to invalid IL or missing references)
//IL_035f: Unknown result type (might be due to invalid IL or missing references)
//IL_0364: Unknown result type (might be due to invalid IL or missing references)
//IL_0366: Unknown result type (might be due to invalid IL or missing references)
//IL_036f: Unknown result type (might be due to invalid IL or missing references)
//IL_037f: Unknown result type (might be due to invalid IL or missing references)
uint layoutIdOfZone = GetLayoutIdOfZone(((LG_ZoneExpander)__instance.Gate).m_linksFrom.m_zone);
int fromAlias = ((LG_ZoneExpander)__instance.Gate).m_linksFrom.m_zone.Alias;
int toAlias = ((LG_ZoneExpander)__instance.Gate).m_linksTo.m_zone.Alias;
if (!overrideTriggerOG(layoutIdOfZone, fromAlias, toAlias))
{
return;
}
DoorTriggerOverride doorTriggerOverride = data[layoutIdOfZone].DoorOverrideTrigger.First((DoorTriggerOverride d) => d.Target != null && d.Target.To == toAlias && (d.Target.From == -1 || d.Target.From == fromAlias));
if (!doorTriggerOverride.OpenOnTarget)
{
if ((int)state.status == 8 && doorTriggerOverride.Door != null && (doorTriggerOverride.Door.From != fromAlias || doorTriggerOverride.Door.To != toAlias) && doors.ContainsKey(doorTriggerOverride.Door.From) && doors[doorTriggerOverride.Door.From].ContainsKey(doorTriggerOverride.Door.To))
{
LG_SecurityDoor linkedDoor = doors[doorTriggerOverride.Door.From][doorTriggerOverride.Door.To];
linkedDoor.m_sync.AttemptDoorInteraction((eDoorInteractionType)4, 0f, 0f, default(Vector3), (Agent)null);
__instance.m_locks.OnChainedPuzzleSolved += Action.op_Implicit((Action)delegate
{
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_002a: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Unknown result type (might be due to invalid IL or missing references)
//IL_0049: Unknown result type (might be due to invalid IL or missing references)
//IL_005c: Unknown result type (might be due to invalid IL or missing references)
//IL_0081: Unknown result type (might be due to invalid IL or missing references)
//IL_0087: Unknown result type (might be due to invalid IL or missing references)
linkedDoor.m_locks.ChainedPuzzleToSolve.AttemptInteract((eChainedPuzzleInteraction)1);
pDoorState val5 = default(pDoorState);
val5.status = (eDoorStatus)9;
pDoorState val6 = val5;
linkedDoor.m_graphics.OnDoorState(val6, false);
linkedDoor.m_anim.OnDoorState(val6, false);
linkedDoor.m_locks.OnDoorState(val6, false);
((Il2CppObjectBase)linkedDoor.m_sync).Cast<LG_Door_Sync>().AttemptDoorInteraction((eDoorInteractionType)5, 0f, 0f, default(Vector3), (Agent)null);
});
}
}
else if (((int)state.status == 10 || (int)state.status == 9 || (int)state.status == 8) && doorTriggerOverride.Door != null && (doorTriggerOverride.Door.From != fromAlias || doorTriggerOverride.Door.To != toAlias) && doors.ContainsKey(doorTriggerOverride.Door.From) && doors[doorTriggerOverride.Door.From].ContainsKey(doorTriggerOverride.Door.To))
{
LG_SecurityDoor val = doors[doorTriggerOverride.Door.From][doorTriggerOverride.Door.To];
if ((int)state.status == 10)
{
val.m_sync.AttemptDoorInteraction((eDoorInteractionType)0, 0f, 0f, default(Vector3), (Agent)null);
}
else if ((int)state.status == 9)
{
pDoorState val2 = default(pDoorState);
val2.status = (eDoorStatus)9;
pDoorState val3 = val2;
val.m_graphics.OnDoorState(val3, false);
val.m_anim.OnDoorState(val3, false);
}
else if ((int)state.status == 8)
{
pDoorState val2 = default(pDoorState);
val2.status = (eDoorStatus)8;
pDoorState val4 = val2;
val.m_graphics.OnDoorState(val4, false);
val.m_anim.OnDoorState(val4, false);
}
}
}
[HarmonyPatch(typeof(LG_Door_Graphics), "OnDoorState")]
[HarmonyPrefix]
private static void Graphic_OnDoorState(LG_Door_Graphics __instance, ref pDoorState state)
{
//IL_0092: Unknown result type (might be due to invalid IL or missing references)
//IL_0098: Invalid comparison between Unknown and I4
//IL_009b: Unknown result type (might be due to invalid IL or missing references)
//IL_00a1: Invalid comparison between Unknown and I4
//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
//IL_00aa: Invalid comparison between Unknown and I4
//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
//IL_00b3: Invalid comparison between Unknown and I4
//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
//IL_00bd: Invalid comparison between Unknown and I4
//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
//IL_00c6: Invalid comparison between Unknown and I4
//IL_0129: Unknown result type (might be due to invalid IL or missing references)
//IL_012b: Unknown result type (might be due to invalid IL or missing references)
//IL_0130: Unknown result type (might be due to invalid IL or missing references)
//IL_0134: Invalid comparison between Unknown and I4
LG_SecurityDoor val = ((Il2CppObjectBase)__instance.m_core).TryCast<LG_SecurityDoor>();
if ((Object)(object)val == (Object)null)
{
return;
}
uint layoutIdOfZone = GetLayoutIdOfZone(((LG_ZoneExpander)val.Gate).m_linksFrom.m_zone);
int fromAlias = ((LG_ZoneExpander)val.Gate).m_linksFrom.m_zone.Alias;
int toAlias = ((LG_ZoneExpander)val.Gate).m_linksTo.m_zone.Alias;
if (!graphic(layoutIdOfZone, fromAlias, toAlias) || ((int)state.status != 5 && (int)state.status != 4 && (int)state.status != 7 && (int)state.status != 6 && (int)state.status != 15 && (int)state.status != 3))
{
return;
}
DoorIdentifier doorIdentifier = data[layoutIdOfZone].DoorLockedGraphicOverrides.First((DoorIdentifier d) => d.To == toAlias && (d.From == -1 || d.From == fromAlias));
if (!(doorIdentifier.State != string.Empty) || !Enum.TryParse<eDoorStatus>(doorIdentifier.State, ignoreCase: true, out eDoorStatus result))
{
return;
}
state.status = result;
if ((int)result == 11)
{
Transform val2 = ((Component)val.m_doorBladeCuller).transform.Find("securityDoor_8x4_tech/bottomDoor/Security_Display_ScanActive");
if ((Object)(object)val2 == (Object)null)
{
((Component)val.m_doorBladeCuller).transform.Find("securityDoor_4x4_tech/rightDoor/Security_Display_ScanActive");
}
if ((Object)(object)val2 != (Object)null)
{
((Component)val2).gameObject.SetActive(false);
}
Transform val3 = ((Component)val.m_doorBladeCuller).transform.Find("securityDoor_8x4_tech/bottomDoor/Security_Display_Locked");
if ((Object)(object)val3 == (Object)null)
{
((Component)val.m_doorBladeCuller).transform.Find("securityDoor_4x4_tech/rightDoor/Security_Display_Locked");
}
if ((Object)(object)val3 != (Object)null)
{
((Component)val3).gameObject.SetActive(false);
}
Transform val4 = ((Component)val.m_doorBladeCuller).transform.Find("securityDoor_8x4_tech/bottomDoor/Security_Display_LockedAlarm");
if ((Object)(object)val4 == (Object)null)
{
((Component)val.m_doorBladeCuller).transform.Find("securityDoor_4x4_tech/rightDoor/Security_Display_LockedAlarm");
}
if ((Object)(object)val4 != (Object)null)
{
((Component)val4).gameObject.SetActive(false);
}
Transform val5 = ((Component)val.m_doorBladeCuller).transform.Find("securityDoor_8x4_tech/bottomDoor/Security_Display_UnLocked");
if ((Object)(object)val5 == (Object)null)
{
((Component)val.m_doorBladeCuller).transform.Find("securityDoor_4x4_tech/rightDoor/Security_Display_UnLocked");
}
if ((Object)(object)val5 != (Object)null)
{
((Component)val5).gameObject.SetActive(false);
}
}
}
[HarmonyPatch(typeof(LG_SecurityDoor), "OnSyncDoorStatusChange")]
[HarmonyPrefix]
private static bool OnSyncDoorStatusChange(LG_SecurityDoor __instance, pDoorState state)
{
//IL_0074: Unknown result type (might be due to invalid IL or missing references)
//IL_0075: Unknown result type (might be due to invalid IL or missing references)
//IL_007b: Invalid comparison between Unknown and I4
//IL_014a: Unknown result type (might be due to invalid IL or missing references)
//IL_0158: Unknown result type (might be due to invalid IL or missing references)
uint layoutIdOfZone = GetLayoutIdOfZone(((LG_ZoneExpander)__instance.Gate).m_linksFrom.m_zone);
int fromAlias = ((LG_ZoneExpander)__instance.Gate).m_linksFrom.m_zone.Alias;
int toAlias = ((LG_ZoneExpander)__instance.Gate).m_linksTo.m_zone.Alias;
if (!overrideTrigger(layoutIdOfZone, fromAlias, toAlias))
{
return true;
}
if ((int)state.status != 8)
{
return true;
}
DoorTriggerOverride doorTriggerOverride = data[layoutIdOfZone].DoorOverrideTrigger.First((DoorTriggerOverride d) => d.Door != null && d.Door.To == toAlias && (d.Door.From == -1 || d.Door.From == fromAlias));
if (doorTriggerOverride.Target != null && (doorTriggerOverride.Target.From != fromAlias || doorTriggerOverride.Target.To != toAlias) && doors.ContainsKey(doorTriggerOverride.Target.From) && doors[doorTriggerOverride.Target.From].ContainsKey(doorTriggerOverride.Target.To))
{
__instance.m_graphics.OnDoorState(state, false);
__instance.m_anim.OnDoorState(state, false);
LG_SecurityDoor_Locks val = ((Il2CppObjectBase)__instance.m_locks).Cast<LG_SecurityDoor_Locks>();
((Interact_Base)val.m_intUseKeyItem).SetActive(false);
((Interact_Base)val.m_intOpenDoor).SetActive(false);
((Interact_Base)val.m_intHack).SetActive(false);
((Interact_Base)val.m_intCustomMessage).SetActive(false);
return false;
}
return true;
}
[HarmonyPatch(typeof(LG_SecurityDoor), "OnSyncDoorStatusChange")]
[HarmonyPrefix]
private static void OnSyncDoorStatusChange_Reverse(LG_SecurityDoor __instance, pDoorState state)
{
//IL_0056: Unknown result type (might be due to invalid IL or missing references)
//IL_0057: Unknown result type (might be due to invalid IL or missing references)
//IL_005e: Invalid comparison between Unknown and I4
uint layoutIdOfZone = GetLayoutIdOfZone(((LG_ZoneExpander)__instance.Gate).m_linksFrom.m_zone);
int alias = ((LG_ZoneExpander)__instance.Gate).m_linksFrom.m_zone.Alias;
int alias2 = ((LG_ZoneExpander)__instance.Gate).m_linksTo.m_zone.Alias;
if (reverse(layoutIdOfZone, alias, alias2) && (int)state.status == 10)
{
int instanceID = ((Object)__instance.Gate).GetInstanceID();
if (reversedGates.ContainsKey(instanceID))
{
reversedGates[instanceID].SetActive(false);
}
}
}
[HarmonyPatch(typeof(LG_Door_Sync), "AttemptInteract")]
[HarmonyPrefix]
private static void AttemptInteract(LG_Door_Sync __instance, pDoorInteraction interaction)
{
//IL_0091: Unknown result type (might be due to invalid IL or missing references)
//IL_0092: Unknown result type (might be due to invalid IL or missing references)
//IL_0098: Invalid comparison between Unknown and I4
//IL_0196: Unknown result type (might be due to invalid IL or missing references)
//IL_019c: Unknown result type (might be due to invalid IL or missing references)
LG_SecurityDoor val = ((Il2CppObjectBase)__instance.m_core).TryCast<LG_SecurityDoor>();
if ((Object)(object)val == (Object)null)
{
return;
}
uint layoutIdOfZone = GetLayoutIdOfZone(((LG_ZoneExpander)val.Gate).m_linksFrom.m_zone);
int fromAlias = ((LG_ZoneExpander)val.Gate).m_linksFrom.m_zone.Alias;
int toAlias = ((LG_ZoneExpander)val.Gate).m_linksTo.m_zone.Alias;
if (overrideTrigger(layoutIdOfZone, fromAlias, toAlias) && (int)interaction.type == 4)
{
DoorTriggerOverride doorTriggerOverride = data[layoutIdOfZone].DoorOverrideTrigger.First((DoorTriggerOverride d) => d.Door != null && d.Door.To == toAlias && (d.Door.From == -1 || d.Door.From == fromAlias));
if (doorTriggerOverride.Target != null && (doorTriggerOverride.Target.From != fromAlias || doorTriggerOverride.Target.To != toAlias) && doors.ContainsKey(doorTriggerOverride.Target.From) && doors[doorTriggerOverride.Target.From].ContainsKey(doorTriggerOverride.Target.To))
{
LG_SecurityDoor val2 = doors[doorTriggerOverride.Target.From][doorTriggerOverride.Target.To];
val2.m_sync.AttemptDoorInteraction((eDoorInteractionType)4, 0f, 0f, default(Vector3), (Agent)null);
}
}
}
[HarmonyPatch(typeof(ElevatorRide), "StartElevatorRide")]
[HarmonyPostfix]
private static void StartElevatorRide()
{
reversedSecDoors.Clear();
reversedGates.Clear();
reversedGenericTerminalItem.Clear();
doors.Clear();
boundDoors.Clear();
}
[HarmonyPatch(typeof(ChainedPuzzleManager), "CreatePuzzleInstance", new Type[]
{
typeof(ChainedPuzzleDataBlock),
typeof(LG_Area),
typeof(LG_Area),
typeof(Vector3),
typeof(Transform),
typeof(bool)
})]
[HarmonyPrefix]
private static void CreateChainedPuzzle(ChainedPuzzleDataBlock data, ref LG_Area sourceArea, ref LG_Area targetArea, Vector3 sourcePos, Transform parent, bool overrideUseStaticBioscanPoints)
{
if (reversedSecDoors.Contains(((Object)parent).GetInstanceID()))
{
LG_Area val = sourceArea;
sourceArea = targetArea;
targetArea = val;
}
}
[HarmonyPatch(typeof(LG_SecurityDoor), "OnSyncDoorStatusChange")]
[HarmonyPrefix]
private static void Prefix_OnSyncDoorStatusChange()
{
onDoorSync = true;
}
[HarmonyPatch(typeof(LG_SecurityDoor), "OnSyncDoorStatusChange")]
[HarmonyPostfix]
private static void Postfix_OnSyncDoorStatusChange()
{
onDoorSync = false;
}
[HarmonyPatch(typeof(LG_SecurityDoor_Locks), "OnDoorState")]
[HarmonyPostfix]
private static void Postfix_OnDoorState(LG_SecurityDoor_Locks __instance, pDoorState state)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
//IL_000a: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Invalid comparison between Unknown and I4
eDoorStatus status = state.status;
eDoorStatus val = status;
if ((int)val != 9)
{
_overrideText(__instance);
}
}
[HarmonyPatch(typeof(LG_SecurityDoor_Locks), "SetupAsLockedNoKey")]
[HarmonyPostfix]
private static void Postfix_OnDoorState(LG_SecurityDoor_Locks __instance)
{
_overrideText(__instance);
}
private static void _overrideText(LG_SecurityDoor_Locks __instance)
{
uint layoutIdOfZone = GetLayoutIdOfZone(((LG_ZoneExpander)__instance.m_door.Gate).m_linksFrom.m_zone);
int fromAlias = ((LG_ZoneExpander)__instance.m_door.Gate).m_linksFrom.m_zone.Alias;
int toAlias = ((LG_ZoneExpander)__instance.m_door.Gate).m_linksTo.m_zone.Alias;
if (overrideMessage(layoutIdOfZone, fromAlias, toAlias))
{
DoorMessageOverride doorMessageOverride = data[layoutIdOfZone].DoorMessageOverrides.First((DoorMessageOverride d) => d.Door != null && d.Door.To == toAlias && (d.Door.From == -1 || d.Door.From == fromAlias));
string text = Regex.Replace(doorMessageOverride.Message, "\\[DOOR\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*\\)\\]", delegate(Match m)
{
int num = int.Parse(m.Groups[1].Value);
int num2 = int.Parse(m.Groups[2].Value);
return (doors.ContainsKey(num) && doors[num].ContainsKey(num2)) ? $"SEC_DOOR_{doors[num][num2].m_serialNumber}" : $"DEBUG_FROM({num})_TO({num2})";
});
__instance.m_intOpenDoor.InteractionMessage = text;
((Interact_Timed)__instance.m_intUseKeyItem).InteractionMessage = text;
((Interact_Timed)__instance.m_intHack).InteractionMessage = text;
__instance.m_intCustomMessage.m_message = text;
}
}
[HarmonyPatch(typeof(LG_ZoneExpander), "GetOppositeArea")]
[HarmonyPrefix]
private static bool GetOppositeArea(LG_ZoneExpander __instance, ref LG_Area __result, LG_Area area)
{
if (onDoorSync)
{
LG_Gate gate = __instance.GetGate();
if ((Object)(object)gate == (Object)null)
{
return true;
}
if (reversedGates.ContainsKey(((Object)gate).GetInstanceID()))
{
__result = area;
return false;
}
}
return true;
}
[HarmonyPatch(typeof(LG_SecurityDoor), "SetNavInfo")]
[HarmonyPrefix]
private static bool SecDoor_NavInfo(LG_SecurityDoor __instance, string infoFwd, string infoBwd, List<string> infoFwdClean, List<string> infoBwdClean)
{
if (!reverse(GetLayoutIdOfZone(((LG_ZoneExpander)__instance.Gate).m_linksFrom.m_zone), ((LG_ZoneExpander)__instance.Gate).m_linksFrom.m_zone.Alias, ((LG_ZoneExpander)__instance.Gate).m_linksTo.m_zone.Alias))
{
return true;
}
__instance.m_graphics.SetNavInfoFwd(infoBwd);
__instance.m_graphics.SetNavInfoBwd(infoFwd);
__instance.m_terminalNavInfoForward = infoBwdClean;
__instance.m_terminalNavInfoBackward = infoFwdClean;
return false;
}
[HarmonyPatch(typeof(WardenObjectiveManager), "CheckExpeditionFailed")]
[HarmonyPostfix]
private static void CheckExpeditionFailed(WardenObjectiveManager __instance, ref bool __result)
{
//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
//IL_00db: Unknown result type (might be due to invalid IL or missing references)
//IL_00e2: Invalid comparison between Unknown and I4
if (__result)
{
return;
}
for (int i = 0; i < PlayerManager.PlayerAgentsInLevel.Count; i++)
{
PlayerAgent val = PlayerManager.PlayerAgentsInLevel[i];
if (((Agent)val).Alive || !boundDoors.ContainsKey(val.PlayerSlotIndex))
{
continue;
}
bool flag = true;
foreach (LG_SecurityDoor item in boundDoors[val.PlayerSlotIndex])
{
APILogger.Debug($"{val.PlayerSlotIndex} -> {((LG_ZoneExpander)item.Gate).m_linksTo.m_zone.Alias} {item.LastStatus}");
if ((int)item.LastStatus != 10)
{
flag = false;
break;
}
}
if (!flag)
{
APILogger.Debug($"{val.PlayerSlotIndex} -> end run");
__result = true;
break;
}
}
}
private static bool bind(uint layerId, int fromAlias, int toAlias, out List<int> slots)
{
slots = new List<int>();
bool flag = false;
if (data.ContainsKey(layerId))
{
BindDoorToPlayer[] bindDoorToPlayer = data[layerId].BindDoorToPlayer;
foreach (BindDoorToPlayer bindDoorToPlayer2 in bindDoorToPlayer)
{
DoorIdentifier door = bindDoorToPlayer2.Door;
if (door != null && door.To == toAlias && (door.From == -1 || door.From == fromAlias))
{
slots.Add(bindDoorToPlayer2.Slot);
flag = true;
}
}
}
APILogger.Debug($"layerId: {layerId}, fromAlias: {fromAlias}, toAlias: {toAlias} -> {(flag ? "bound" : "not bound")}");
return flag;
}
[HarmonyPatch(typeof(LG_SecurityDoor), "Setup")]
[HarmonyPostfix]
private static void SecDoor_Setup(LG_SecurityDoor __instance, LG_Gate gate)
{
//IL_0194: Unknown result type (might be due to invalid IL or missing references)
//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
//IL_01ad: Unknown result type (might be due to invalid IL or missing references)
//IL_028c: Unknown result type (might be due to invalid IL or missing references)
//IL_02a0: Unknown result type (might be due to invalid IL or missing references)
//IL_02a5: Unknown result type (might be due to invalid IL or missing references)
//IL_02f3: Unknown result type (might be due to invalid IL or missing references)
//IL_0307: Unknown result type (might be due to invalid IL or missing references)
//IL_030c: Unknown result type (might be due to invalid IL or missing references)
//IL_02c2: Unknown result type (might be due to invalid IL or missing references)
//IL_02d6: Unknown result type (might be due to invalid IL or missing references)
//IL_02db: Unknown result type (might be due to invalid IL or missing references)
//IL_0360: Unknown result type (might be due to invalid IL or missing references)
LG_Gate gate2 = gate;
if (bind(GetLayoutIdOfZone(((LG_ZoneExpander)gate2).m_linksFrom.m_zone), ((LG_ZoneExpander)gate2).m_linksFrom.m_zone.Alias, ((LG_ZoneExpander)gate2).m_linksTo.m_zone.Alias, out List<int> slots))
{
foreach (int item in slots)
{
if (!boundDoors.ContainsKey(item))
{
boundDoors.Add(item, new HashSet<LG_SecurityDoor>());
}
boundDoors[item].Add(__instance);
}
}
bool flag = reverse(GetLayoutIdOfZone(((LG_ZoneExpander)gate2).m_linksFrom.m_zone), ((LG_ZoneExpander)gate2).m_linksFrom.m_zone.Alias, ((LG_ZoneExpander)gate2).m_linksTo.m_zone.Alias);
bool flag2 = doubleHandle(GetLayoutIdOfZone(((LG_ZoneExpander)gate2).m_linksFrom.m_zone), ((LG_ZoneExpander)gate2).m_linksFrom.m_zone.Alias, ((LG_ZoneExpander)gate2).m_linksTo.m_zone.Alias);
if (!flag && !flag2)
{
return;
}
Transform val = ((Component)__instance).transform.Find("crossing");
if ((Object)(object)val == (Object)null)
{
return;
}
if (flag)
{
val.localRotation *= Quaternion.Euler(0f, 180f, 0f);
}
Transform val2 = ((Component)__instance.m_doorBladeCuller).transform.Find("securityDoor_8x4_tech/bottomDoor/g_securityDoor_bottomDoor_capback");
if ((Object)(object)val2 == (Object)null)
{
val2 = ((Component)__instance.m_doorBladeCuller).transform.Find("securityDoor_4x4_tech (1)/rightDoor/g_securityDoor_bottomDoor_capback001");
if ((Object)(object)val2 == (Object)null)
{
return;
}
}
((Component)val2).gameObject.SetActive(false);
Transform val3 = ((Component)__instance.m_doorBladeCuller).transform.Find("securityDoor_8x4_tech/bottomDoor/InteractionInterface");
bool flag3 = false;
if ((Object)(object)val3 == (Object)null)
{
val3 = ((Component)__instance.m_doorBladeCuller).transform.Find("securityDoor_4x4_tech (1)/rightDoor/InteractionInterface");
flag3 = true;
if ((Object)(object)val3 == (Object)null)
{
return;
}
}
GameObject val4 = Object.Instantiate<GameObject>(((Component)val3).gameObject, val3.parent);
val4.transform.localRotation = val3.localRotation * Quaternion.Euler(180f, 180f, 0f);
if (flag3)
{
val4.transform.localPosition = val3.localPosition + new Vector3(0f, 0.28f, 0f);
}
else
{
val4.transform.localPosition = val3.localPosition + new Vector3(0f, 0f, -0.25f);
}
Transform val5 = ((Component)__instance).transform.Find("crossing/Interaction_Message");
if ((Object)(object)val5 == (Object)null)
{
return;
}
GameObject val6 = Object.Instantiate<GameObject>(((Component)val5).gameObject, val5.parent);
val6.transform.position = val4.transform.position;
Interact_MessageOnScreen component = val6.GetComponent<Interact_MessageOnScreen>();
component.MessageType = (eMessageOnScreenType)1;
if (flag)
{
component.m_message = data[GetLayoutIdOfZone(((LG_ZoneExpander)gate2).m_linksFrom.m_zone)].Doors.First((DoorIdentifier d) => d.To == ((LG_ZoneExpander)gate2).m_linksTo.m_zone.Alias && (d.From == -1 || d.From == ((LG_ZoneExpander)gate2).m_linksFrom.m_zone.Alias)).Text;
}
else if (flag2)
{
component.m_message = data[GetLayoutIdOfZone(((LG_ZoneExpander)gate2).m_linksFrom.m_zone)].AddHandle.First((DoorIdentifier d) => d.To == ((LG_ZoneExpander)gate2).m_linksTo.m_zone.Alias && (d.From == -1 || d.From == ((LG_ZoneExpander)gate2).m_linksFrom.m_zone.Alias)).Text;
}
else
{
component.m_message = "@randomuserhi YOU DON FUCKED UP!";
}
val6.SetActive(true);
((Interact_Base)component).SetActive(true);
reversedSecDoors.Add(((Object)((Component)__instance).transform).GetInstanceID());
reversedGates.Add(((Object)gate2).GetInstanceID(), val6);
reversedGenericTerminalItem.Add(((Object)((Il2CppObjectBase)__instance.m_terminalItem).Cast<LG_GenericTerminalItem>()).GetInstanceID(), ((LG_ZoneExpander)gate2).m_linksTo);
}
[HarmonyPatch(/*Could not decode attribute arguments.*/)]
[HarmonyPostfix]
private static void Postfix_Set_SpawnNode(LG_GenericTerminalItem __instance)
{
int instanceID = ((Object)__instance).GetInstanceID();
if (reversedGenericTerminalItem.ContainsKey(instanceID))
{
LG_Area val = reversedGenericTerminalItem[instanceID];
__instance.FloorItemLocation = val.m_zone.NavInfo.GetFormattedText((LG_NavInfoFormat)7);
__instance.m_spawnNode = val.m_courseNode;
}
}
}
}
namespace DoubleSidedDoors.BepInEx
{
public static class Module
{
public const string GUID = "randomuserhi.DoubleSidedDoors";
public const string Name = "DoubleSidedDoors";
public const string Version = "0.0.1";
}
public static class ConfigManager
{
public static ConfigFile configFile;
private static ConfigEntry<bool> debug;
public static bool Debug
{
get
{
return debug.Value;
}
set
{
debug.Value = value;
}
}
static ConfigManager()
{
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
//IL_001d: Expected O, but got Unknown
string text = Path.Combine(Paths.ConfigPath, "DoubleSidedDoors.cfg");
configFile = new ConfigFile(text, true);
debug = configFile.Bind<bool>("Debug", "enable", false, "Enables debug messages when true.");
DirectoryInfo directoryInfo = Directory.CreateDirectory(Path.Combine(MTFOPathAPI.CustomPath, "DoubleSidedDoors"));
FileInfo[] files = directoryInfo.GetFiles();
APILogger.Debug("Searching: " + directoryInfo.FullName, force: true);
FileInfo[] array = files;
foreach (FileInfo fileInfo in array)
{
APILogger.Debug("Found: " + fileInfo.FullName, force: true);
string extension = fileInfo.Extension;
bool flag = extension.Equals(".json", StringComparison.InvariantCultureIgnoreCase);
bool flag2 = extension.Equals(".jsonc", StringComparison.InvariantCultureIgnoreCase);
if (flag || flag2)
{
LayoutConfig layoutConfig = JSON.Deserialize<LayoutConfig>(File.ReadAllText(fileInfo.FullName));
if (Spawn.data.ContainsKey(layoutConfig.LevelLayoutID))
{
APILogger.Error($"Duplicated ID found!: {fileInfo.Name}, {layoutConfig.LevelLayoutID}");
}
else
{
Spawn.data.Add(layoutConfig.LevelLayoutID, layoutConfig);
}
}
}
}
}
[BepInPlugin("randomuserhi.DoubleSidedDoors", "DoubleSidedDoors", "0.0.1")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
public class Plugin : BasePlugin
{
private static Harmony? harmony;
public override void Load()
{
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
//IL_001b: Expected O, but got Unknown
APILogger.Log("Plugin is loaded!");
harmony = new Harmony("randomuserhi.DoubleSidedDoors");
harmony.PatchAll();
APILogger.Log("Debug is " + (ConfigManager.Debug ? "Enabled" : "Disabled"));
}
}
}