using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("uk.1a3.silentteleporter")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.8.0")] [assembly: AssemblyInformationalVersion("1.0.8+b2ff7e79740847aeb98bbb99ec21a9083e96ee1b")] [assembly: AssemblyProduct("SilentTeleporter")] [assembly: AssemblyTitle("uk.1a3.silentteleporter")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.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 SilentTeleporter { [BepInPlugin("uk.1a3.silentteleporter", "SilentTeleporter", "1.0.8")] internal class PluginLoader : BaseUnityPlugin { private readonly Harmony harmony = new Harmony("uk.1a3.silentteleporter"); private static bool initialized; internal static ManualLogSource logSource; public static PluginLoader Instance { get; private set; } private void Awake() { if (!initialized) { initialized = true; Instance = this; logSource = Logger.CreateLogSource("uk.1a3.silentteleporter"); Assembly executingAssembly = Assembly.GetExecutingAssembly(); harmony.PatchAll(executingAssembly); logSource.LogInfo((object)"Loaded SilentTeleporter"); } } } [HarmonyPatch] internal static class TeleportPatch { [HarmonyPatch(/*Could not decode attribute arguments.*/)] [HarmonyTranspiler] public static IEnumerable TranspileMoveNext(IEnumerable instructions) { List list = new List(); bool flag = false; bool flag2 = false; bool flag3 = false; foreach (CodeInstruction instruction in instructions) { if (!flag && instruction.opcode == OpCodes.Call && instruction.operand.ToString() == "Void SetPlayerTeleporterId(GameNetcodeStuff.PlayerControllerB, Int32)") { flag2 = true; } else if (!flag && flag2 && instruction.opcode == OpCodes.Ldarg_0) { flag3 = true; flag = true; } else if (instruction.opcode == OpCodes.Ldstr && instruction.operand.ToString() == "Teleport A") { flag3 = false; } if (!flag3) { list.Add(instruction); } } return list.AsEnumerable(); } } internal static class MyPluginInfo { public const string PLUGIN_GUID = "uk.1a3.silentteleporter"; public const string PLUGIN_NAME = "SilentTeleporter"; public const string PLUGIN_VERSION = "1.0.8"; } }