Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of ReXuvination v1.1.0
BepInEx/patchers/ReXuvination.Preloader.dll
Decompiled 9 months agousing System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using Microsoft.CodeAnalysis; using Mono.Cecil; using Mono.Cecil.Cil; using Mono.Collections.Generic; using MonoMod.Utils; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: IgnoresAccessChecksTo("")] [assembly: AssemblyCompany("XuuXiaolan")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.1.0")] [assembly: AssemblyInformationalVersion("1.1.0+788497d4f46dd6e247a3b5a39e61815b1cd8c0b3")] [assembly: AssemblyProduct("ReXuvination")] [assembly: AssemblyTitle("ReXuvination - Preloader")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.1.0.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 ReXuvination.Preloader { public static class MyPluginInfo { public const string PLUGIN_GUID = "XuuXiaolan.ReXuvination"; public const string PLUGIN_NAME = "ReXuvination"; public const string PLUGIN_VERSION = "1.1.0"; } } namespace ReXuvination.Preloader.src { public static class CecilHelper { public static bool AddField(this TypeDefinition self, FieldAttributes fieldAttributes, string name, TypeReference type, Action<bool, string> logCallback = null) { //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Expected O, but got Unknown logCallback?.Invoke(arg1: false, "Adding field '" + name + "' to " + ((MemberReference)self).FullName); if (Extensions.FindField(self, name) != null) { logCallback?.Invoke(arg1: true, "Field '" + name + "' already exists in " + ((MemberReference)self).FullName); return false; } self.Fields.Add(new FieldDefinition(name, fieldAttributes, type)); return true; } public static bool AddMethod(this TypeDefinition self, string methodName, MethodAttributes attributes = 1, TypeReference returnType = null, ParameterDefinition[] parameters = null, Action<bool, string> logCallback = null) { //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Expected O, but got Unknown //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Invalid comparison between Unknown and I4 //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) if (returnType == null) { returnType = ((MemberReference)self).Module.TypeSystem.Void; } if (parameters == null) { parameters = Array.Empty<ParameterDefinition>(); } logCallback?.Invoke(arg1: false, "Adding method " + ((MemberReference)returnType).FullName + " " + methodName + "(" + string.Join(",", parameters.Select((ParameterDefinition p) => ((MemberReference)((ParameterReference)p).ParameterType).FullName)) + ") to " + ((MemberReference)self).FullName); if (Extensions.FindMethod(self, methodName, true) != null) { logCallback?.Invoke(arg1: true, "Method '" + methodName + "' already exists in " + ((MemberReference)self).FullName); return false; } MethodDefinition val = new MethodDefinition(methodName, (MethodAttributes)(attributes | 0x80), returnType); self.Methods.Add(val); Extensions.AddRange<ParameterDefinition>(((MethodReference)val).Parameters, (IEnumerable<ParameterDefinition>)parameters); ILProcessor iLProcessor = val.Body.GetILProcessor(); Instruction val2 = iLProcessor.Create(OpCodes.Ret); if ((int)returnType.MetadataType != 1) { ConstructorInfo constructor = typeof(NotImplementedException).GetConstructor(new Type[1] { typeof(string) }); MethodReference val3 = ((MemberReference)self).Module.ImportReference((MethodBase)constructor); iLProcessor.Emit(OpCodes.Ldstr, "This is a Stub"); iLProcessor.Emit(OpCodes.Newobj, val3); iLProcessor.Emit(OpCodes.Throw); } iLProcessor.Append(val2); return true; } } internal class ReXuvination { public static class PluginConfig { internal static ConfigEntry<bool> Enabled; internal static ConfigEntry<string> OutputPath; internal static ConfigEntry<string> OutputExtension; public static void Init() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown ConfigFile val = new ConfigFile(Utility.CombinePaths(new string[2] { MainDir, "Development.cfg" }), true, Plugin); Enabled = val.Bind<bool>("DevelOptions", "Enabled", false, "Enable development dll output"); OutputPath = val.Bind<string>("DevelOptions", "OutputPath", MainDir, "Folder where to write the modified dlls"); OutputExtension = val.Bind<string>("DevelOptions", "OutputExtension", ".pdll", "Extension to use for the modified dlls\n( Do not use .dll if outputting inside the BepInEx folders )"); PropertyInfo property = ((object)val).GetType().GetProperty("OrphanedEntries", BindingFlags.Instance | BindingFlags.NonPublic); Dictionary<ConfigDefinition, string> dictionary = (Dictionary<ConfigDefinition, string>)property.GetValue(val, null); dictionary.Clear(); val.Save(); } } public const string GUID = "XuuXiaolan.ReXuvination"; public const string NAME = "ReXuvination"; public const string VERSION = "1.1.0"; internal static readonly BepInPlugin Plugin = new BepInPlugin("XuuXiaolan.ReXuvination", "ReXuvination", "1.1.0"); private static readonly string MainDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); internal static ManualLogSource Log { get; } = Logger.CreateLogSource("ReXuvination"); public static IEnumerable<string> TargetDLLs { get; } = new string[1] { "Assembly-CSharp.dll" }; public static void Patch(AssemblyDefinition assembly) { //IL_0044: 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) Log.LogWarning((object)("Patching " + ((AssemblyNameReference)assembly.Name).Name)); if (((AssemblyNameReference)assembly.Name).Name == "Assembly-CSharp") { Enumerator<TypeDefinition> enumerator = assembly.MainModule.Types.GetEnumerator(); try { while (enumerator.MoveNext()) { TypeDefinition current = enumerator.Current; switch (((MemberReference)current).FullName) { case "QuicksandTrigger": case "ToggleFogTrigger": case "CompanyMonsterCollisionDetect": case "GrabbableObjectPhysicsTrigger": case "BridgeTriggerType2": case "PlayerPhysicsRegion": case "KillLocalPlayer": case "TerrainObstacleTrigger": current.AddMethod("Awake", (MethodAttributes)6); break; } } } finally { ((IDisposable)enumerator).Dispose(); } } if (PluginConfig.Enabled.Value) { string text = PluginConfig.OutputPath.Value + "/" + ((AssemblyNameReference)assembly.Name).Name + PluginConfig.OutputExtension.Value; Log.LogWarning((object)("Saving modified Assembly to " + text)); assembly.Write(text); } } public static void Initialize() { Log.LogInfo((object)"Prepatcher Started"); PluginConfig.Init(); } public static void Finish() { Log.LogInfo((object)"Prepatcher Finished"); } } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { public IgnoresAccessChecksToAttribute(string assemblyName) { } } }
BepInEx/plugins/ReXuvination.dll
Decompiled 9 months agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using HarmonyLib.Public.Patching; using LethalConfig; using LethalConfig.ConfigItems; using LethalConfig.ConfigItems.Options; using LobbyCompatibility.Enums; using LobbyCompatibility.Features; using Microsoft.CodeAnalysis; using Mono.Cecil; using Mono.Cecil.Cil; using Mono.Collections.Generic; using MonoMod.RuntimeDetour; using MonoMod.Utils; using ReXuvination.src.Dependency; using Unity.Netcode; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: IgnoresAccessChecksTo("AmazingAssets.TerrainToMesh")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp-firstpass")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: IgnoresAccessChecksTo("ClientNetworkTransform")] [assembly: IgnoresAccessChecksTo("DissonanceVoip")] [assembly: IgnoresAccessChecksTo("Facepunch Transport for Netcode for GameObjects")] [assembly: IgnoresAccessChecksTo("Facepunch.Steamworks.Win64")] [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.InputSystem")] [assembly: IgnoresAccessChecksTo("Unity.InputSystem.ForUI")] [assembly: IgnoresAccessChecksTo("Unity.Jobs")] [assembly: IgnoresAccessChecksTo("Unity.Mathematics")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.Common")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.MetricTypes")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStats")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Component")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Configuration")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Implementation")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsReporting")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetworkProfiler.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetworkSolutionInterface")] [assembly: IgnoresAccessChecksTo("Unity.Netcode.Components")] [assembly: IgnoresAccessChecksTo("Unity.Netcode.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.Networking.Transport")] [assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Csg")] [assembly: IgnoresAccessChecksTo("Unity.ProBuilder")] [assembly: IgnoresAccessChecksTo("Unity.ProBuilder.KdTree")] [assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Poly2Tri")] [assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Stl")] [assembly: IgnoresAccessChecksTo("Unity.Profiling.Core")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.ShaderLibrary")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.HighDefinition.Config.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.HighDefinition.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary")] [assembly: IgnoresAccessChecksTo("Unity.Services.Authentication")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Analytics")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Configuration")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Device")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Environments")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Environments.Internal")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Internal")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Networking")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Registration")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Scheduler")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Telemetry")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Threading")] [assembly: IgnoresAccessChecksTo("Unity.Services.QoS")] [assembly: IgnoresAccessChecksTo("Unity.Services.Relay")] [assembly: IgnoresAccessChecksTo("Unity.TextMeshPro")] [assembly: IgnoresAccessChecksTo("Unity.Timeline")] [assembly: IgnoresAccessChecksTo("Unity.VisualEffectGraph.Runtime")] [assembly: IgnoresAccessChecksTo("UnityEngine.ARModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.NVIDIAModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.UI")] [assembly: AssemblyCompany("XuuXiaolan")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.1.0")] [assembly: AssemblyInformationalVersion("1.1.0+788497d4f46dd6e247a3b5a39e61815b1cd8c0b3")] [assembly: AssemblyProduct("ReXuvination")] [assembly: AssemblyTitle("ReXuvination - Plugin")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.1.0.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 ReXuvination { public static class MyPluginInfo { public const string PLUGIN_GUID = "XuuXiaolan.ReXuvination"; public const string PLUGIN_NAME = "ReXuvination"; public const string PLUGIN_VERSION = "1.1.0"; } } namespace ReXuvination.src { [BepInPlugin("XuuXiaolan.ReXuvination", "ReXuvination", "1.1.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] internal class ReXuvination : BaseUnityPlugin { internal static class PluginConfig { public static ConfigEntry<string> ConfigEnemyBlacklist { get; private set; } internal static void Init() { ConfigFile config = ((BaseUnityPlugin)INSTANCE).Config; config.SaveOnConfigSet = false; ConfigEnemyBlacklist = config.Bind<string>("EnemyAICollisionDetect Options", "Enemies | Blacklist", "", "comma separated list of enemies to not optimise."); config.SaveOnConfigSet = true; CleanAndSave(); } internal static void CleanAndSave() { ConfigFile config = ((BaseUnityPlugin)INSTANCE).Config; PropertyInfo propertyInfo = AccessTools.Property(((object)config).GetType(), "OrphanedEntries"); Dictionary<ConfigDefinition, string> dictionary = (Dictionary<ConfigDefinition, string>)propertyInfo.GetValue(config, null); dictionary.Clear(); config.Save(); } } internal static readonly ISet<Hook> Hooks = new HashSet<Hook>(); internal static readonly Harmony Harmony = new Harmony("XuuXiaolan.ReXuvination"); public const string GUID = "XuuXiaolan.ReXuvination"; public const string NAME = "ReXuvination"; public const string VERSION = "1.1.0"; internal static ManualLogSource Log; public static ReXuvination INSTANCE { get; private set; } private void Awake() { INSTANCE = this; Log = ((BaseUnityPlugin)this).Logger; try { if (LobbyCompatibilityChecker.Enabled) { LobbyCompatibilityChecker.Init(); } Log.LogInfo((object)"Initializing Configs"); PluginConfig.Init(); Log.LogInfo((object)"Patching Methods"); Harmony.PatchAll(); Log.LogInfo((object)"ReXuvination v1.1.0 Loaded! also you lost the game!"); } catch (Exception ex) { Log.LogError((object)("Exception while initializing: \n" + ex)); } } } public static class Utils { private static readonly MethodInfo BeginSendClientRpc = AccessTools.Method(typeof(NetworkBehaviour), "__beginSendClientRpc", (Type[])null, (Type[])null); private static readonly MethodInfo BeginSendServerRpc = AccessTools.Method(typeof(NetworkBehaviour), "__beginSendServerRpc", (Type[])null, (Type[])null); internal static bool TryGetRpcID(MethodInfo methodInfo, out uint rpcID) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) Collection<Instruction> instructions = PatchManager.GetMethodPatcher((MethodBase)methodInfo).CopyOriginal().Definition.Body.Instructions; rpcID = 0u; for (int i = 0; i < instructions.Count; i++) { if (instructions[i].OpCode == OpCodes.Ldc_I4 && instructions[i - 1].OpCode == OpCodes.Ldarg_0) { rpcID = (uint)(int)instructions[i].Operand; } if (!(instructions[i].OpCode != OpCodes.Call)) { object operand = instructions[i].Operand; MethodReference val = (MethodReference)((operand is MethodReference) ? operand : null); if (val != null && (Extensions.Is((MemberReference)(object)val, (MemberInfo)BeginSendClientRpc) || Extensions.Is((MemberReference)(object)val, (MemberInfo)BeginSendServerRpc))) { ReXuvination.Log.LogDebug((object)$"Rpc Id found for {methodInfo.Name}: {rpcID}U"); return true; } } } ReXuvination.Log.LogFatal((object)("Cannot find Rpc ID for " + methodInfo.Name)); return false; } } } namespace ReXuvination.src.Patches { [HarmonyPatch(typeof(BridgeTrigger))] internal static class BridgeTriggerPatch { private static int enemiesAndPlayerMask; [HarmonyPatch("OnEnable")] [HarmonyPostfix] public static void BridgeTriggerOnEnablePatch(BridgeTrigger __instance) { //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) if (enemiesAndPlayerMask == 0) { enemiesAndPlayerMask = LayerMask.GetMask(new string[2] { "Enemies", "Player" }); } Collider[] components = ((Component)__instance).GetComponents<Collider>(); Collider[] array = components; foreach (Collider val in array) { if (val.isTrigger) { val.includeLayers = LayerMask.op_Implicit(LayerMask.op_Implicit(val.includeLayers) | enemiesAndPlayerMask); val.excludeLayers = LayerMask.op_Implicit(0); val.layerOverridePriority = 2; } } ReXuvination.Log.LogDebug((object)$"Optimised Collider layers in BridgeTrigger for Object: {((Component)__instance).gameObject}"); } } [HarmonyPatch(typeof(BridgeTriggerType2))] internal static class BridgeTriggerType2Patch { [HarmonyPatch("Awake")] [HarmonyPostfix] public static void BridgeTriggerType2AwakePatch(BridgeTriggerType2 __instance) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)StartOfRound.Instance == (Object)null) { return; } Collider[] components = ((Component)__instance).GetComponents<Collider>(); Collider[] array = components; foreach (Collider val in array) { if (val.isTrigger) { val.includeLayers = LayerMask.op_Implicit(LayerMask.op_Implicit(val.includeLayers) | StartOfRound.Instance.playersMask); val.excludeLayers = LayerMask.op_Implicit(0); val.layerOverridePriority = -2; } } ReXuvination.Log.LogDebug((object)$"Optimised Collider layers in BridgeTriggerType2 for Object: {((Component)__instance).gameObject}"); } } [HarmonyPatch(typeof(CompanyMonsterCollisionDetect))] internal static class CompanyMonsterCollisionDetectPatch { [HarmonyPatch("Awake")] [HarmonyPostfix] public static void CompanyMonsterCollisionDetectAwakePatch(CompanyMonsterCollisionDetect __instance) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)StartOfRound.Instance == (Object)null) { return; } Collider[] components = ((Component)__instance).GetComponents<Collider>(); Collider[] array = components; foreach (Collider val in array) { if (val.isTrigger) { val.includeLayers = LayerMask.op_Implicit(LayerMask.op_Implicit(val.includeLayers) | StartOfRound.Instance.playersMask); val.excludeLayers = LayerMask.op_Implicit(0); val.layerOverridePriority = -2; } } ReXuvination.Log.LogDebug((object)$"Optimised Collider layers in CompanyMonsterCollisionDetect for Object: {((Component)__instance).gameObject}"); } } [HarmonyPatch(typeof(DoorLock))] internal static class DoorLockPatch { private static int enemiesAndPlayersMask; [HarmonyPatch("Awake")] [HarmonyPostfix] public static void DoorLockAwakePatch(DoorLock __instance) { //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) if (enemiesAndPlayersMask == 0) { enemiesAndPlayersMask = LayerMask.GetMask(new string[2] { "Enemies", "Player" }); } Collider[] components = ((Component)__instance).GetComponents<Collider>(); Collider[] array = components; foreach (Collider val in array) { if (val.isTrigger) { val.includeLayers = LayerMask.op_Implicit(LayerMask.op_Implicit(val.includeLayers) | enemiesAndPlayersMask); val.excludeLayers = LayerMask.op_Implicit(0); val.layerOverridePriority = -2; } } ReXuvination.Log.LogDebug((object)$"Optimised Collider layers in DoorLock for Object: {((Component)__instance).gameObject}"); } } [HarmonyPatch(typeof(GrabbableObjectPhysicsTrigger))] internal static class GrabbableObjectPhysicsTriggerPatch { private static int enemiesAndPlayerMask; [HarmonyPatch("Awake")] [HarmonyPostfix] public static void GrabbableObjectPhysicsTriggerAwakePatch(GrabbableObjectPhysicsTrigger __instance) { //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) if (enemiesAndPlayerMask == 0) { enemiesAndPlayerMask = LayerMask.GetMask(new string[2] { "Enemies", "Player" }); } Collider[] components = ((Component)__instance).GetComponents<Collider>(); Collider[] array = components; foreach (Collider val in array) { if (val.isTrigger) { val.includeLayers = LayerMask.op_Implicit(LayerMask.op_Implicit(val.includeLayers) | enemiesAndPlayerMask); val.excludeLayers = LayerMask.op_Implicit(0); val.layerOverridePriority = 2; } } ReXuvination.Log.LogDebug((object)$"Optimised Collider layers in GrabbableObjectPhysicsTrigger for Object: {((Component)__instance).gameObject}"); } } [HarmonyPatch(typeof(InteractTrigger))] internal static class InteractTriggerPatch { private static int enemiesAndPlayersMask; [HarmonyPatch("Start")] [HarmonyPostfix] public static void InteractTriggerStartPatch(InteractTrigger __instance) { //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) if (enemiesAndPlayersMask == 0) { enemiesAndPlayersMask = LayerMask.GetMask(new string[2] { "Enemies", "Player" }); } Collider[] components = ((Component)__instance).GetComponents<Collider>(); Collider[] array = components; foreach (Collider val in array) { if (val.isTrigger) { val.includeLayers = LayerMask.op_Implicit(LayerMask.op_Implicit(val.includeLayers) | enemiesAndPlayersMask); val.excludeLayers = LayerMask.op_Implicit(0); val.layerOverridePriority = -2; } } ReXuvination.Log.LogDebug((object)$"Optimised Collider layers in InteractTrigger for Object: {((Component)__instance).gameObject}"); } } [HarmonyPatch(typeof(KillLocalPlayer))] internal static class KillLocalPlayerPatch { private static int enemiesMask; [HarmonyPatch("Awake")] [HarmonyPostfix] public static void KillLocalPlayerAwakePatch(KillLocalPlayer __instance) { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) if (enemiesMask == 0) { enemiesMask = LayerMask.GetMask(new string[1] { "Enemies" }); } Collider[] components = ((Component)__instance).GetComponents<Collider>(); Collider[] array = components; foreach (Collider val in array) { if (val.isTrigger) { val.includeLayers = LayerMask.op_Implicit(LayerMask.op_Implicit(val.includeLayers) | enemiesMask); val.excludeLayers = LayerMask.op_Implicit(0); val.layerOverridePriority = 2; } } ReXuvination.Log.LogDebug((object)$"Optimised Collider layers in KillLocalPlayer for Object: {((Component)__instance).gameObject}"); } } [HarmonyPatch(typeof(Landmine))] internal static class LandminePatch { private static int playersRagdollAndPropsMask; [HarmonyPatch("Start")] [HarmonyPostfix] public static void LandmineStartPatch(Landmine __instance) { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) if (playersRagdollAndPropsMask == 0) { playersRagdollAndPropsMask = LayerMask.GetMask(new string[3] { "Props", "PlayerRagdoll", "Player" }); } Collider[] components = ((Component)__instance).GetComponents<Collider>(); Collider[] array = components; foreach (Collider val in array) { if (val.isTrigger) { val.includeLayers = LayerMask.op_Implicit(LayerMask.op_Implicit(val.includeLayers) | playersRagdollAndPropsMask); val.excludeLayers = LayerMask.op_Implicit(0); val.layerOverridePriority = -2; } } ReXuvination.Log.LogDebug((object)$"Optimised Collider layers in Landmine for Object: {((Component)__instance).gameObject}"); } } [HarmonyPatch(typeof(OutOfBoundsTrigger))] internal static class OutOfBoundsTriggerPatch { private static int playersAndRagdollMask; [HarmonyPatch("Start")] [HarmonyPostfix] public static void OutOfBoundsTriggerStartPatch(OutOfBoundsTrigger __instance) { //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) if (playersAndRagdollMask == 0) { playersAndRagdollMask = LayerMask.GetMask(new string[2] { "PlayerRagdoll", "Player" }); } Collider[] components = ((Component)__instance).GetComponents<Collider>(); Collider[] array = components; foreach (Collider val in array) { if (val.isTrigger) { val.includeLayers = LayerMask.op_Implicit(LayerMask.op_Implicit(val.includeLayers) | playersAndRagdollMask); val.excludeLayers = LayerMask.op_Implicit(0); val.layerOverridePriority = -2; } } ReXuvination.Log.LogDebug((object)$"Optimised Collider layers in OutOfBoundsTrigger for Object: {((Component)__instance).gameObject}"); } } [HarmonyPatch(typeof(PlayerPhysicsRegion))] internal static class PlayerPhysicsRegionPatch { private static int playersRagdollAndPropsMask; [HarmonyPatch("Awake")] [HarmonyPostfix] public static void PlayerPhysicsRegionAwakePatch(PlayerPhysicsRegion __instance) { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) if (playersRagdollAndPropsMask == 0) { playersRagdollAndPropsMask = LayerMask.GetMask(new string[3] { "Props", "Player", "PlayerRagdoll" }); } Collider[] components = ((Component)__instance).GetComponents<Collider>(); Collider[] array = components; foreach (Collider val in array) { if (val.isTrigger) { val.includeLayers = LayerMask.op_Implicit(LayerMask.op_Implicit(val.includeLayers) | playersRagdollAndPropsMask); val.excludeLayers = LayerMask.op_Implicit(0); val.layerOverridePriority = -2; } } ReXuvination.Log.LogDebug((object)$"Optimised Collider layers in PlayerPhysicsRegion for Object: {((Component)__instance).gameObject}"); } } [HarmonyPatch(typeof(QuickMenuManager))] internal static class QuickMenuManagerPatch { private static bool alreadyPatched; [HarmonyPatch("Start")] [HarmonyPostfix] private static void QuickMenuManagerStartPatch() { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0052: 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_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) if (alreadyPatched) { return; } EnemyType[] array = Resources.FindObjectsOfTypeAll<EnemyType>(); LayerMask val = LayerMask.op_Implicit(LayerMask.GetMask(new string[4] { "InteractableObject", "Player", "Triggers", "MapHazards" })); LayerMask val2 = LayerMask.op_Implicit(LayerMask.GetMask(new string[1] { "Enemies" })); EnemyType[] array2 = array; foreach (EnemyType val3 in array2) { if (string.IsNullOrEmpty(val3.enemyName) || (Object)(object)val3.enemyPrefab == (Object)null || ReXuvination.PluginConfig.ConfigEnemyBlacklist.Value.Contains(val3.enemyName)) { continue; } EnemyAICollisionDetect[] componentsInChildren = val3.enemyPrefab.GetComponentsInChildren<EnemyAICollisionDetect>(); foreach (EnemyAICollisionDetect val4 in componentsInChildren) { Collider[] components = ((Component)val4).gameObject.GetComponents<Collider>(); foreach (Collider val5 in components) { if (val5.isTrigger) { if (val4.canCollideWithEnemies) { val5.includeLayers = LayerMask.op_Implicit(LayerMask.op_Implicit(val5.includeLayers) | LayerMask.op_Implicit(val2)); val5.layerOverridePriority = 1; } val5.includeLayers = LayerMask.op_Implicit(LayerMask.op_Implicit(val5.includeLayers) | LayerMask.op_Implicit(val)); val5.excludeLayers = LayerMask.op_Implicit(0); val5.layerOverridePriority = -1; } } } ReXuvination.Log.LogDebug((object)(val3.enemyName + "'s colliders have been optimised!")); } alreadyPatched = true; } } [HarmonyPatch(typeof(QuicksandTrigger))] internal static class QuicksandTriggerPatch { [HarmonyPatch("Awake")] [HarmonyPostfix] public static void QuicksandTriggerAwakePatch(QuicksandTrigger __instance) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)StartOfRound.Instance == (Object)null) { return; } Collider[] components = ((Component)__instance).GetComponents<Collider>(); Collider[] array = components; foreach (Collider val in array) { if (val.isTrigger) { val.includeLayers = LayerMask.op_Implicit(LayerMask.op_Implicit(val.includeLayers) | StartOfRound.Instance.playersMask); val.excludeLayers = LayerMask.op_Implicit(0); val.layerOverridePriority = -2; } } ReXuvination.Log.LogDebug((object)$"Optimised Collider layers in QuicksandTrigger for Object: {((Component)__instance).gameObject}"); } } [HarmonyPatch(typeof(SandSpiderWebTrap))] internal static class SandSpiderWebTrapPatch { [HarmonyPatch("Awake")] [HarmonyPostfix] private static void SandSpiderWebTrapStartPatch(SandSpiderWebTrap __instance) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)StartOfRound.Instance == (Object)null) { return; } Collider[] components = ((Component)__instance).GetComponents<Collider>(); Collider[] array = components; foreach (Collider val in array) { if (val.isTrigger) { val.includeLayers = LayerMask.op_Implicit(LayerMask.op_Implicit(val.includeLayers) | StartOfRound.Instance.playersMask); val.excludeLayers = LayerMask.op_Implicit(0); val.layerOverridePriority = -2; } } ReXuvination.Log.LogDebug((object)$"{((Component)__instance).gameObject}'s colliders have been optimised!"); } } [HarmonyPatch(typeof(TerrainObstacleTrigger))] internal static class TerrainObstacleTriggerPatch { private static int vehicleMask; [HarmonyPatch("Awake")] [HarmonyPostfix] public static void TerrainObstacleTriggerAwakePatch(TerrainObstacleTrigger __instance) { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) if (vehicleMask == 0) { vehicleMask = LayerMask.GetMask(new string[1] { "Vehicle" }); } Collider[] components = ((Component)__instance).GetComponents<Collider>(); Collider[] array = components; foreach (Collider val in array) { if (val.isTrigger) { val.includeLayers = LayerMask.op_Implicit(LayerMask.op_Implicit(val.includeLayers) | vehicleMask); val.excludeLayers = LayerMask.op_Implicit(0); val.layerOverridePriority = -2; } } ReXuvination.Log.LogDebug((object)$"Optimised Collider layers in TerrainObstacleTrigger for Object: {((Component)__instance).gameObject}"); } } [HarmonyPatch(typeof(ToggleFogTrigger))] internal static class ToggleFogTriggerPatch { [HarmonyPatch("Awake")] [HarmonyPostfix] public static void ToggleFogTriggerAwakePatch(ToggleFogTrigger __instance) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)StartOfRound.Instance == (Object)null) { return; } Collider[] components = ((Component)__instance).GetComponents<Collider>(); Collider[] array = components; foreach (Collider val in array) { if (val.isTrigger) { val.includeLayers = LayerMask.op_Implicit(LayerMask.op_Implicit(val.includeLayers) | StartOfRound.Instance.playersMask); val.excludeLayers = LayerMask.op_Implicit(0); val.layerOverridePriority = -2; } } ReXuvination.Log.LogDebug((object)$"Optimised Collider layers in ToggleFogTrigger for Object: {((Component)__instance).gameObject}"); } } } namespace ReXuvination.src.Dependency { public static class LethalConfigProxy { [Serializable] [CompilerGenerated] private sealed class <>c__7<T> where T : Enum { public static readonly <>c__7<T> <>9 = new <>c__7<T>(); public static CanModifyDelegate <>9__7_0; public static CanModifyDelegate <>9__7_1; internal CanModifyResult <AddConfig>b__7_0() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) return CanModifyResult.op_Implicit((ValueTuple<bool, string>)(true, null)); } internal CanModifyResult <AddConfig>b__7_1() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) return CanModifyResult.op_Implicit((false, "THIS IS A FLAG TYPE ENUM, EDITING CURRENTLY NOT SUPPORTED!")); } } private static bool? _enabled; public static bool Enabled { get { bool valueOrDefault = _enabled.GetValueOrDefault(); if (!_enabled.HasValue) { valueOrDefault = Chainloader.PluginInfos.ContainsKey("ainavt.lc.lethalconfig"); _enabled = valueOrDefault; } return _enabled.Value; } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void AddConfig(ConfigEntry<string> entry, bool requiresRestart = false) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Expected O, but got Unknown //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Expected O, but got Unknown LethalConfigManager.AddConfigItem((BaseConfigItem)new TextInputFieldConfigItem(entry, new TextInputFieldOptions { RequiresRestart = requiresRestart, Name = GetPrettyConfigName<string>(entry) })); } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void AddConfig(ConfigEntry<bool> entry, bool requiresRestart = false) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Expected O, but got Unknown //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Expected O, but got Unknown LethalConfigManager.AddConfigItem((BaseConfigItem)new BoolCheckBoxConfigItem(entry, new BoolCheckBoxOptions { RequiresRestart = requiresRestart, Name = GetPrettyConfigName<bool>(entry) })); } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void AddConfig(ConfigEntry<float> entry, bool requiresRestart = false) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Expected O, but got Unknown //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Expected O, but got Unknown LethalConfigManager.AddConfigItem((BaseConfigItem)new FloatInputFieldConfigItem(entry, new FloatInputFieldOptions { RequiresRestart = requiresRestart, Name = GetPrettyConfigName<float>(entry) })); } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void AddConfig(ConfigEntry<int> entry, bool requiresRestart = false) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Expected O, but got Unknown //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Expected O, but got Unknown LethalConfigManager.AddConfigItem((BaseConfigItem)new IntInputFieldConfigItem(entry, new IntInputFieldOptions { RequiresRestart = requiresRestart, Name = GetPrettyConfigName<int>(entry) })); } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void AddConfig<T>(ConfigEntry<T> entry, bool requiresRestart = false) where T : Enum { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Expected O, but got Unknown //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Expected O, but got Unknown object obj = <>c__7<T>.<>9__7_0; if (obj == null) { CanModifyDelegate val = () => CanModifyResult.op_Implicit((ValueTuple<bool, string>)(true, null)); <>c__7<T>.<>9__7_0 = val; obj = (object)val; } CanModifyDelegate canModifyCallback = (CanModifyDelegate)obj; if (((ConfigEntryBase)entry).SettingType.GetCustomAttributes(typeof(FlagsAttribute), inherit: true).Any()) { object obj2 = <>c__7<T>.<>9__7_1; if (obj2 == null) { CanModifyDelegate val2 = () => CanModifyResult.op_Implicit((false, "THIS IS A FLAG TYPE ENUM, EDITING CURRENTLY NOT SUPPORTED!")); <>c__7<T>.<>9__7_1 = val2; obj2 = (object)val2; } canModifyCallback = (CanModifyDelegate)obj2; } LethalConfigManager.AddConfigItem((BaseConfigItem)(object)new EnumDropDownConfigItem<T>(entry, new EnumDropDownOptions { RequiresRestart = requiresRestart, CanModifyCallback = canModifyCallback })); } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void AddButton(string section, string name, string description, string buttonText, Action callback) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown LethalConfigManager.AddConfigItem((BaseConfigItem)new GenericButtonConfigItem(section, name, description, buttonText, (GenericButtonHandler)delegate { callback?.Invoke(); })); } private static string GetPrettyConfigName<T>(ConfigEntry<T> entry) { return CultureInfo.InvariantCulture.TextInfo.ToTitleCase(((ConfigEntryBase)entry).Definition.Key.Replace("_", " ")); } } public static class LobbyCompatibilityChecker { private static bool? _enabled; public static bool Enabled { get { bool valueOrDefault = _enabled.GetValueOrDefault(); if (!_enabled.HasValue) { valueOrDefault = Chainloader.PluginInfos.ContainsKey("BMX.LobbyCompatibility"); _enabled = valueOrDefault; } return _enabled.Value; } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void Init() { PluginHelper.RegisterPlugin("XuuXiaolan.ReXuvination", Version.Parse("1.1.0"), (CompatibilityLevel)0, (VersionStrictness)2); } } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { public IgnoresAccessChecksToAttribute(string assemblyName) { } } }