Decompiled source of ContentLibrary v0.11.1

BepInEx/plugins/ContentLibrary/Notest.ContentLibrary.dll

Decompiled 7 months ago
using System;
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 System.Text;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using MyceliumNetworking;
using Photon.Pun;
using Photon.Realtime;
using Steamworks;
using Unity.Collections;
using Unity.Collections.LowLevel.Unsafe;
using Unity.Mathematics;
using UnityEngine;
using Zorro.Core.Serizalization;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp-firstpass")]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: IgnoresAccessChecksTo("com.rlabrecque.steamworks.net")]
[assembly: IgnoresAccessChecksTo("MeshSplit")]
[assembly: IgnoresAccessChecksTo("Newtonsoft.Json")]
[assembly: IgnoresAccessChecksTo("Photon3Unity3D")]
[assembly: IgnoresAccessChecksTo("PhotonChat")]
[assembly: IgnoresAccessChecksTo("PhotonRealtime")]
[assembly: IgnoresAccessChecksTo("PhotonUnityNetworking")]
[assembly: IgnoresAccessChecksTo("PhotonUnityNetworking.Utilities")]
[assembly: IgnoresAccessChecksTo("PhotonVoice.API")]
[assembly: IgnoresAccessChecksTo("PhotonVoice")]
[assembly: IgnoresAccessChecksTo("PhotonVoice.PUN")]
[assembly: IgnoresAccessChecksTo("pworld")]
[assembly: IgnoresAccessChecksTo("sc.posteffects.runtime")]
[assembly: IgnoresAccessChecksTo("Sirenix.OdinInspector.Attributes")]
[assembly: IgnoresAccessChecksTo("Sirenix.OdinInspector.Modules.Unity.Addressables")]
[assembly: IgnoresAccessChecksTo("Sirenix.OdinInspector.Modules.UnityLocalization")]
[assembly: IgnoresAccessChecksTo("Sirenix.Serialization.Config")]
[assembly: IgnoresAccessChecksTo("Sirenix.Serialization")]
[assembly: IgnoresAccessChecksTo("Sirenix.Utilities")]
[assembly: IgnoresAccessChecksTo("SteamAudioUnity")]
[assembly: IgnoresAccessChecksTo("Tayx.Graphy")]
[assembly: IgnoresAccessChecksTo("Unity.Addressables")]
[assembly: IgnoresAccessChecksTo("Unity.AI.Navigation")]
[assembly: IgnoresAccessChecksTo("Unity.Animation.Rigging")]
[assembly: IgnoresAccessChecksTo("Unity.Animation.Rigging.DocCodeExamples")]
[assembly: IgnoresAccessChecksTo("Unity.Burst")]
[assembly: IgnoresAccessChecksTo("Unity.Burst.Unsafe")]
[assembly: IgnoresAccessChecksTo("Unity.Collections")]
[assembly: IgnoresAccessChecksTo("Unity.Collections.LowLevel.ILSupport")]
[assembly: IgnoresAccessChecksTo("Unity.InternalAPIEngineBridge.013")]
[assembly: IgnoresAccessChecksTo("Unity.Localization")]
[assembly: IgnoresAccessChecksTo("Unity.Mathematics")]
[assembly: IgnoresAccessChecksTo("Unity.PlayableGraphVisualizer")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipeline.Universal.ShaderLibrary")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.ShaderLibrary")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Universal.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Universal.Shaders")]
[assembly: IgnoresAccessChecksTo("Unity.ResourceManager")]
[assembly: IgnoresAccessChecksTo("Unity.ScriptableBuildPipeline")]
[assembly: IgnoresAccessChecksTo("Unity.Splines")]
[assembly: IgnoresAccessChecksTo("Unity.TextMeshPro")]
[assembly: IgnoresAccessChecksTo("Unity.Timeline")]
[assembly: IgnoresAccessChecksTo("websocket-sharp")]
[assembly: IgnoresAccessChecksTo("Zorro.Core.Runtime")]
[assembly: IgnoresAccessChecksTo("Zorro.PhotonUtility")]
[assembly: IgnoresAccessChecksTo("Zorro.Recorder")]
[assembly: IgnoresAccessChecksTo("Zorro.Settings.Runtime")]
[assembly: IgnoresAccessChecksTo("Zorro.UI.Runtime")]
[assembly: AssemblyCompany("Notest.ContentLibrary")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("0.11.1.0")]
[assembly: AssemblyInformationalVersion("0.11.1+a1d763e75418115b7058e66e71e10343d5e4a9c2")]
[assembly: AssemblyProduct("ContentLibrary")]
[assembly: AssemblyTitle("Notest.ContentLibrary")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.11.1.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.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;
		}
	}
	[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 ContentLibrary
{
	public static class ContentHandler
	{
		public static List<ContentEvent>? EventList;

		public static List<ContentEvent> TemporaryEventList = new List<ContentEvent>();

		public static List<ContentProvider> ProviderList = new List<ContentProvider>();

		internal static void OnLobbyEntered()
		{
			CLogger.LogDebug($"Lobby joined, temporary event list count: {TemporaryEventList.Count}");
			EventList = new List<ContentEvent>(TemporaryEventList.Count);
			if (MyceliumNetwork.IsHost)
			{
				for (int i = 0; i < TemporaryEventList.Count; i++)
				{
					ContentEvent val = TemporaryEventList[i];
					EventList.Add(val);
					ushort num = (ushort)(1999 + EventList.Count);
					CLogger.LogDebug($"Added ContentEvent index {i}, type name {((object)val).GetType().Name}, id {num}");
					MyceliumNetwork.SetLobbyData("ContentLibrary_" + ((object)val).GetType().Name, (object)num);
				}
				return;
			}
			for (int j = 0; j < TemporaryEventList.Count; j++)
			{
				EventList.Add((ContentEvent)(object)new EmptyContentEvent());
			}
			for (int k = 0; k < TemporaryEventList.Count; k++)
			{
				ContentEvent val2 = TemporaryEventList[k];
				ushort lobbyData = MyceliumNetwork.GetLobbyData<ushort>("ContentLibrary_" + ((object)val2).GetType().Name);
				CLogger.LogDebug($"Added ContentEvent, TemporaryEventList index {k}, type name {((object)val2).GetType().Name}, id {lobbyData}");
				EventList[lobbyData - 2000] = val2;
			}
		}

		public static void AssignEvent(ContentEvent contentEvent)
		{
			MyceliumNetwork.RegisterLobbyDataKey("ContentLibrary_" + ((object)contentEvent).GetType().Name);
			TemporaryEventList.Add(contentEvent);
		}

		public static ushort GetEventID(string contentEventName)
		{
			string contentEventName2 = contentEventName;
			int num = EventList.FindIndex((ContentEvent match) => ((object)match).GetType().Name == contentEventName2);
			if (num == -1)
			{
				for (int i = 0; i < EventList.Count; i++)
				{
					CLogger.LogDebug($"{((object)EventList[i]).GetType().Name}, {contentEventName2}, {((object)EventList[i]).GetType().Name == contentEventName2}");
				}
				CLogger.LogError("GetEventID for " + contentEventName2 + " returned -1");
			}
			return (ushort)(2000 + num);
		}

		public static Player? GetPlayerWithCamera()
		{
			Player[] playerList = PhotonNetwork.PlayerList;
			GlobalPlayerData val2 = default(GlobalPlayerData);
			foreach (Player val in playerList)
			{
				if (GlobalPlayerData.TryGetPlayerData(val, ref val2) && val2.inventory.GetItems().Any((ItemDescriptor item) => ((Object)item.item).name == "Camera"))
				{
					return val;
				}
			}
			return null;
		}

		public static void ManualPoll(ContentProvider contentProvider, float screenCoverage = 1f, int timesToPoll = 1)
		{
			if ((Object)(object)ContentPolling.m_currentPollingCamera == (Object)null)
			{
				CLogger.LogDebug("ManualPoll could not carry out, camera is currently not polling.");
				return;
			}
			for (int i = 0; i < timesToPoll; i++)
			{
				contentProvider.GetContent(ContentPolling.contentEvents, screenCoverage, ContentPolling.m_currentPollingCamera, ContentPolling.m_clipTime);
			}
		}

		public static void ManualPoll(ContentProvider contentProvider, int screenCoverage = 400, int timesToPoll = 1)
		{
			if ((Object)(object)ContentPolling.m_currentPollingCamera == (Object)null)
			{
				CLogger.LogDebug("ManualPoll could not carry out, camera is currently not polling.");
				return;
			}
			float num = (float)screenCoverage / 400f;
			for (int i = 0; i < timesToPoll; i++)
			{
				contentProvider.GetContent(ContentPolling.contentEvents, num, ContentPolling.m_currentPollingCamera, ContentPolling.m_clipTime);
			}
		}

		public static void AssignProvider(ContentProvider contentProvider)
		{
			ProviderList.Add(contentProvider);
		}

		public static ContentProvider GetContentProviderFromName(string contentProviderName)
		{
			string contentProviderName2 = contentProviderName;
			return ProviderList.Find((ContentProvider match) => ((object)match).GetType().Name == contentProviderName2);
		}

		public static void PollAndReplicateProvider(ContentProvider contentProvider, int screenCoverage = 400, int timesToPoll = 1, params object[] arguments)
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Expected O, but got Unknown
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			Player playerWithCamera = GetPlayerWithCamera();
			if (playerWithCamera == null)
			{
				return;
			}
			ContentProvider val = (ContentProvider)Activator.CreateInstance(((object)contentProvider).GetType(), arguments);
			if (playerWithCamera.IsLocal)
			{
				CLogger.LogDebug("Local player is the one holding the camera, creating provider...");
				ManualPoll(contentProvider, screenCoverage, timesToPoll);
				return;
			}
			CLogger.LogDebug("Local player is not the one holding the camera");
			CSteamID steamID = default(CSteamID);
			if (SteamAvatarHandler.TryGetSteamIDForPlayer(playerWithCamera, ref steamID))
			{
				CLogger.LogDebug("Got steamID successfully");
				ContentPlugin.RPCTargetRelay("ReplicatePollProvider", steamID, ((object)contentProvider).GetType().Name, screenCoverage, timesToPoll, arguments);
				ManualPoll(contentProvider, screenCoverage, timesToPoll);
			}
		}
	}
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("Notest.ContentLibrary", "ContentLibrary", "0.11.1")]
	public class ContentPlugin : BaseUnityPlugin
	{
		internal const uint modID = 1215985525u;

		internal bool DebugMode;

		internal static bool DebugState;

		public static ContentPlugin Instance { get; private set; }

		internal static ManualLogSource Logger { get; private set; }

		internal static Harmony? Harmony { get; set; }

		internal static ConfigEntry<bool>? ConfigDebugMode { get; private set; }

		private void Awake()
		{
			Logger = ((BaseUnityPlugin)this).Logger;
			Instance = this;
			Patch();
			ConfigDebugMode = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Debug", false, "If the library should log debug messages.");
			DebugState = DebugMode || ConfigDebugMode.Value;
			MyceliumNetwork.RegisterNetworkObject((object)this, 1215985525u, 0);
			MyceliumNetwork.LobbyEntered += ContentHandler.OnLobbyEntered;
			Logger.LogInfo((object)"Notest.ContentLibrary v0.11.1 has loaded!");
		}

		public static void RPCTargetRelay(string methodName, CSteamID steamID, string contentProviderName, int screenCoverage, int timesToPoll, params object[] args)
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			//IL_0380: Unknown result type (might be due to invalid IL or missing references)
			//IL_0385: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_03df: 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_0322: Unknown result type (might be due to invalid IL or missing references)
			TypeSerializer typeSerializer = new TypeSerializer();
			string text = "";
			BinarySerializer val = new BinarySerializer();
			for (int i = 0; i < args.Length; i++)
			{
				string name = args[i].GetType().Name;
				switch (name)
				{
				case "Byte":
					text += "a";
					((BinarySerializer)typeSerializer).WriteByte((byte)args[i]);
					break;
				case "Boolean":
					text += "b";
					((BinarySerializer)typeSerializer).WriteBool((bool)args[i]);
					break;
				case "Int16":
					text += "c";
					typeSerializer.WriteShort((short)args[i]);
					break;
				case "Int32":
					text += "d";
					((BinarySerializer)typeSerializer).WriteInt((int)args[i]);
					break;
				case "Int64":
					text += "e";
					((BinarySerializer)typeSerializer).WriteLong((long)args[i]);
					break;
				case "UInt16":
					text += "f";
					((BinarySerializer)typeSerializer).WriteUshort((ushort)args[i]);
					break;
				case "UInt32":
					text += "g";
					((BinarySerializer)typeSerializer).WriteUInt((uint)(ushort)args[i]);
					break;
				case "UInt64":
					text += "h";
					((BinarySerializer)typeSerializer).WriteUlong((ulong)args[i]);
					break;
				case "String":
					text += "i";
					((BinarySerializer)typeSerializer).WriteString((string)args[i], Encoding.UTF8);
					break;
				case "Vector3":
					text += "j";
					((BinarySerializer)typeSerializer).WriteFloat3(float3.op_Implicit((float)args[i]));
					break;
				case "Quaternion":
					text += "k";
					((BinarySerializer)typeSerializer).WriteFloat4(float4.op_Implicit((float)args[i]));
					break;
				default:
					throw new Exception("Type " + name + " not currently supported");
				}
			}
			byte[] array = Array.Empty<byte>();
			NativeArray<byte> buffer = ((BinarySerializer)typeSerializer).buffer;
			ByteArrayConvertion.MoveToByteArray<byte>(ref buffer, ref array);
			val.WriteString(text, Encoding.UTF8);
			byte[] array2 = Array.Empty<byte>();
			NativeArray<byte> buffer2 = val.buffer;
			ByteArrayConvertion.MoveToByteArray<byte>(ref buffer2, ref array2);
			CLogger.LogDebug($"Buffer type is {((object)((BinarySerializer)typeSerializer).buffer).GetType()}, {array.GetType()}");
			MyceliumNetwork.RPCTarget(1215985525u, methodName, steamID, (ReliableType)1, new object[5] { contentProviderName, screenCoverage, timesToPoll, array2, array });
		}

		[CustomRPC]
		private void ReplicatePollProvider(string contentProviderName, int screenCoverage, int timesToPoll, byte[] infoByteArray, byte[] byteArguments)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Expected O, but got Unknown
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			//IL_0217: Unknown result type (might be due to invalid IL or missing references)
			//IL_021e: Expected O, but got Unknown
			//IL_0104: Unknown result type (might be due to invalid IL or missing references)
			//IL_0117: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c4: Unknown result type (might be due to invalid IL or missing references)
			BinaryDeserializer val = new BinaryDeserializer(infoByteArray, (Allocator)4);
			BinaryDeserializer val2 = new BinaryDeserializer(byteArguments, (Allocator)4);
			string text = val.ReadString(Encoding.UTF8);
			object[] array = new object[text.Length];
			CLogger.LogDebug("Received " + contentProviderName + " with deserialization info \"" + text + "\"");
			int num = 0;
			string text2 = text;
			NativeSlice<byte> val3 = default(NativeSlice<byte>);
			for (int i = 0; i < text2.Length; i++)
			{
				char c = text2[i];
				switch (c.ToString())
				{
				case "a":
					array[num] = val2.ReadByte();
					break;
				case "b":
					array[num] = val2.ReadBool();
					break;
				case "c":
				{
					val3..ctor(val2.buffer, val2.position, 2);
					short num2 = val3.SliceConvert<short>()[0];
					val2.position += 2;
					array[num] = num2;
					break;
				}
				case "d":
					array[num] = val2.ReadInt();
					break;
				case "e":
					array[num] = val2.ReadLong();
					break;
				case "f":
					array[num] = val2.ReadUShort();
					break;
				case "g":
					array[num] = val2.ReadUInt();
					break;
				case "h":
					array[num] = val2.ReadUlong();
					break;
				case "i":
					array[num] = val2.ReadString(Encoding.UTF8);
					break;
				case "j":
					array[num] = val2.ReadFloat3();
					break;
				case "k":
					array[num] = val2.ReadFloat4();
					break;
				default:
					throw new Exception($"Unknown deserialization character {c}");
				}
				num++;
			}
			ContentProvider contentProviderFromName = ContentHandler.GetContentProviderFromName(contentProviderName);
			ContentProvider val4 = (ContentProvider)Activator.CreateInstance(((object)contentProviderFromName).GetType(), array);
			ContentHandler.ManualPoll(contentProviderFromName, screenCoverage, timesToPoll);
		}

		internal static void Patch()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Expected O, but got Unknown
			if (Harmony == null)
			{
				Harmony = new Harmony("Notest.ContentLibrary");
			}
			Logger.LogDebug((object)"Patching...");
			Harmony.PatchAll();
			Logger.LogDebug((object)"Finished patching!");
		}

		internal static void Unpatch()
		{
			Logger.LogDebug((object)"Unpatching...");
			Harmony? harmony = Harmony;
			if (harmony != null)
			{
				harmony.UnpatchSelf();
			}
			Logger.LogDebug((object)"Finished unpatching!");
		}
	}
	internal class EmptyContentEvent : ContentEvent
	{
		public override void Deserialize(BinaryDeserializer deserializer)
		{
			throw new NotImplementedException();
		}

		public override Comment GenerateComment()
		{
			throw new NotImplementedException();
		}

		public override float GetContentValue()
		{
			throw new NotImplementedException();
		}

		public override ushort GetID()
		{
			throw new NotImplementedException();
		}

		public override string GetName()
		{
			throw new NotImplementedException();
		}

		public override void Serialize(BinarySerializer serializer)
		{
			throw new NotImplementedException();
		}
	}
	internal class TypeSerializer : BinarySerializer
	{
		public void WriteShort(short value)
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			NativeArray<short> val = default(NativeArray<short>);
			val..ctor(1, (Allocator)2, (NativeArrayOptions)1);
			val[0] = value;
			((BinarySerializer)this).WriteBytes(val.Reinterpret<byte>(UnsafeUtility.SizeOf<short>()));
			val.Dispose();
		}
	}
	public static class CLogger
	{
		public static void Log(string message)
		{
			SendLog(message, "Log");
		}

		public static void LogInfo(string message)
		{
			SendLog(message, "LogInfo");
		}

		public static void LogError(string message)
		{
			SendLog(message, "LogError");
		}

		public static void LogWarning(string message)
		{
			SendLog(message, "LogWarning");
		}

		public static void LogDebug(string message)
		{
			SendLog(message, "LogDebug");
		}

		public static void LogFatal(string message)
		{
			SendLog(message, "LogFatal");
		}

		public static void LogMessage(string message)
		{
			SendLog(message, "LogMessage");
		}

		internal static void SendLog(string message, string level = null)
		{
			if (!ContentPlugin.DebugState && (level == "LogDebug" || level == "LogInfo"))
			{
				return;
			}
			switch (level)
			{
			case "LogInfo":
				ContentPlugin.Logger.LogInfo((object)message);
				return;
			case "LogError":
				ContentPlugin.Logger.LogError((object)message);
				return;
			case "LogWarning":
				ContentPlugin.Logger.LogWarning((object)message);
				return;
			case "LogDebug":
				ContentPlugin.Logger.LogDebug((object)message);
				return;
			case "LogFatal":
				ContentPlugin.Logger.LogFatal((object)message);
				return;
			case "LogMessage":
				ContentPlugin.Logger.LogMessage((object)message);
				return;
			}
			if (level != "Log")
			{
				Debug.Log((object)("[" + level + "]: " + message));
			}
			else
			{
				Debug.Log((object)message);
			}
		}
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "Notest.ContentLibrary";

		public const string PLUGIN_NAME = "ContentLibrary";

		public const string PLUGIN_VERSION = "0.11.1";
	}
}
namespace ContentLibrary.Patches
{
	[HarmonyPatch(typeof(ContentEventIDMapper))]
	internal class ContentEventIDMapperPatches
	{
		[HarmonyPrefix]
		[HarmonyPatch("GetContentEvent")]
		public static bool GetContentEventPrefix(ref ushort id, ref ContentEvent __result)
		{
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Expected O, but got Unknown
			CLogger.LogDebug($"GetContentEvent was called: {id} Normalized: {id - 2000} EventList count: {ContentHandler.EventList.Count}");
			if (id - 2000 < 0)
			{
				return true;
			}
			ContentEvent val = ContentHandler.EventList[id - 2000];
			if (val == null)
			{
				return true;
			}
			__result = (ContentEvent)Activator.CreateInstance(((object)val).GetType());
			return false;
		}
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	internal sealed class IgnoresAccessChecksToAttribute : Attribute
	{
		public IgnoresAccessChecksToAttribute(string assemblyName)
		{
		}
	}
}