using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Security; using System.Security.Permissions; using System.Text; using System.Text.RegularExpressions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using GameNetcodeStuff; using HarmonyLib; using HostFixes.UI; using LobbyCompatibility.Enums; using LobbyCompatibility.Features; using Microsoft.CodeAnalysis; using Netcode.Transports.Facepunch; using Steamworks; using Steamworks.Data; using Unity.Netcode; using UnityEngine; using UnityEngine.InputSystem; using UnityEngine.UI; [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("com.olegknyazev.softmask")] [assembly: IgnoresAccessChecksTo("DissonanceVoip")] [assembly: IgnoresAccessChecksTo("DunGen")] [assembly: IgnoresAccessChecksTo("DunGen.Integration.ASPP")] [assembly: IgnoresAccessChecksTo("DunGen.Integration.UnityNav")] [assembly: IgnoresAccessChecksTo("EasyTextEffects")] [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.Components")] [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("Unity.XR.CoreUtils")] [assembly: IgnoresAccessChecksTo("Unity.XR.Management")] [assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR")] [assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR.Features.ConformanceAutomation")] [assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR.Features.MetaQuestSupport")] [assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR.Features.MockRuntime")] [assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR.Features.OculusQuestSupport")] [assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR.Features.RuntimeDebugger")] [assembly: IgnoresAccessChecksTo("UnityEngine.ARModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.NVIDIAModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.SpatialTracking")] [assembly: IgnoresAccessChecksTo("UnityEngine.UI")] [assembly: IgnoresAccessChecksTo("UnityEngine.XR.LegacyInputHelpers")] [assembly: AssemblyCompany("CharlesE2")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyDescription("Lethal Company server-side anticheat mod.")] [assembly: AssemblyFileVersion("1.0.30.0")] [assembly: AssemblyInformationalVersion("1.0.30+f8e9cd629630cd60b5e006b99d484fc2f76f2a55")] [assembly: AssemblyProduct("Host Fixes")] [assembly: AssemblyTitle("com.github.CharlesE2.HostFixes")] [assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/Charlese2/HostFixes")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.30.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] [CompilerGenerated] internal sealed class <>z__ReadOnlySingleElementList : IEnumerable, ICollection, IList, IEnumerable, IReadOnlyCollection, IReadOnlyList, ICollection, IList { private sealed class Enumerator : IDisposable, IEnumerator, IEnumerator { object IEnumerator.Current => _item; T IEnumerator.Current => _item; public Enumerator(T item) { _item = item; } bool IEnumerator.MoveNext() { if (!_moveNextCalled) { return _moveNextCalled = true; } return false; } void IEnumerator.Reset() { _moveNextCalled = false; } void IDisposable.Dispose() { } } int ICollection.Count => 1; bool ICollection.IsSynchronized => false; object ICollection.SyncRoot => this; object IList.this[int index] { get { if (index != 0) { throw new IndexOutOfRangeException(); } return _item; } set { throw new NotSupportedException(); } } bool IList.IsFixedSize => true; bool IList.IsReadOnly => true; int IReadOnlyCollection.Count => 1; T IReadOnlyList.this[int index] { get { if (index != 0) { throw new IndexOutOfRangeException(); } return _item; } } int ICollection.Count => 1; bool ICollection.IsReadOnly => true; T IList.this[int index] { get { if (index != 0) { throw new IndexOutOfRangeException(); } return _item; } set { throw new NotSupportedException(); } } public <>z__ReadOnlySingleElementList(T item) { _item = item; } IEnumerator IEnumerable.GetEnumerator() { return new Enumerator(_item); } void ICollection.CopyTo(Array array, int index) { array.SetValue(_item, index); } int IList.Add(object value) { throw new NotSupportedException(); } void IList.Clear() { throw new NotSupportedException(); } bool IList.Contains(object value) { return EqualityComparer.Default.Equals(_item, (T)value); } int IList.IndexOf(object value) { if (!EqualityComparer.Default.Equals(_item, (T)value)) { return -1; } return 0; } void IList.Insert(int index, object value) { throw new NotSupportedException(); } void IList.Remove(object value) { throw new NotSupportedException(); } void IList.RemoveAt(int index) { throw new NotSupportedException(); } IEnumerator IEnumerable.GetEnumerator() { return new Enumerator(_item); } void ICollection.Add(T item) { throw new NotSupportedException(); } void ICollection.Clear() { throw new NotSupportedException(); } bool ICollection.Contains(T item) { return EqualityComparer.Default.Equals(_item, item); } void ICollection.CopyTo(T[] array, int arrayIndex) { array[arrayIndex] = _item; } bool ICollection.Remove(T item) { throw new NotSupportedException(); } int IList.IndexOf(T item) { if (!EqualityComparer.Default.Equals(_item, item)) { return -1; } return 0; } void IList.Insert(int index, T item) { throw new NotSupportedException(); } void IList.RemoveAt(int index) { throw new NotSupportedException(); } } namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [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] [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] [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 HostFixes { internal class Patches { [HarmonyPatch(typeof(StartOfRound), "SyncAlreadyHeldObjectsServerRpc")] internal static class SyncAlreadyHeldObjects_NullRef { public static IEnumerable Transpiler(IEnumerable instructions) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Expected O, but got Unknown //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Expected O, but got Unknown //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Expected O, but got Unknown CodeMatcher val = new CodeMatcher(instructions, (ILGenerator)null).MatchForward(false, (CodeMatch[])(object)new CodeMatch[1] { new CodeMatch((OpCode?)OpCodes.Ldfld, (object)AccessTools.Field(typeof(GrabbableObject), "isHeld"), (string)null) }); if (!val.ReportFailure(MethodBase.GetCurrentMethod(), (Action)Plugin.Log.LogWarning)) { val.SetOperandAndAdvance((object)AccessTools.Field(typeof(GrabbableObject), "playerHeldBy")); val.InsertAndAdvance((CodeInstruction[])(object)new CodeInstruction[2] { new CodeInstruction(OpCodes.Ldnull, (object)null), new CodeInstruction(OpCodes.Call, (object)AccessTools.Method(typeof(Object), "op_Inequality", (Type[])null, (Type[])null)) }); } return val.InstructionEnumeration(); } } [HarmonyPatch(typeof(StartOfRound), "SyncAlreadyHeldObjectsClientRpc")] internal static class SyncAlreadyHeldObjectsToCallingClient { public static IEnumerable Transpiler(IEnumerable instructions) { //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Call && list[i].operand is MethodInfo { Name: "__beginSendClientRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num - 1, new CodeInstruction(OpCodes.Ldarg, (object)5)); list.Insert(num, Transpilers.EmitDelegate>((Func)((ClientRpcParams clientRpcParams, ulong senderClientId) => clientRpcParams = new ClientRpcParams { Send = new ClientRpcSendParams { TargetClientIds = new <>z__ReadOnlySingleElementList(senderClientId) } }))); } else { Plugin.Log.LogWarning((object)"Could not patch SyncAlreadyHeldObjectsClientRpc"); } return list.AsEnumerable(); } } [HarmonyWrapSafe] [HarmonyPatch(typeof(FacepunchTransport), "Steamworks.ISocketManager.OnConnecting")] private class Identity_Fix { public static void Prefix(ref Connection connection, ref ConnectionInfo info) { //IL_000b: 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) Plugin.SteamIdtoConnectionIdMap[((NetIdentity)(ref info.identity)).SteamId.Value] = ((Connection)(ref connection)).Id; Plugin.ConnectionIdtoSteamIdMap[((Connection)(ref connection)).Id] = ((NetIdentity)(ref info.identity)).SteamId.Value; } } [HarmonyWrapSafe] [HarmonyPatch(typeof(FacepunchTransport), "Steamworks.ISocketManager.OnDisconnected")] private class SteamIdDictionary_Cleanup { public static void Prefix(ref Connection connection, ref ConnectionInfo info) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)NetworkManager.Singleton != (Object)null && NetworkManager.Singleton.IsListening) { Plugin.SteamIdtoConnectionIdMap.Remove(((NetIdentity)(ref info.identity)).SteamId.Value); Plugin.ConnectionIdtoSteamIdMap.Remove(((Connection)(ref connection)).Id); Plugin.playerSteamNames.Remove(((NetIdentity)(ref info.identity)).SteamId.Value); } } } [HarmonyWrapSafe] [HarmonyPatch(typeof(NetworkConnectionManager), "OnClientDisconnectFromServer")] private class ClientIdToSteamId_Cleanup { public static void Prefix(ulong clientId) { if (NetworkManager.Singleton.IsHost && Plugin.ClientIdToSteamIdMap.TryGetValue(clientId, out var value)) { Plugin.SteamIdtoClientIdMap.Remove(value); Plugin.ClientIdToSteamIdMap.Remove(clientId); } } } [HarmonyWrapSafe] [HarmonyPatch(typeof(StartOfRound), "OnClientConnect")] private class OnClientConnect { public static void Postfix(StartOfRound __instance, ulong clientId) { if (((NetworkBehaviour)__instance).IsServer && clientId != 0L && !GameNetworkManager.Instance.disableSteam && StartOfRound.Instance.ClientPlayerList.TryGetValue(clientId, out var value)) { StartOfRound.Instance.allPlayerScripts[value].playerSteamId = Plugin.ClientIdToSteamIdMap[clientId]; } } } [HarmonyWrapSafe] [HarmonyPatch(typeof(GameNetworkManager), "ConnectionApproval")] private class MapSteamIdToClientId { [HarmonyPriority(800)] public static void Prefix(GameNetworkManager __instance, ref ConnectionApprovalRequest request) { if (!__instance.disableSteam) { ulong num = NetworkManager.Singleton.ConnectionManager.ClientIdToTransportId(request.ClientNetworkId); if (Plugin.ConnectionIdtoSteamIdMap.TryGetValue((uint)num, out var value)) { Plugin.SteamIdtoClientIdMap[value] = request.ClientNetworkId; Plugin.ClientIdToSteamIdMap[request.ClientNetworkId] = value; } } } public static void Postfix(GameNetworkManager __instance, ref ConnectionApprovalRequest request, ref ConnectionApprovalResponse response) { if (__instance.disableSteam) { return; } ulong num = NetworkManager.Singleton.ConnectionManager.ClientIdToTransportId(request.ClientNetworkId); if (Plugin.ConnectionIdtoSteamIdMap.TryGetValue((uint)num, out var value)) { if ((Object)(object)StartOfRound.Instance != (Object)null && StartOfRound.Instance.KickedClientIds.Contains(value)) { if (response.Reason == "") { response.Reason = "You cannot rejoin after being kicked."; } response.Approved = false; } string[] array = Encoding.ASCII.GetString(request.Payload).Split(","); if (array.Length >= 2 && array[1] != value.ToString()) { Plugin.Log.LogInfo((object)$"SteamID sent by client ({array[1]}) doesn't match SteamID from steam ({value})."); } } else { Plugin.Log.LogError((object)$"[ConnectionApproval] Could not get steamId from transportId ({num})"); } } } [HarmonyWrapSafe] [HarmonyPatch(typeof(Terminal), "Awake")] private class HostInitialization { public static void Postfix(Terminal __instance) { ((MonoBehaviour)Plugin.Instance).StartCoroutine(Plugin.TerminalAwakeWait(__instance)); new InfoPanel(); } } [HarmonyWrapSafe] [HarmonyPatch(typeof(NetworkConnectionManager), "Initialize")] private class SetupIdMap { public static void Prefix() { //IL_0011: 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_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) if (!GameNetworkManager.Instance.disableSteam) { Plugin.SteamIdtoClientIdMap[SteamId.op_Implicit(SteamClient.SteamId)] = 0uL; Plugin.ClientIdToSteamIdMap[0uL] = SteamId.op_Implicit(SteamClient.SteamId); Plugin.SteamIdtoConnectionIdMap[SteamId.op_Implicit(SteamClient.SteamId)] = 0u; Plugin.ConnectionIdtoSteamIdMap[0u] = SteamId.op_Implicit(SteamClient.SteamId); } } } [HarmonyWrapSafe] [HarmonyPatch(typeof(NetworkManager), "OnEnable")] private class RegisterNetworkManagerEvents { public static void Postfix() { NetworkManager.Singleton.OnServerStopped -= Plugin.ServerStopped; NetworkManager.Singleton.OnServerStopped += Plugin.ServerStopped; } } [HarmonyWrapSafe] [HarmonyPatch(typeof(HUDManager), "AddPlayerChatMessageClientRpc")] private class AddPlayerChatMessageClientRpc_Patch { public static bool Prefix(HUDManager __instance, int playerId) { NetworkManager networkManager = ((NetworkBehaviour)__instance).NetworkManager; if ((Object)(object)networkManager == (Object)null || !networkManager.IsListening) { return false; } if (!networkManager.IsHost && (playerId < 0 || playerId >= StartOfRound.Instance.allPlayerScripts.Length)) { return false; } return true; } } [HarmonyWrapSafe] [HarmonyPatch(typeof(PlayerControllerB), "SwitchToItemSlot")] private class SwitchToItemSlot_Patch { public static void Prefix(PlayerControllerB __instance, ref int slot) { slot = Mathf.Clamp(slot, 0, __instance.ItemSlots.Length - 1); } } [HarmonyWrapSafe] [HarmonyPatch(typeof(PlayerControllerB), "NextItemSlot")] private class NextItemSlot_Patch { public static void Prefix(PlayerControllerB __instance) { __instance.currentItemSlot = Mathf.Clamp(__instance.currentItemSlot, 0, __instance.ItemSlots.Length - 1); } } [HarmonyWrapSafe] [HarmonyPatch(typeof(StartOfRound), "OnPlayerDC")] private class OnPlayerDC_Patch { public static void Postfix(ulong clientId) { if (Plugin.votedToLeaveEarlyPlayers.Remove(clientId)) { TimeOfDay.Instance.votesForShipToLeaveEarly = Plugin.votedToLeaveEarlyPlayers.Count; } } } [HarmonyWrapSafe] [HarmonyPatch(typeof(StartOfRound), "ShipLeave")] private class ShipLeave_Patch { public static void Prefix() { Plugin.votedToLeaveEarlyPlayers.Clear(); } } } [BepInPlugin("com.github.CharlesE2.HostFixes", "Host Fixes", "1.0.30")] public class Plugin : BaseUnityPlugin { internal class ConnectionEvents { internal static void ConnectionAttempt(Lobby _, Friend member) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) if (NetworkManager.Singleton.IsHost && !playerSteamNames.TryAdd(member.Id.Value, ((Friend)(ref member)).Name)) { Log.LogWarning((object)$"SteamId: ({member.Id.Value}) Name: ({((Friend)(ref member)).Name}) is already in the playerSteamNames list."); } } internal static void ConnectionCleanup(Lobby _, Friend member) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: 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_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) if (NetworkManager.Singleton.IsHost && !GameNetworkManager.Instance.steamIdsInLobby.Remove(SteamId.op_Implicit(member.Id.Value))) { Log.LogWarning((object)$"({member.Id.Value}) already removed from steamIdsInLobby."); } } internal static void LobbyCreated(Result result, Lobby lobby) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Invalid comparison between Unknown and I4 //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //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) if ((int)result == 1) { Dictionary playerSteamNames = Plugin.playerSteamNames; ulong value = ((Lobby)(ref lobby)).Owner.Id.Value; Friend owner = ((Lobby)(ref lobby)).Owner; if (!playerSteamNames.TryAdd(value, ((Friend)(ref owner)).Name)) { Log.LogWarning((object)"Host is already in playerSteamNames."); } } } } public class HostFixesServerReceiveRpcs { public void BuyItemsServerRpc(int[] boughtItems, int newGroupCredits, int numItemsInShip, Terminal instance, __RpcParams RpcParams) { //IL_0000: 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_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_0105: 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_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0124: 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_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Unknown result type (might be due to invalid IL or missing references) //IL_0306: Unknown result type (might be due to invalid IL or missing references) //IL_0310: Unknown result type (might be due to invalid IL or missing references) //IL_0323: Unknown result type (might be due to invalid IL or missing references) //IL_0325: Unknown result type (might be due to invalid IL or missing references) //IL_032a: Unknown result type (might be due to invalid IL or missing references) //IL_032c: Unknown result type (might be due to invalid IL or missing references) //IL_034a: Unknown result type (might be due to invalid IL or missing references) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[BuyItemsServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); return; } if (!configCheckPrices.Value) { instance.BuyItemsServerRpc(boughtItems, newGroupCredits, numItemsInShip); return; } string playerUsername = StartOfRound.Instance.allPlayerScripts[value].playerUsername; int num = 0; if (instance.numberOfItemsInDropship + boughtItems.Length > 12) { Log.LogInfo((object)$"Player #{value} ({playerUsername}) tried to buy too many items."); ClientRpcParams clientRpcParams = new ClientRpcParams { Send = new ClientRpcSendParams { TargetClientIds = new <>z__ReadOnlySingleElementList(senderClientId) } }; HostFixesServerSendRpcs.Instance.SyncTerminalValuesClientRpc(instance.groupCredits, instance.numberOfItemsInDropship, instance.hasWarrantyTicket, instance, clientRpcParams); return; } if (newGroupCredits < 0) { Log.LogInfo((object)$"Player #{value} ({playerUsername}) tried tried to set credits to a negative number while buying items."); ClientRpcParams clientRpcParams2 = new ClientRpcParams { Send = new ClientRpcSendParams { TargetClientIds = new <>z__ReadOnlySingleElementList(senderClientId) } }; HostFixesServerSendRpcs.Instance.SyncTerminalValuesClientRpc(instance.groupCredits, instance.numberOfItemsInDropship, instance.hasWarrantyTicket, instance, clientRpcParams2); return; } Dictionary dictionary = (from item in boughtItems group item by item).ToDictionary((IGrouping item) => item.Key, (IGrouping item) => item.Count()); foreach (int key in dictionary.Keys) { if (key < 0 || key >= instance.buyableItemsList.Length || key >= instance.itemSalesPercentages.Length) { Log.LogInfo((object)$"Player #{value} ({playerUsername}) tried to buy an item that was not in the host's shop. Item #{key}"); ClientRpcParams clientRpcParams3 = new ClientRpcParams { Send = new ClientRpcSendParams { TargetClientIds = new <>z__ReadOnlySingleElementList(senderClientId) } }; HostFixesServerSendRpcs.Instance.SyncTerminalValuesClientRpc(instance.groupCredits, instance.numberOfItemsInDropship, instance.hasWarrantyTicket, instance, clientRpcParams3); return; } num += (int)((float)instance.buyableItemsList[key].creditsWorth * ((float)instance.itemSalesPercentages[key] / 100f) * (float)dictionary[key]); } if (instance.groupCredits - num != newGroupCredits) { Log.LogInfo((object)($"Player #{value} ({playerUsername}) credits spent on items does not match item price. " + $"Spent credits: {instance.groupCredits - newGroupCredits} Cost Of items: {num}")); ClientRpcParams clientRpcParams4 = new ClientRpcParams { Send = new ClientRpcSendParams { TargetClientIds = new <>z__ReadOnlySingleElementList(senderClientId) } }; HostFixesServerSendRpcs.Instance.SyncTerminalValuesClientRpc(instance.groupCredits, instance.numberOfItemsInDropship, instance.hasWarrantyTicket, instance, clientRpcParams4); } else { instance.BuyItemsServerRpc(boughtItems, newGroupCredits, numItemsInShip); } } public void PlayTerminalAudioServerRpc(int clipIndex, Terminal instance, ServerRpcParams _) { if (!terminalSoundPlaying) { ((MonoBehaviour)Instance).StartCoroutine(TerminalSoundCooldown()); instance.PlayTerminalAudioServerRpc(clipIndex); } } public void BuyShipUnlockableServerRpc(int unlockableID, int newGroupCreditsAmount, StartOfRound instance, __RpcParams RpcParams) { //IL_0000: 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) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[BuyShipUnlockableServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); return; } Terminal val = Object.FindObjectOfType(); if (senderClientId == 0L) { instance.BuyShipUnlockableServerRpc(unlockableID, newGroupCreditsAmount); } else if (!buyShipUnlockableOnCooldown) { ((MonoBehaviour)Instance).StartCoroutine(BuyShipUnlockableCooldown()); string playerUsername = StartOfRound.Instance.allPlayerScripts[value].playerUsername; int value2; if (unlockableID < 0 || unlockableID >= StartOfRound.Instance.unlockablesList.unlockables.Count) { Log.LogInfo((object)$"Player #{value} ({playerUsername}) tried to buy unlockable that is not in the unlockables list. ({unlockableID})."); } else if (StartOfRound.Instance.unlockablesList.unlockables[unlockableID].alreadyUnlocked) { Log.LogInfo((object)$"Player #{value} ({playerUsername}) tried to unlock an unlockable multiple times"); } else if (!unlockablePrices.TryGetValue(unlockableID, out value2)) { Log.LogError((object)$"Could not find price of ship unlockable #{unlockableID}"); } else if (newGroupCreditsAmount < 0) { Log.LogInfo((object)$"Player #{value} ({playerUsername}) tried to set credits to a negative number unlocking ship unlockable."); } else if (senderClientId != 0L && val.groupCredits - value2 != newGroupCreditsAmount) { Log.LogInfo((object)($"Player #{value} ({playerUsername}) calculated credit amount does not match sent credit amount for unlockable. " + $"Current credits: {val.groupCredits} Unlockable cost: {value2} Sent credit Amount: {newGroupCreditsAmount}")); } else if (newGroupCreditsAmount < val.groupCredits) { instance.BuyShipUnlockableServerRpc(unlockableID, newGroupCreditsAmount); } else { Log.LogInfo((object)($"Player #{senderClientId} ({playerUsername}) attempted to increase credits while buying ship unlockables." + $" Attempted credit value: {newGroupCreditsAmount} Old credit value: {val.groupCredits}")); } } } public void ChangeLevelServerRpc(int levelID, int newGroupCreditsAmount, StartOfRound instance, __RpcParams RpcParams) { //IL_0000: 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_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: 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_00d9: 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_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02ba: Unknown result type (might be due to invalid IL or missing references) //IL_02cd: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Unknown result type (might be due to invalid IL or missing references) //IL_02d4: 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_02f4: Unknown result type (might be due to invalid IL or missing references) //IL_035a: 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_0377: Unknown result type (might be due to invalid IL or missing references) //IL_0379: Unknown result type (might be due to invalid IL or missing references) //IL_037e: Unknown result type (might be due to invalid IL or missing references) //IL_0380: Unknown result type (might be due to invalid IL or missing references) //IL_039e: Unknown result type (might be due to invalid IL or missing references) //IL_03f1: Unknown result type (might be due to invalid IL or missing references) //IL_03fb: Unknown result type (might be due to invalid IL or missing references) //IL_040e: Unknown result type (might be due to invalid IL or missing references) //IL_0410: Unknown result type (might be due to invalid IL or missing references) //IL_0415: Unknown result type (might be due to invalid IL or missing references) //IL_0417: Unknown result type (might be due to invalid IL or missing references) //IL_0435: Unknown result type (might be due to invalid IL or missing references) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[ChangeLevelServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); return; } string playerUsername = StartOfRound.Instance.allPlayerScripts[value].playerUsername; if (changeLevelCooldown.TryGetValue(value, out var value2) && value2) { return; } ((MonoBehaviour)Instance).StartCoroutine(ChangeLevelCooldown(value)); if (senderClientId == 0L) { instance.ChangeLevelServerRpc(levelID, newGroupCreditsAmount); return; } Terminal val = Object.FindObjectOfType(); if (StartOfRound.Instance.allPlayerScripts[value].isPlayerDead) { Log.LogInfo((object)$"Player #{value} ({playerUsername}) tried to change the moon while they are dead on the server."); ClientRpcParams clientRpcParams = new ClientRpcParams { Send = new ClientRpcSendParams { TargetClientIds = new <>z__ReadOnlySingleElementList(senderClientId) } }; HostFixesServerSendRpcs.Instance.SyncTerminalValuesClientRpc(val.groupCredits, val.numberOfItemsInDropship, val.hasWarrantyTicket, val, clientRpcParams); return; } if (newGroupCreditsAmount < 0) { Log.LogInfo((object)$"Player #{value} ({playerUsername}) tried to set credits to a negative number while changing levels."); ClientRpcParams clientRpcParams2 = new ClientRpcParams { Send = new ClientRpcSendParams { TargetClientIds = new <>z__ReadOnlySingleElementList(senderClientId) } }; HostFixesServerSendRpcs.Instance.SyncTerminalValuesClientRpc(val.groupCredits, val.numberOfItemsInDropship, val.hasWarrantyTicket, val, clientRpcParams2); return; } if (!configCheckPrices.Value) { instance.ChangeLevelServerRpc(levelID, newGroupCreditsAmount); return; } if (moons.Count == 0) { moons = (from moon in val.terminalNodes.allKeywords.First((TerminalKeyword keyword) => ((Object)keyword).name == "Route").compatibleNouns group moon by moon.noun into moon select moon.First() into moon select moon.result.terminalOptions.First((CompatibleNoun option) => ((Object)option.noun).name == "Confirm")).ToDictionary((CompatibleNoun option) => option.result.buyRerouteToMoon, (CompatibleNoun option) => option.result.itemCost); } if (!moons.ContainsKey(levelID)) { Log.LogInfo((object)$"Player #{value} ({playerUsername}) sent levelID ({levelID}) that is not in the moons array."); ClientRpcParams clientRpcParams3 = new ClientRpcParams { Send = new ClientRpcSendParams { TargetClientIds = new <>z__ReadOnlySingleElementList(senderClientId) } }; HostFixesServerSendRpcs.Instance.SyncTerminalValuesClientRpc(val.groupCredits, val.numberOfItemsInDropship, val.hasWarrantyTicket, val, clientRpcParams3); return; } int num = moons[levelID]; if (val.groupCredits - num != newGroupCreditsAmount) { Log.LogInfo((object)($"Player #{value} ({playerUsername}) calculated credit amount does not match sent credit amount for moon. " + $"Spent credits: {val.groupCredits - newGroupCreditsAmount} Moon cost: {num}")); ClientRpcParams clientRpcParams4 = new ClientRpcParams { Send = new ClientRpcSendParams { TargetClientIds = new <>z__ReadOnlySingleElementList(senderClientId) } }; HostFixesServerSendRpcs.Instance.SyncTerminalValuesClientRpc(val.groupCredits, val.numberOfItemsInDropship, val.hasWarrantyTicket, val, clientRpcParams4); } else if (newGroupCreditsAmount > val.groupCredits) { Log.LogInfo((object)($"Player #{value} ({playerUsername}) attempted to increase credits by changing levels. " + $"Attempted Credit Value: {newGroupCreditsAmount} Old Credit Value: {val.groupCredits}")); ClientRpcParams clientRpcParams5 = new ClientRpcParams { Send = new ClientRpcSendParams { TargetClientIds = new <>z__ReadOnlySingleElementList(senderClientId) } }; HostFixesServerSendRpcs.Instance.SyncTerminalValuesClientRpc(val.groupCredits, val.numberOfItemsInDropship, val.hasWarrantyTicket, val, clientRpcParams5); } else { instance.ChangeLevelServerRpc(levelID, newGroupCreditsAmount); } } public void AddPlayerChatMessageServerRpc(string chatMessage, int playerId, HUDManager instance, __RpcParams RpcParams) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) if (string.IsNullOrWhiteSpace(chatMessage)) { return; } ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)($"[AddPlayerChatMessageServerRpc] Failed to get the playerId from senderClientId: ({senderClientId}) " + "Message: (" + chatMessage + ")")); return; } string playerUsername = StartOfRound.Instance.allPlayerScripts[value].playerUsername; if (StartOfRound.Instance.allPlayerScripts[value].isPlayerDead) { Log.LogInfo((object)($"Player #{value} ({playerUsername}) tried sending a chat message while they are dead on the server. " + "Message: (" + chatMessage + ")")); return; } if (playerId < 0 || playerId >= StartOfRound.Instance.allPlayerScripts.Length) { Log.LogInfo((object)($"Player #{value} ({playerUsername}) tried to chat with a playerId ({playerId}) that is not a valid player. " + "Message: (" + chatMessage + ")")); return; } string text = Regex.Replace(chatMessage, "<(\\S+?)>", "($+)"); if (string.IsNullOrWhiteSpace(text)) { Log.LogInfo((object)$"Player #{value} ({playerUsername}) Chat message was empty after sanitization. Original Message: ({chatMessage})"); return; } if (playerId == value) { instance.AddPlayerChatMessageServerRpc(text, playerId); return; } Log.LogInfo((object)$"Player #{value} ({playerUsername}) tried to send message as another player #({playerId}) Message: ({chatMessage})"); } public void AddTextMessageServerRpc(string chatMessage, HUDManager instance, __RpcParams RpcParams) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //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) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[AddTextMessageServerRpc] Failed to get the playerId from senderClientId: ({senderClientId}) Message: ({chatMessage})"); return; } string playerUsername = StartOfRound.Instance.allPlayerScripts[value].playerUsername; ulong playerSteamId = StartOfRound.Instance.allPlayerScripts[value].playerSteamId; if (GameNetworkManager.Instance.disableSteam) { HUDManager.Instance.AddTextMessageServerRpc(chatMessage); } else if (senderClientId == 0L) { instance.AddTextMessageServerRpc(chatMessage); } else if (chatMessage.Equals($"[playerNum{value}] started the ship.")) { instance.AddTextMessageServerRpc(chatMessage); } else if (!chatMessage.EndsWith(" started the ship.")) { if (!playerSteamNames.TryGetValue(playerSteamId, out string value2)) { Log.LogError((object)$"Failed to get steam username from playerlist for steamId: {playerSteamId} Message: ({chatMessage})"); } else if (!chatMessage.Equals(playerUsername + " joined the ship.") && !chatMessage.Equals(value2 + " joined the ship.") && !chatMessage.Equals(value2 + "... joined the ship.") && !chatMessage.Equals(playerUsername + " was left behind.")) { Log.LogInfo((object)$"Player #{value} ({value2}) tried to send message as the server: ({chatMessage})"); } else { instance.AddTextMessageServerRpc(chatMessage); } } } public void SetShipLeaveEarlyServerRpc(TimeOfDay instance, __RpcParams RpcParams) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //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) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[SetShipLeaveEarlyServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); } else if (!votedToLeaveEarlyPlayers.Contains(senderClientId) && StartOfRound.Instance.allPlayerScripts[value].isPlayerDead) { votedToLeaveEarlyPlayers.Add(senderClientId); int val = StartOfRound.Instance.connectedPlayersAmount + 1 - StartOfRound.Instance.livingPlayers; if (votedToLeaveEarlyPlayers.Count >= Math.Max(val, configMinimumVotesToLeaveEarly.Value)) { instance.votesForShipToLeaveEarly = votedToLeaveEarlyPlayers.Count; instance.SetShipLeaveEarlyClientRpc(instance.normalizedTimeOfDay + 0.1f, instance.votesForShipToLeaveEarly); } else { instance.votesForShipToLeaveEarly++; instance.AddVoteForShipToLeaveEarlyClientRpc(); } } else { string playerUsername = StartOfRound.Instance.allPlayerScripts[value].playerUsername; Log.LogInfo((object)$"Player #{value} ({playerUsername}) tried to force the vote to leave."); } } public void PlaceShipObjectServerRpc(Vector3 newPosition, Vector3 newRotation, NetworkObjectReference objectRef, int playerWhoMoved, ShipBuildModeManager instance, __RpcParams RpcParams) { //IL_0000: 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_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_0254: Unknown result type (might be due to invalid IL or missing references) //IL_0258: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_0225: 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) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0286: Unknown result type (might be due to invalid IL or missing references) //IL_0287: Unknown result type (might be due to invalid IL or missing references) //IL_0288: Unknown result type (might be due to invalid IL or missing references) //IL_0383: Unknown result type (might be due to invalid IL or missing references) //IL_0384: 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) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[PlaceShipObjectServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); } else { if (playerMovedShipObject.TryGetValue(value, out var value2) && value2) { return; } ((MonoBehaviour)Instance).StartCoroutine(PlaceShipObjectCooldown(value)); PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[value]; if (playerWhoMoved != value) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) tried to place a ship object while spoofing another player."); return; } if (val.isPlayerDead) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) tried to place a ship object while dead on the server."); return; } GameObject val2 = NetworkObjectReference.op_Implicit(objectRef); if ((Object)(object)val2 == (Object)null) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) tried to move a ship object that doesn't exist."); return; } PlaceableShipObject componentInChildren = val2.GetComponentInChildren(); if ((Object)(object)componentInChildren == (Object)null) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) tried to move a ship object using an invalid object. ({((Object)val2).name})"); return; } if (configShipObjectRotationCheck.Value && (Mathf.RoundToInt(newRotation.x) != Mathf.RoundToInt(((Component)componentInChildren.mainMesh).transform.eulerAngles.x) || Mathf.RoundToInt(newRotation.z) != Mathf.RoundToInt(((Component)componentInChildren.mainMesh).transform.eulerAngles.z))) { Log.LogInfo((object)($"Player #{value} ({val.playerUsername}) " + "tried to place a ship object (" + ((Object)componentInChildren.parentObject).name + ") with the wrong rotation. " + $"x: ({newRotation.x}) ({((Component)componentInChildren.mainMesh).transform.eulerAngles.x}) " + $"z: ({newRotation.z}) ({((Component)componentInChildren.mainMesh).transform.eulerAngles.z})")); return; } Bounds bounds = StartOfRound.Instance.shipInnerRoomBounds.bounds; if (!((Bounds)(ref bounds)).Contains(newPosition)) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) tried to place a ship object ouside of the ship."); return; } if (senderClientId == 0L) { instance.PlaceShipObjectServerRpc(newPosition, newRotation, objectRef, playerWhoMoved); return; } ShipTeleporter val3 = default(ShipTeleporter); if ((Object)(object)componentInChildren != (Object)null && (Object)(object)componentInChildren.parentObject != (Object)null && ((object)componentInChildren.parentObject).GetType() == typeof(ShipTeleporter) && ((Component)componentInChildren.parentObject).TryGetComponent(ref val3) && val3.isInverseTeleporter && pressTeleportButtonOnCooldown.Contains(val3)) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) moved inverse teleporter while it is currently teleporting."); } if (configLogShipObjects.Value) { if ((Object)(object)componentInChildren != (Object)null && (Object)(object)componentInChildren.parentObject != (Object)null) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) moved ship object. ({((Object)componentInChildren.parentObject).name})"); } else { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) moved ship object."); } } instance.PlaceShipObjectServerRpc(newPosition, newRotation, objectRef, playerWhoMoved); } } public void DespawnEnemyServerRpc(NetworkObjectReference enemyNetworkObject, RoundManager instance, __RpcParams RpcParams) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //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_0040: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[DespawnEnemyServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); return; } GameObject val = NetworkObjectReference.op_Implicit(enemyNetworkObject); string playerUsername = StartOfRound.Instance.allPlayerScripts[value].playerUsername; if (senderClientId != 0L) { Log.LogInfo((object)($"Player #{value} ({playerUsername}) attemped to despawn an enemy on the server: " + string.Format("{0} {1}", ((Object)(object)val != (Object)null) ? ((Object)val).name : "null", ((NetworkObjectReference)(ref enemyNetworkObject)).NetworkObjectId))); } else { instance.DespawnEnemyServerRpc(enemyNetworkObject); } } public void EndGameServerRpc(int playerClientId, StartOfRound instance, __RpcParams RpcParams) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //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_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[EndGameServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); return; } if (senderClientId == 0L) { instance.EndGameServerRpc(playerClientId); return; } if (endGameOnCoolown.TryGetValue(value, out var value2) && value2) { ((MonoBehaviour)Instance).StartCoroutine(EndGameCooldown(value)); return; } PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[value]; if (playerClientId != value) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) tried to end the game while spoofing another player."); return; } if (val.isPlayerDead) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) tried to end the game while dead on the server."); return; } float num = Vector3.Distance(((Component)Object.FindFirstObjectByType()).transform.position, ((Component)val).transform.position); if ((float)configLimitShipLeverDistance.Value > 1f && num > (float)configLimitShipLeverDistance.Value) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) tried to end the game while too far away ({num})."); } else { instance.EndGameServerRpc(playerClientId); } } public void PlayerLoadedServerRpc(ulong clientId, StartOfRound instance, __RpcParams RpcParams) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //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) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (senderClientId == 0L) { instance.PlayerLoadedServerRpc(clientId); return; } if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[PlayerLoadedServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); return; } PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[value]; if (clientId != senderClientId) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) tried to call PlayerLoadedServerRpc for another client."); } else if (!instance.fullyLoadedPlayers.Contains(clientId)) { instance.PlayerLoadedServerRpc(clientId); } } public void FinishedGeneratingLevelServerRpc(ulong clientId, RoundManager instance, __RpcParams RpcParams) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //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) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (senderClientId == 0L) { instance.FinishedGeneratingLevelServerRpc(clientId); return; } if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[FinishedGeneratingLevelServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); return; } PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[value]; if (clientId != senderClientId) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) tried to call FinishedGeneratingLevelServerRpc for another client."); } else if (!instance.playersFinishedGeneratingFloor.Contains(clientId)) { instance.FinishedGeneratingLevelServerRpc(clientId); } } public void SendNewPlayerValuesServerRpc(ulong newPlayerSteamId, PlayerControllerB instance, __RpcParams RpcParams) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //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) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[SendNewPlayerValuesServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); return; } PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[value]; if (instance.actualClientId != senderClientId) { Log.LogInfo((object)($"Player #{value} ({val.playerUsername}) " + $"tried to call SendNewPlayerValuesServerRpc with input value ({newPlayerSteamId}) " + $"on player #{instance.playerClientId} ({instance.playerUsername}).")); return; } if (GameNetworkManager.Instance.disableSteam) { instance.SendNewPlayerValuesServerRpc(newPlayerSteamId); return; } if (!ClientIdToSteamIdMap.TryGetValue(senderClientId, out var value2)) { Log.LogError((object)$"[SendNewPlayerValuesServerRpc] Could not get steamId ({value2}) in steamIdtoClientIdMap"); return; } if (((NetworkBehaviour)instance).OwnerClientId != senderClientId) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) SteamId:({value2}) sent SendNewPlayerValuesServerRpc for the wrong player."); return; } if (value2 != newPlayerSteamId) { Log.LogInfo((object)$"Client sent incorrect steamId. Player's steamId: ({value2}) Sent steamId: ({newPlayerSteamId})"); } instance.SendNewPlayerValuesServerRpc(value2); } public void DamagePlayerFromOtherClientServerRpc(int damageAmount, Vector3 hitDirection, int playerWhoHit, PlayerControllerB instance, __RpcParams RpcParams) { //IL_0000: 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_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_025c: Unknown result type (might be due to invalid IL or missing references) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[DamagePlayerFromOtherClientServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); return; } string playerUsername = StartOfRound.Instance.allPlayerScripts[value].playerUsername; PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[value]; if (senderClientId == 0L && playerWhoHit == -1) { instance.DamagePlayerFromOtherClientServerRpc(damageAmount, hitDirection, playerWhoHit); } else { if (damagePlayerFromOtherClientOnCooldown.TryGetValue(value, out var value2) && value2) { return; } ((MonoBehaviour)instance).StartCoroutine(DamageOtherPlayerCooldown(value)); if (playerWhoHit != value) { Log.LogInfo((object)($"Player #{value} ({playerUsername}) tried to spoof ({damageAmount}) damage from player #{playerWhoHit} " + "on (" + instance.playerUsername + ").")); return; } if (val.isPlayerDead) { Log.LogInfo((object)$"Player #{value} ({playerUsername}) tried to damage ({instance.playerUsername}) while they are dead on the server."); return; } if (Vector3.Distance(((Component)val).transform.position, ((Component)instance).transform.position) > 10f) { Log.LogInfo((object)$"Player #{value} ({playerUsername}) tried to damage ({instance.playerUsername}) from too far away."); return; } Shovel val2 = Object.FindFirstObjectByType((FindObjectsInactive)1); bool flag = true; if ((Object)(object)val2 != (Object)null) { flag = val2.shovelHitForce == 1; } if (flag && damageAmount > 20) { Log.LogInfo((object)$"Player #{value} ({playerUsername}) tried to damage ({instance.playerUsername}) for extra damage ({damageAmount})"); return; } if (configDisablePvpInShip.Value) { Bounds bounds = StartOfRound.Instance.shipInnerRoomBounds.bounds; if (((Bounds)(ref bounds)).Contains(((Component)instance).transform.position)) { Log.LogInfo((object)$"Player #{value} ({playerUsername}) tried to damage ({instance.playerUsername}) inside the ship."); return; } } if (configLogPvp.Value) { Log.LogInfo((object)$"Player #{value} ({playerUsername}) damaged ({instance.playerUsername}) for ({damageAmount}) damage."); } instance.DamagePlayerFromOtherClientServerRpc(damageAmount, hitDirection, playerWhoHit); } } public void ShootGunServerRpc(Vector3 shotgunPosition, Vector3 shotgunForward, ShotgunItem instance, __RpcParams RpcParams) { //IL_0000: 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_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_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0054: 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_00dc: Unknown result type (might be due to invalid IL or missing references) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[ShootGunServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); return; } if (senderClientId == 0L && (Object)(object)((GrabbableObject)instance).playerHeldBy == (Object)null) { instance.ShootGunServerRpc(shotgunPosition, shotgunForward); return; } PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[value]; if (Vector3.Distance(((Component)instance).transform.position, shotgunPosition) > val.grabDistance + 7f) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) tried to shoot shotgun from too far away from shotgun position."); } else if (instance.shellsLoaded < 1 && !instance.localClientSendingShootGunRPC) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) tried to force shotgun to shoot with no ammo."); } else { instance.ShootGunClientRpc(shotgunPosition, shotgunForward); } } public void ReloadGunEffectsServerRpc(bool start, ShotgunItem instance, __RpcParams RpcParams) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //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) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[ReloadGunEffectsServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); return; } if (!configPreventInfiniteShotgunAmmo.Value || start) { instance.ReloadGunEffectsServerRpc(start); return; } _ = StartOfRound.Instance.allPlayerScripts[value]; if (reloadGunEffectsOnCooldown.TryGetValue(value, out var value2) && value2) { instance.gunAnimator.SetBool("Reloading", false); instance.isReloading = false; return; } ((MonoBehaviour)Instance).StartCoroutine(ReloadGunEffectsCooldown(value)); if (instance.shellsLoaded >= 2) { instance.gunAnimator.SetBool("Reloading", false); instance.isReloading = false; } else if (!ammoHasBeenDeletedOnReload[value]) { instance.gunAnimator.SetBool("Reloading", false); instance.isReloading = false; } else { ammoHasBeenDeletedOnReload[value] = false; instance.ReloadGunEffectsServerRpc(start); } } public void DestroyItemInSlotServerRpc(int itemSlot, PlayerControllerB instance, __RpcParams RpcParams) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //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) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[DestroyItemInSlotServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); return; } if (!configPreventInfiniteShotgunAmmo.Value) { instance.DestroyItemInSlotServerRpc(itemSlot); return; } PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[value]; if (itemSlot < 0 && itemSlot > val.ItemSlots.Count() - 1) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) tried to destory item in slot ({itemSlot}) while the last slot is ({val.ItemSlots.Count() - 1}"); } else if (((object)val.ItemSlots[itemSlot]).GetType() != typeof(GunAmmo)) { if (senderClientId == 0L) { Log.LogWarning((object)$"[DestroyItemInSlotServerRpc] New item type being deleted? ({((object)val.ItemSlots[itemSlot]).GetType()})"); } } else { ammoHasBeenDeletedOnReload[value] = true; instance.DestroyItemInSlotServerRpc(itemSlot); } } public void ChangeOwnershipOfPropServerRpc(ulong NewOwner, GrabbableObject instance, __RpcParams RpcParams) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //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) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[ChangeOwnershipOfPropServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); return; } PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[value]; if (senderClientId != 0L) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) called ChangeOwnershipOfPropServerRpc while not the host."); } else { instance.ChangeOwnershipOfPropServerRpc(NewOwner); } } public void GrabObjectServerRpc(NetworkObjectReference grabbedObject, PlayerControllerB instance, __RpcParams RpcParams) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //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_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: 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) //IL_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_036b: Unknown result type (might be due to invalid IL or missing references) //IL_0332: Unknown result type (might be due to invalid IL or missing references) //IL_033c: Unknown result type (might be due to invalid IL or missing references) //IL_034f: Unknown result type (might be due to invalid IL or missing references) //IL_0351: 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_0358: 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) //IL_0362: Unknown result type (might be due to invalid IL or missing references) //IL_02dc: Unknown result type (might be due to invalid IL or missing references) //IL_0265: Unknown result type (might be due to invalid IL or missing references) //IL_026f: Unknown result type (might be due to invalid IL or missing references) //IL_0282: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Unknown result type (might be due to invalid IL or missing references) //IL_0289: Unknown result type (might be due to invalid IL or missing references) //IL_028b: Unknown result type (might be due to invalid IL or missing references) //IL_0293: Unknown result type (might be due to invalid IL or missing references) //IL_0295: Unknown result type (might be due to invalid IL or missing references) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[GrabObjectServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); return; } string playerUsername = StartOfRound.Instance.allPlayerScripts[value].playerUsername; PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[value]; if (val.isPlayerDead) { Log.LogInfo((object)$"Player #{value} ({playerUsername}) tried to pickup an object while they are dead on the server."); ClientRpcParams clientRpcParams = new ClientRpcParams { Send = new ClientRpcSendParams { TargetClientIds = new <>z__ReadOnlySingleElementList(senderClientId) } }; HostFixesServerSendRpcs.Instance.GrabObjectClientRpc(grabValidated: false, grabbedObject, instance, clientRpcParams); return; } GameObject val2 = NetworkObjectReference.op_Implicit(grabbedObject); if ((Object)(object)val2 == (Object)null) { Log.LogInfo((object)$"Player #{value} ({playerUsername}) sent a network object that does not exist. ({((NetworkObjectReference)(ref grabbedObject)).NetworkObjectId})"); } else if (!configLimitGrabDistance.Value) { instance.GrabObjectServerRpc(grabbedObject); } else { GrabbableObject val3 = default(GrabbableObject); if (!val2.TryGetComponent(ref val3)) { return; } if (val3.isHeld && (Object)(object)val3.playerHeldBy != (Object)null && (Object)(object)val3.playerHeldBy != (Object)(object)val) { Log.LogInfo((object)($"Player #{value} ({playerUsername}) tried to pickup an object held by someone else " + "(" + val3.playerHeldBy.playerUsername + "). Syncing (" + ((Object)val3).name + ")")); ClientRpcParams clientRpcParams2 = new ClientRpcParams { Send = new ClientRpcSendParams { TargetClientIds = new <>z__ReadOnlySingleElementList(senderClientId) } }; HostFixesServerSendRpcs.Instance.GrabObjectClientRpc(grabValidated: false, grabbedObject, instance, clientRpcParams2); ((MonoBehaviour)Instance).StartCoroutine(Call_GrabObjectClientRpc_AfterOneFrame(grabValidated: true, grabbedObject, val3.playerHeldBy, clientRpcParams2)); } else if (configLimitTwoHandedItemPickup.Value && val3.itemProperties.twoHanded && instance.ItemSlots.Any((GrabbableObject item) => (Object)(object)item != (Object)null && item.itemProperties.twoHanded)) { Log.LogInfo((object)$"Player #{value} ({playerUsername}) tried to pickup an extra two-handed object ({((Object)val3).name}"); ClientRpcParams clientRpcParams3 = new ClientRpcParams { Send = new ClientRpcSendParams { TargetClientIds = new <>z__ReadOnlySingleElementList(senderClientId) } }; HostFixesServerSendRpcs.Instance.GrabObjectClientRpc(grabValidated: false, grabbedObject, instance, clientRpcParams3); } else { float num = Vector3.Distance(val2.transform.position, ((Component)val).transform.position); bool flag = (Object)(object)val2.GetComponent() == (Object)null; if (instance.isInHangarShipRoom && val3.isInShipRoom) { instance.GrabObjectServerRpc(grabbedObject); } else if (num > instance.grabDistance + 7f && flag) { Log.LogInfo((object)($"Player #{value} ({playerUsername}) " + $"Object ({((Object)val2).name}) pickup distance ({num}) is too far away. Could be desync.")); ClientRpcParams clientRpcParams4 = new ClientRpcParams { Send = new ClientRpcSendParams { TargetClientIds = new <>z__ReadOnlySingleElementList(senderClientId) } }; HostFixesServerSendRpcs.Instance.GrabObjectClientRpc(grabValidated: false, grabbedObject, instance, clientRpcParams4); } else { instance.GrabObjectServerRpc(grabbedObject); } } } } public void EquipItemServerRpc(GrabbableObject instance, __RpcParams RpcParams) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //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) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[EquipItemServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); return; } PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[value]; if (!val.isPlayerDead) { if (!val.ItemSlots.Contains(instance)) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) equipped item is not in ItemSlots. {((Object)instance).name}"); } else { instance.EquipItemServerRpc(); } } } public void ThrowObjectServerRpc(NetworkObjectReference grabbedObject, bool droppedInElevator, bool droppedInShipRoom, Vector3 targetFloorPosition, int floorYRot, PlayerControllerB instance, __RpcParams RpcParams) { //IL_0000: 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_006e: Unknown result type (might be due to invalid IL or missing references) //IL_004f: 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_008f: 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_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0154: 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) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[ThrowObjectServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); return; } if (!configExperimentalChanges.Value) { instance.ThrowObjectServerRpc(grabbedObject, droppedInElevator, droppedInShipRoom, targetFloorPosition, floorYRot); return; } string playerUsername = StartOfRound.Instance.allPlayerScripts[value].playerUsername; GameObject val = NetworkObjectReference.op_Implicit(grabbedObject); if ((Object)(object)val == (Object)null) { Log.LogInfo((object)$"Player #{value} ({playerUsername}) tried to throw an object that doesn't exist. ({grabbedObject.m_NetworkObjectId})"); return; } StunGrenadeItem val2 = default(StunGrenadeItem); if (val.TryGetComponent(ref val2)) { instance.ThrowObjectServerRpc(grabbedObject, droppedInElevator, droppedInShipRoom, targetFloorPosition, floorYRot); return; } GrabbableObject val3 = default(GrabbableObject); if (!val.TryGetComponent(ref val3)) { Log.LogInfo((object)$"Player #{value} ({playerUsername}) tried to throw an object that isn't a GrabbleObject. ({((Object)val).name})"); return; } Vector3 itemFloorPosition = val3.GetItemFloorPosition(default(Vector3)); Vector3 val4; Vector3 val5; if (droppedInElevator) { val4 = instance.playersManager.elevatorTransform.TransformPoint(targetFloorPosition); val5 = instance.playersManager.elevatorTransform.InverseTransformPoint(itemFloorPosition); } else { val4 = instance.playersManager.propsContainer.TransformPoint(targetFloorPosition); val5 = instance.playersManager.propsContainer.InverseTransformPoint(itemFloorPosition); } float num = Vector3.Distance(new Vector3(itemFloorPosition.x, itemFloorPosition.z, 0f), new Vector3(val4.x, val4.z, 0f)); if (num > instance.grabDistance + 7f) { Log.LogInfo((object)$"Player #{value} ({playerUsername}) tried to throw an object to far away. ({num}) ({((Object)val).name})"); instance.ThrowObjectServerRpc(grabbedObject, instance.isInElevator, instance.isInHangarShipRoom, val5, floorYRot); } else { instance.ThrowObjectServerRpc(grabbedObject, droppedInElevator, droppedInShipRoom, targetFloorPosition, floorYRot); } } public void PlaceObjectServerRpc(NetworkObjectReference grabbedObject, NetworkObjectReference parentObject, Vector3 placePositionOffset, bool matchRotationOfParent, PlayerControllerB instance, __RpcParams RpcParams) { //IL_0000: 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_006e: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //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) //IL_019e: 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_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_032b: Unknown result type (might be due to invalid IL or missing references) //IL_032c: Unknown result type (might be due to invalid IL or missing references) //IL_032d: Unknown result type (might be due to invalid IL or missing references) //IL_027c: Unknown result type (might be due to invalid IL or missing references) //IL_028b: Unknown result type (might be due to invalid IL or missing references) //IL_0294: Unknown result type (might be due to invalid IL or missing references) //IL_022c: Unknown result type (might be due to invalid IL or missing references) //IL_0300: Unknown result type (might be due to invalid IL or missing references) //IL_030f: 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) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[ThrowObjectServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); return; } if (!configExperimentalChanges.Value) { instance.PlaceObjectServerRpc(grabbedObject, parentObject, placePositionOffset, matchRotationOfParent); return; } PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[value]; string playerUsername = val.playerUsername; GameObject val2 = NetworkObjectReference.op_Implicit(grabbedObject); if ((Object)(object)val2 == (Object)null) { Log.LogInfo((object)$"Player #{value} ({playerUsername}) sent a grabbed item that doesn't exist ({((NetworkObjectReference)(ref grabbedObject)).NetworkObjectId})"); return; } GameObject val3 = NetworkObjectReference.op_Implicit(parentObject); if ((Object)(object)val3 == (Object)null) { Log.LogInfo((object)$"Player #{value} ({playerUsername}) sent a parent object that doesn't exist ({((NetworkObjectReference)(ref parentObject)).NetworkObjectId})"); return; } GrabbableObject val4 = default(GrabbableObject); if (!val2.TryGetComponent(ref val4)) { Log.LogInfo((object)$"Player #{value} ({playerUsername}) tried to place an object that isn't a grabbable object ({((Object)val2).name})"); return; } if (val4.isHeld && (Object)(object)val4.playerHeldBy != (Object)null && (Object)(object)val4.playerHeldBy != (Object)(object)val) { Log.LogInfo((object)$"Player #{value} ({playerUsername}) tried to place an object held by someone else. ({((Object)val4).name}) ({val4.playerHeldBy})"); return; } float num = Vector3.Distance(((Component)instance).transform.position, val3.transform.position); Vector3 itemFloorPosition = val4.GetItemFloorPosition(default(Vector3)); Vector3 val5 = ((!instance.isInElevator) ? instance.playersManager.propsContainer.InverseTransformPoint(itemFloorPosition) : instance.playersManager.elevatorTransform.InverseTransformPoint(itemFloorPosition)); DepositItemsDesk val6 = default(DepositItemsDesk); if (num > instance.grabDistance + 7f) { if (itemFloorPosition == ((Component)instance).transform.position) { Log.LogInfo((object)$"Player #{value} ({playerUsername}) tried to place an object too far away and it didn't fall. {((Object)val4).name} {itemFloorPosition}"); } Log.LogInfo((object)$"Player #{value} ({playerUsername}) tried to place an object too far away. ({(int)num}) ({((Object)val4).name})"); instance.ThrowObjectServerRpc(grabbedObject, instance.isInElevator, instance.isInHangarShipRoom, val5, (int)((Component)instance).transform.localEulerAngles.y); } else if ((Object)(object)val3.transform.parent != (Object)null && ((Component)val3.transform.parent).TryGetComponent(ref val6) && ((Component)val6.deskObjectsContainer).GetComponentsInChildren().Length >= 150) { Log.LogInfo((object)$"Player #{value} ({playerUsername}) tried to place extra items on the company desk."); instance.ThrowObjectServerRpc(grabbedObject, instance.isInElevator, instance.isInHangarShipRoom, val5, (int)((Component)instance).transform.localEulerAngles.y); } else { instance.PlaceObjectServerRpc(grabbedObject, parentObject, placePositionOffset, matchRotationOfParent); } } public void AddObjectToDeskServerRpc(NetworkObjectReference grabbableObjectNetObject, DepositItemsDesk instance, __RpcParams RpcParams) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //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_0068: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[ThrowObjectServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); return; } if (!configExperimentalChanges.Value) { instance.AddObjectToDeskServerRpc(grabbableObjectNetObject); return; } PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[value]; string playerUsername = val.playerUsername; GameObject val2 = NetworkObjectReference.op_Implicit(grabbableObjectNetObject); if ((Object)(object)val2 == (Object)null) { Log.LogInfo((object)$"Player #{value} ({playerUsername}) sent a grabbable object that doesn't exist. ({((NetworkObjectReference)(ref grabbableObjectNetObject)).NetworkObjectId})"); } else if (!(Vector3.Distance(((Component)val).transform.position, ((Component)instance.deskObjectsContainer).transform.position) > val.grabDistance + 7f)) { GrabbableObject val3 = default(GrabbableObject); if (((Component)instance.deskObjectsContainer).GetComponentsInChildren().Length >= 150) { Log.LogInfo((object)$"Player #{value} ({playerUsername}) tried to add extra items to the company desk."); } else if (!val2.TryGetComponent(ref val3)) { Log.LogInfo((object)$"Player #{value} ({playerUsername}) tried to add an object to the desk that isn't a grabbable object ({((Object)val2).name})"); } else if (val3.isHeld && (Object)(object)val3.playerHeldBy != (Object)(object)val) { Log.LogInfo((object)$"Player #{value} ({playerUsername}) tried to add an object to the desk held by someone else. ({((Object)val3).name})"); } else { instance.AddObjectToDeskServerRpc(grabbableObjectNetObject); } } } public void SetTimesHeardNoiseServerRpc(float valueChange, DepositItemsDesk instance, __RpcParams RpcParams) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //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) if (RpcParams.Server.Receive.SenderClientId == 0L) { instance.SetTimesHeardNoiseServerRpc(valueChange * (float)(StartOfRound.Instance.connectedPlayersAmount + 1)); } } public void SetPatienceServerRpc(float valueChange, DepositItemsDesk instance, __RpcParams RpcParams) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //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) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var _)) { Log.LogError((object)$"[SetPatienceServerRpc] Failed to get the playerId from clientId: {senderClientId}"); } else if (senderClientId == 0L) { instance.SetPatienceServerRpc(valueChange * (float)(StartOfRound.Instance.connectedPlayersAmount + 1)); } } public void SetShipLightsServerRpc(bool setLightsOn, ShipLights instance, __RpcParams RpcParams) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //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_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[SetShipLightsServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); } else if (senderClientId == 0L) { StartOfRound.Instance.shipRoomLights.SetShipLightsServerRpc(setLightsOn); } else { if (shipLightsOnCooldown) { return; } ((MonoBehaviour)Instance).StartCoroutine(ShipLightsCooldown()); string playerUsername = StartOfRound.Instance.allPlayerScripts[value].playerUsername; PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[value]; if (val.isPlayerDead) { Log.LogInfo((object)$"Player #{value} ({playerUsername}) tried to toggle ship lights while they are dead on the server."); return; } float num = Vector3.Distance(((Component)instance).transform.position, ((Component)val).transform.position); if (num > 20f && !val.ItemSlots.Any((GrabbableObject item) => (Object)(object)item != (Object)null && new Func(((Component)item).GetComponent) != null)) { Log.LogInfo((object)$"Player #{value} ({playerUsername}) tried to toggle ship lights without a remote from too faw away. ({num})"); } else { instance.SetShipLightsServerRpc(setLightsOn); } } } public void UseSignalTranslatorServerRpc(string signalMessage, HUDManager instance, __RpcParams RpcParams) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //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_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[UseSignalTranslatorServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); return; } PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[value]; string playerUsername = val.playerUsername; if (StartOfRound.Instance.allPlayerScripts[value].isPlayerDead) { Log.LogInfo((object)($"Player #{value} ({playerUsername}) tried to send a Signal Translator message while they are dead on the server." + " Message: (" + signalMessage + ")")); return; } if (configLogSignalTranslatorMessages.Value) { Log.LogInfo((object)$"Player #{value} ({playerUsername}) sent signal translator message: ({signalMessage})"); } if (Vector3.Distance(((Component)Object.FindObjectOfType()).transform.position, ((Component)val).transform.position) > 20f) { Log.LogInfo((object)$"Player #{value} ({playerUsername}) tried to send signal translator message to far away from terminal."); } else { instance.UseSignalTranslatorServerRpc(signalMessage); } } public void TeleportPlayerServerRpc(int playerObj, EntranceTeleport instance, __RpcParams RpcParams) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //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_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[TeleportPlayerServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); return; } if (senderClientId == 0L) { instance.TeleportPlayerServerRpc(playerObj); return; } PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[value]; if (playerObj != value) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) tried to teleport another player using an entrance teleport)"); return; } float num = Vector3.Distance(instance.entrancePoint.position, ((Component)val).transform.position); if (num > 10f) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) too far away from entrance to teleport ({num})"); return; } Transform entrancePoint = instance.exitScript.entrancePoint; if (!instance.gotExitPoint) { instance.FindExitPoint(); entrancePoint = instance.exitScript.entrancePoint; } playerPositions[(ulong)value] = entrancePoint.position; instance.TeleportPlayerServerRpc(playerObj); } public void PressTeleportButtonServerRpc(ShipTeleporter instance, __RpcParams RpcParams) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //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_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[PressTeleportButtonServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); } else { if (pressTeleportButtonOnCooldown.Contains(instance)) { return; } ((MonoBehaviour)Instance).StartCoroutine(PressTeleportButtonCooldown(instance)); if (senderClientId == 0L) { instance.PressTeleportButtonServerRpc(); return; } PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[value]; if (val.isPlayerDead) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) tried to press teleporter button while they are dead on the server."); return; } float num = Vector3.Distance(((Component)val).transform.position, ((Component)instance.buttonTrigger).transform.position); if ((float)configLimitTeleporterButtonDistance.Value > 1f && num > (float)configLimitTeleporterButtonDistance.Value) { Log.LogInfo((object)($"Player #{value} ({val.playerUsername}) tried to press teleporter button from too far away " + $"({num})")); } else { instance.PressTeleportButtonServerRpc(); } } } public void TeleportPlayerOutServerRpc(int playerObj, Vector3 teleportPos, ShipTeleporter instance, __RpcParams RpcParams) { //IL_0000: 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_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[TeleportPlayerOutServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); return; } if (playerObj != value) { Log.LogInfo((object)$"[TeleportPlayerOutServerRpc] playerObj ({playerObj}) != senderPlayerId ({value})"); } PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[value]; playerPositions[val.playerClientId] = ((Component)val).transform.localPosition; instance.TeleportPlayerOutServerRpc(playerObj, teleportPos); } public void UpdatePlayerPositionRpc(Vector3 newPos, bool inElevator, bool inShipRoom, bool exhausted, bool isPlayerGrounded, PlayerControllerB instance, __RpcParams RpcParams) { //IL_0000: 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_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0101: 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_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_014f: 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) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) ulong senderClientId = RpcParams.Ext.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[UpdatePlayerPositionRpc] Failed to get the playerId from senderClientId: {senderClientId}"); return; } if (instance.isPlayerDead) { allowedMovement[instance.playerClientId] = false; return; } Vector3 val = (inElevator ? ((Component)instance).transform.localPosition : ((Component)instance).transform.position); if (!onShip.TryGetValue(instance.playerClientId, out var value2) || value2 != inElevator) { playerPositions[instance.playerClientId] = val; positionCacheUpdateTime[instance.playerClientId] = Time.time; onShip[instance.playerClientId] = inElevator; } PlayerControllerB val2 = StartOfRound.Instance.allPlayerScripts[value]; if (configExperimentalPositionCheck.Value && !StartOfRound.Instance.suckingPlayersOutOfShip && !StartOfRound.Instance.inShipPhase) { Vector3 val3 = newPos - val; if (!(Vector3.Dot(((Vector3)(ref val3)).normalized, Vector3.down) > 0.3f)) { if (Vector3.Distance(newPos, playerPositions[instance.playerClientId]) > 150f) { InfoPanel.Instance.Log($"Player #{value} ({val2.playerUsername}) UpdatePlayerPositionRpc {Vector3.Distance(newPos, playerPositions[instance.playerClientId])}"); allowedMovement[instance.playerClientId] = false; } else { allowedMovement[instance.playerClientId] = true; instance.UpdatePlayerPositionRpc(newPos, inElevator, inShipRoom, exhausted, isPlayerGrounded); } return; } } instance.UpdatePlayerPositionRpc(newPos, inElevator, inShipRoom, exhausted, isPlayerGrounded); allowedMovement[instance.playerClientId] = true; } public void UpdatePlayerRotationServerRpc(short newRot, short newYRot, PlayerControllerB instance, ServerRpcParams _) { if (!allowedMovement.ContainsKey(instance.playerClientId) || allowedMovement[instance.playerClientId]) { instance.UpdatePlayerRotationServerRpc(newRot, newYRot); } } public void UpdatePlayerRotationFullServerRpc(Vector3 playerEulers, Vector3 cameraRotation, bool syncingCameraRotation, PlayerControllerB instance, ServerRpcParams _) { //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) if (!allowedMovement.ContainsKey(instance.playerClientId) || allowedMovement[instance.playerClientId]) { instance.UpdatePlayerRotationFullServerRpc(playerEulers, cameraRotation, syncingCameraRotation); } } public void UpdatePlayerAnimationServerRpc(int animationState, float animationSpeed, PlayerControllerB instance, ServerRpcParams _) { if (allowedMovement.ContainsKey(instance.playerClientId) && !allowedMovement[instance.playerClientId]) { for (int i = 0; i < instance.playerBodyAnimator.layerCount; i++) { if (instance.playerBodyAnimator.HasState(i, -1437577361)) { return; } } instance.UpdatePlayerAnimationServerRpc(-1437577361, -1f); } else { instance.UpdatePlayerAnimationServerRpc(animationState, animationSpeed); } } public void UpdateUsedByPlayerServerRpc(int playerNum, InteractTrigger instance, __RpcParams RpcParams) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //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_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[UpdateUsedByPlayerServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); return; } if (senderClientId == 0L) { instance.UpdateUsedByPlayerServerRpc(playerNum); return; } PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[value]; if (playerNum != value) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) tried to call UpdateUsedByPlayerServerRpc from another player. ({playerNum})"); return; } float num = Vector3.Distance(((Component)instance).transform.position, ((Component)val).transform.position); if (num > val.grabDistance + 7f) { Log.LogInfo((object)($"Player #{value} ({val.playerUsername}) interacted with " + "(" + (((Object)(object)((Component)instance).transform.parent != (Object)null) ? ((Object)((Component)instance).transform.parent).name : ((Object)instance).name) + ") " + $"from too far away. ({num})")); } instance.UpdateUsedByPlayerServerRpc(value); } public void StopUsingServerRpc(int playerUsing, InteractTrigger instance, __RpcParams RpcParams) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //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) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[StopUsingServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); } else if (senderClientId == 0L) { instance.StopUsingServerRpc(playerUsing); } else if (playerUsing != value) { Log.LogInfo((object)$"[StopUsingServerRpc] playerUsing ({playerUsing}) != senderPlayerId ({value})"); } else { instance.StopUsingServerRpc(playerUsing); } } public void UpdateAnimServerRpc(bool setBool, bool playSecondaryAudios, int playerWhoTriggered, AnimatedObjectTrigger instance, __RpcParams RpcParams) { //IL_0008: 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_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02b4: Unknown result type (might be due to invalid IL or missing references) //IL_02c7: Unknown result type (might be due to invalid IL or missing references) //IL_02c9: Unknown result type (might be due to invalid IL or missing references) //IL_02ce: Unknown result type (might be due to invalid IL or missing references) //IL_02d0: Unknown result type (might be due to invalid IL or missing references) //IL_02e2: Unknown result type (might be due to invalid IL or missing references) Transform val = ((Component)instance).transform; ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[UpdateAnimServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); return; } if (senderClientId == 0L) { instance.UpdateAnimServerRpc(setBool, playSecondaryAudios, playerWhoTriggered); return; } PlayerControllerB val2 = StartOfRound.Instance.allPlayerScripts[value]; if (playerWhoTriggered != value && playerWhoTriggered != -1) { Log.LogInfo((object)("[UpdateAnimServerRpc] " + $"Player #{value} ({val2.playerUsername}) tried to spoof updating an animator from another player. " + $"({(((Object)(object)instance.triggerAnimator != (Object)null) ? ((Object)instance.triggerAnimator).name : ((Object)instance).name)}) (#{playerWhoTriggered}) ")); return; } if (val2.isPlayerDead && (Object)(object)instance.triggerAnimator != (Object)null && ((Object)instance.triggerAnimator).name != "ElectricChair") { Log.LogInfo((object)($"Player #{value} ({val2.playerUsername}) " + "tried to interact with an animated object (" + (((Object)(object)instance.triggerAnimator != (Object)null) ? ((Object)instance.triggerAnimator).name : ((Object)instance).name) + ") while they are dead on the server.")); return; } if ((Object)(object)instance.triggerAnimator != (Object)null && ((Object)instance.triggerAnimator).name == "MagnetLever") { if (StartOfRound.Instance.inShipPhase) { Log.LogInfo((object)$"Player #{value} ({val2.playerUsername}) tried to pull magnet lever while ship is in space."); return; } Log.LogInfo((object)$"Player #{value} ({val2.playerUsername}) toggled magnet"); } if ((((Object)(object)instance.triggerAnimator != (Object)null) ? ((Object)instance.triggerAnimator).name : ((Object)instance).name).StartsWith("GarageDoorContainer")) { val = ((Component)instance).transform.Find("LeverSwitchContainer"); } float num = Vector3.Distance(val.position, ((Component)val2).transform.position); if (num > val2.grabDistance + 7f) { Log.LogInfo((object)($"Player #{value} ({val2.playerUsername}) tried to interact with " + "(" + (((Object)(object)instance.triggerAnimator != (Object)null) ? ((Object)instance.triggerAnimator).name : ((Object)instance).name) + ") from too far away" + $" ({num})")); ClientRpcParams clientRpcParams = new ClientRpcParams { Send = new ClientRpcSendParams { TargetClientIds = new <>z__ReadOnlySingleElementList(senderClientId) } }; HostFixesServerSendRpcs.Instance.UpdateAnimClientRpc(instance.boolValue, playSecondaryAudios, playerWhoTriggered, instance, clientRpcParams); } else { instance.UpdateAnimServerRpc(setBool, playSecondaryAudios, playerWhoTriggered); } } public void UpdateAnimTriggerServerRpc(AnimatedObjectTrigger instance, __RpcParams RpcParams) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //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_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[UpdateAnimTriggerServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); return; } if (senderClientId == 0L) { instance.UpdateAnimTriggerServerRpc(); return; } PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[value]; if (val.isPlayerDead) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) tried to send UpdateAnimTriggerServerRpc while dead."); return; } if (instance.isBool) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) tried to send UpdateAnimTriggerServerRpc while isBool is true."); return; } float num = Vector3.Distance(((Component)instance).transform.position, ((Component)val).transform.position); if (num > val.grabDistance + 7f) { Log.LogInfo((object)($"Player #{value} ({val.playerUsername}) tried to interact with " + "(" + (((Object)(object)instance.triggerAnimator != (Object)null) ? ((Object)instance.triggerAnimator).name : ((Object)instance).name) + ") " + $"from too far away ({num}) parent: ({((Object)((Component)instance).transform.parent).name})")); ClientRpcParams clientRpcParams = new ClientRpcParams { Send = new ClientRpcSendParams { TargetClientIds = new <>z__ReadOnlySingleElementList(senderClientId) } }; HostFixesServerSendRpcs.Instance.UpdateAnimTriggerClientRpc(instance, clientRpcParams); ((MonoBehaviour)Instance).StartCoroutine(Call_UpdateAnimTriggerClientRpc_AfterOneFrame(instance, clientRpcParams)); } else { instance.UpdateAnimTriggerServerRpc(); } } public void SyncAllPlayerLevelsServerRpc(int newPlayerLevel, int playerClientId, HUDManager instance, __RpcParams RpcParams) { //IL_0000: 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) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[SyncAllPlayerLevelsServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); return; } PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[value]; if (playerClientId != value) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) tried to temporarily set another players level."); } else { instance.SyncAllPlayerLevelsServerRpc(newPlayerLevel, value); } } public void StartGameServerRpc(StartOfRound instance, __RpcParams RpcParams) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //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_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[StartGameServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); return; } if (startGameOnCoolown.TryGetValue(value, out var value2) && value2) { ((MonoBehaviour)Instance).StartCoroutine(StartGameCooldown(value)); return; } PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[value]; if (val.isPlayerDead) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) tried to start the game while they are dead on the server."); return; } float num = Vector3.Distance(((Component)Object.FindFirstObjectByType()).transform.position, ((Component)val).transform.position); if ((float)configLimitShipLeverDistance.Value > 1f && num > (float)configLimitShipLeverDistance.Value) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) tried to start the game while too far away ({num})."); } else if (!GameNetworkManager.Instance.gameHasStarted) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) tried to force start the game."); } else { instance.StartGameServerRpc(); } } public void PlayLeverPullEffectsServerRpc(bool leverPulled, StartMatchLever instance, __RpcParams RpcParams) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //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_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: 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_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[PlayLeverPullEffectsServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); return; } if (senderClientId == 0L) { instance.PlayLeverPullEffectsServerRpc(leverPulled); return; } if (shipLeverAnimationOnCooldown.TryGetValue(value, out var value2) && value2) { ((MonoBehaviour)Instance).StartCoroutine(ShipLeverAnimationCooldown(value)); return; } PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[value]; if (val.isPlayerDead) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) tried to pull ship lever while they are dead on the server."); return; } float num = Vector3.Distance(((Component)instance).transform.position, ((Component)val).transform.position); if ((float)configLimitShipLeverDistance.Value > 1f && num > (float)configLimitShipLeverDistance.Value) { ClientRpcParams clientRpcParams = new ClientRpcParams { Send = new ClientRpcSendParams { TargetClientIds = new <>z__ReadOnlySingleElementList(senderClientId) } }; instance.triggerScript.interactable = true; HostFixesServerSendRpcs.Instance.PlayLeverPullEffectsClientRpc(leverPulled, instance, clientRpcParams); } else { instance.PlayLeverPullEffectsServerRpc(leverPulled); } } public void SyncAlreadyHeldObjectsServerRpc(int joiningClientId, StartOfRound instance, __RpcParams RpcParams) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //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) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[SyncAlreadyHeldObjectsServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); return; } PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[value]; if ((ulong)joiningClientId != senderClientId) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) tried spoofing SyncAlreadyHeldObjectsServerRpc on another player."); } else { instance.SyncAlreadyHeldObjectsServerRpc((int)senderClientId); } } public void CheckAnimationGrabPlayerServerRpc(int monsterAnimationID, int playerID, DepositItemsDesk instance, __RpcParams RpcParams) { //IL_0000: 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) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[CheckAnimationGrabPlayerServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); return; } PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[value]; if (playerID != value) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) tried spoofing CheckAnimationGrabPlayerServerRpc on another player."); } else { instance.CheckAnimationGrabPlayerServerRpc(monsterAnimationID, playerID); } } public void AttackPlayersServerRpc(DepositItemsDesk instance, __RpcParams RpcParams) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //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) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[AttackPlayersServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); return; } PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[value]; if (senderClientId != 0L) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) tried calling AttackPlayersServerRpc."); } else { instance.AttackPlayersServerRpc(); } } public void ChangeEnemyOwnerServerRpc(ulong clientId, EnemyAI instance, __RpcParams RpcParams) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //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_007f: Unknown result type (might be due to invalid IL or missing references) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[ChangeEnemyOwnerServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); return; } if (senderClientId == 0L || (((NetworkBehaviour)instance).NetworkObject.OwnerClientId == senderClientId && clientId != senderClientId)) { instance.ChangeEnemyOwnerServerRpc(clientId); return; } PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[value]; if (!val.isPlayerDead && val.isInsideFactory == ((Component)instance).transform.position.y < -80f) { instance.ChangeEnemyOwnerServerRpc(clientId); } } public void UpdateEnemyPositionRpc(Vector3 newPos, EnemyAI instance, __RpcParams RpcParams) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //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_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) ulong senderClientId = RpcParams.Ext.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var _)) { Log.LogError((object)$"[UpdateEnemyPositionRpc] Failed to get the playerId from senderClientId: {senderClientId}"); return; } float num = Vector3.Distance(newPos, ((Component)instance).transform.position); if (!configExperimentalChanges.Value) { instance.UpdateEnemyPositionRpc(newPos); } else if (num > instance.updatePositionThreshold + 5f && !Physics.Raycast(((Component)instance).transform.position, Vector3.down, 20f)) { instance.ChangeOwnershipOfEnemy(0uL); } else { instance.UpdateEnemyPositionRpc(newPos); } } public void ActivateItemRpc(bool onOff, bool buttonDown, GrabbableObject instance, __RpcParams RpcParams) { //IL_0000: 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) ulong senderClientId = RpcParams.Ext.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[ActivateItemServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); } else { if (itemOnCooldown.Contains(((NetworkBehaviour)instance).NetworkObjectId)) { return; } PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[value]; if ((Object)(object)instance.playerHeldBy == (Object)null) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) tried to activate an item that is not held by anyone."); } else if ((Object)(object)instance.playerHeldBy != (Object)(object)val) { Log.LogInfo((object)($"Player #{value} ({val.playerUsername}) tried to activate item held by another player." + " (" + ((Object)instance).name + ") (" + instance.playerHeldBy.playerUsername + ")")); } else { RemoteProp val2 = default(RemoteProp); NoisemakerProp val3 = default(NoisemakerProp); KnifeItem val4 = default(KnifeItem); if (((Component)instance).TryGetComponent(ref val2) || ((Component)instance).TryGetComponent(ref val3) || ((Component)instance).TryGetComponent(ref val4)) { ((MonoBehaviour)Instance).StartCoroutine(ActivateItemCooldown(((NetworkBehaviour)instance).NetworkObjectId)); } instance.ActivateItemRpc(onOff, buttonDown); } } } public void HitKnifeServerRpc(int hitSurfaceID, KnifeItem instance, ServerRpcParams _) { if (!knifeSoundCooldown.Contains(((NetworkBehaviour)instance).NetworkObjectId)) { ((MonoBehaviour)Instance).StartCoroutine(KnifeSoundCooldown(((NetworkBehaviour)instance).NetworkObjectId)); instance.HitShovelServerRpc(hitSurfaceID); } } public void HitEnemyServerRpc(int force, int playerWhoHit, bool playHitSFX, int hitID, EnemyAI instance, __RpcParams RpcParams) { //IL_0000: 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) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[HitEnemyServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); return; } PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[value]; if (playerWhoHit == -1 && senderClientId == 0L) { instance.HitEnemyClientRpc(force, playerWhoHit, playHitSFX, hitID); } else if (playerWhoHit != -1) { Shovel val2 = Object.FindFirstObjectByType((FindObjectsInactive)1); bool flag = true; if ((Object)(object)val2 != (Object)null) { flag = val2.shovelHitForce == 1; } if (force > 5 && flag) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) hit enemy with force greater than 5 ({force})"); instance.HitEnemyServerRpc(1, value, playHitSFX, hitID); } else { instance.HitEnemyServerRpc(force, value, playHitSFX, hitID); } } } public void KillEnemyServerRpc(bool destroy, EnemyAI instance, __RpcParams RpcParams) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //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_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[KillEnemyServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); return; } if (senderClientId == 0L) { instance.KillEnemyServerRpc(destroy); return; } CentipedeAI val = default(CentipedeAI); if (((Component)instance).TryGetComponent(ref val)) { instance.KillEnemyServerRpc(destroy); return; } PlayerControllerB val2 = StartOfRound.Instance.allPlayerScripts[value]; if (instance.enemyHP > 0 && Vector3.Distance(((Component)val2).transform.position, ((Component)instance).transform.position) > 15f) { Log.LogInfo((object)$"Player #{value} ({val2.playerUsername}) tried killing enemy without lowering their hp while too far away. ({((Object)instance).name})"); } else if (destroy && senderClientId != 0L) { Log.LogInfo((object)$"Player #{value} ({val2.playerUsername}) tried to destroy enemy. ({((Object)instance).name})"); } else { instance.KillEnemyServerRpc(destroy); } } public void SetMagnetOnServerRpc(bool on, StartOfRound instance, __RpcParams RpcParams) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //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_0053: 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) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[SetMagnetOnServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); return; } PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[value]; float num = Vector3.Distance(((Component)val).transform.position, ((Component)instance.magnetLever).transform.position); if (num > val.grabDistance + 7f) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) tried to toggle magnet from to far away. ({num})"); } else if (StartOfRound.Instance.inShipPhase && !on) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) tried to turn off magnet while ship is in space."); } else { instance.SetMagnetOnServerRpc(on); } } public void BuyVehicleServerRpc(int vehicleID, int newGroupCredits, bool useWarranty, Terminal instance, __RpcParams RpcParams) { //IL_0000: 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) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[BuyVehicleServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); return; } PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[value]; if (senderClientId == 0L) { instance.BuyVehicleServerRpc(vehicleID, newGroupCredits, useWarranty); return; } if (!configCheckPrices.Value) { instance.BuyVehicleServerRpc(vehicleID, newGroupCredits, useWarranty); return; } if (vehicleCosts.Count == 0) { vehicleCosts = (from noun in instance.terminalNodes.allKeywords.First((TerminalKeyword keyword) => ((Object)keyword).name == "Buy").compatibleNouns where noun.result.buyVehicleIndex != -1 group noun by noun.result.buyItemIndex into noun select noun.First()).ToDictionary((CompatibleNoun vehicleNoun) => vehicleNoun.result.buyVehicleIndex, (CompatibleNoun vehicleNoun) => vehicleNoun.result.itemCost); } if (newGroupCredits < 0) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) tried tried to set credits to a negative number."); return; } if (!vehicleCosts.ContainsKey(vehicleID)) { Log.LogInfo((object)($"Player #{value} ({val.playerUsername}) tried to buy a vehicle that is not in the buyable vehicles list. " + $"(vehicleID: {vehicleID})")); return; } int num = (int)((float)vehicleCosts[vehicleID] * ((float)instance.itemSalesPercentages[vehicleID + instance.buyableItemsList.Length] / 100f)); int num2 = instance.groupCredits - newGroupCredits; if (num != num2 && !instance.hasWarrantyTicket) { Log.LogInfo((object)($"Player #{value} ({val.playerUsername}) credits spent does not equal cost of vehicle. " + $"Current credits: {instance.groupCredits} Vehicle cost: {num} Spent: {num2}.")); } else { instance.BuyVehicleServerRpc(vehicleID, newGroupCredits, useWarranty); } } public void RemoveKeyFromIgnitionServerRpc(int driverId, VehicleController instance, __RpcParams RpcParams) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //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) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[RemoveKeyFromIgnitionServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); return; } PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[value]; if (driverId != value) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) tried spoofing RemoveKeyFromIgnitionServerRpc on another player. ({driverId})"); } else { instance.RemoveKeyFromIgnitionServerRpc(value); } } public void RevCarServerRpc(int driverId, VehicleController instance, __RpcParams RpcParams) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //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) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[RevCarServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); return; } PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[value]; if (driverId != value) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) tried spoofing RevCarServerRpc on another player. ({driverId})"); } else { instance.RevCarServerRpc(value); } } public void StartIgnitionServerRpc(int driverId, VehicleController instance, __RpcParams RpcParams) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //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) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[StartIgnitionServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); return; } PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[value]; if (driverId != value) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) tried spoofing StartIgnitionServerRpc on another player. ({driverId})"); } else { instance.StartIgnitionServerRpc(value); } } public void CancelTryIgnitionServerRpc(int driverId, bool setKeyInSlot, VehicleController instance, __RpcParams RpcParams) { //IL_0000: 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) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[CancelTryIgnitionServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); return; } PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[value]; if (driverId != value) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) tried spoofing CancelTryIgnitionServerRpc on another player. ({driverId})"); } else { instance.CancelTryIgnitionServerRpc(value, setKeyInSlot); } } public void PassengerLeaveVehicleServerRpc(int playerId, Vector3 exitPoint, VehicleController instance, __RpcParams RpcParams) { //IL_0000: 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_007b: Unknown result type (might be due to invalid IL or missing references) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[PassengerLeaveVehicleServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); return; } PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[value]; if (playerId != value) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) tried spoofing PassengerLeaveVehicleServerRpc on another player. ({playerId})"); } else { instance.PassengerLeaveVehicleServerRpc(value, exitPoint); } } public void SetPlayerInControlOfVehicleServerRpc(int playerId, VehicleController instance, __RpcParams RpcParams) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //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) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[SetPlayerInControlOfVehicleServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); return; } PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[value]; if (playerId != value) { Log.LogInfo((object)($"Player #{value} ({val.playerUsername}) tried spoofing SetPlayerInControlOfVehicleServerRpc on another player. " + $"({playerId})")); } else { instance.SetPlayerInControlOfVehicleServerRpc(value); } } public void RemovePlayerControlOfVehicleServerRpc(int playerId, Vector3 carLocation, Quaternion carRotation, bool setKeyInIgnition, VehicleController instance, __RpcParams RpcParams) { //IL_0000: 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_008b: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[RemovePlayerControlOfVehicleServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); return; } PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[value]; if (playerId != value) { Log.LogInfo((object)($"Player #{value} ({val.playerUsername}) tried spoofing RemovePlayerControlOfVehicleServerRpc on another player. " + $"({playerId})")); } else { instance.RemovePlayerControlOfVehicleServerRpc(value, carLocation, carRotation, setKeyInIgnition); } } public void ShiftToGearServerRpc(int setGear, int playerId, VehicleController instance, __RpcParams RpcParams) { //IL_0000: 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_007f: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[ShiftToGearServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); return; } PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[value]; if (playerId != value) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) tried spoofing ShiftToGearServerRpc on another player. ({playerId})"); return; } float num = Vector3.Distance(((Component)val).transform.position, ((Component)instance).transform.position); if (num > 10f) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) tried to shift vehicle gear from too far away. ({num})"); return; } if (configLogVehicle.Value && (Object)(object)instance.currentDriver != (Object)null && (Object)(object)instance.currentDriver != (Object)(object)val) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) changed vehicle gear while not the driver. Gear: {(object)(CarGearShift)setGear}"); } instance.ShiftToGearServerRpc(setGear, value); } public void SetHonkServerRpc(bool honk, int playerId, VehicleController instance, __RpcParams RpcParams) { //IL_0000: 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) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[SetHonkServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); return; } PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[value]; if (playerId != value) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) tried spoofing SetHonkServerRpc on another player. ({playerId})"); } else if (StartOfRound.Instance.inShipPhase && !instance.honkingHorn) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) tried to honk horn in space."); } else { instance.SetHonkServerRpc(honk, value); } } public void SetRadioOnServerRpc(bool on, VehicleController instance, ServerRpcParams _) { if (!StartOfRound.Instance.inShipPhase) { instance.SetRadioOnServerRpc(on); } } public void SetRadioStationServerRpc(int radioStation, int signalQuality, VehicleController instance, __RpcParams RpcParams) { //IL_0000: 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) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[SetRadioStationServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); return; } PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[value]; if (radioStation < 0 || radioStation >= instance.radioClips.Length) { Log.LogInfo((object)($"Player #{value} ({val.playerUsername}) tried to set the radio to a station that doesn't exist. " + $"(radioStation: {radioStation})")); } else { instance.SetRadioStationServerRpc(radioStation, signalQuality); } } public void CarBumpServerRpc(Vector3 vel, VehicleController instance, __RpcParams RpcParams) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //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_0014: Unknown result type (might be due to invalid IL or missing references) if (RpcParams.Server.Receive.SenderClientId == 0L) { instance.CarBumpServerRpc(vel); } } public void CarCollisionServerRpc(Vector3 vel, float magn, VehicleController instance, __RpcParams RpcParams) { //IL_0000: 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_0015: Unknown result type (might be due to invalid IL or missing references) if (RpcParams.Server.Receive.SenderClientId == 0L) { instance.CarCollisionServerRpc(vel, magn); } } public void DestroyCarServerRpc(int sentByClient, VehicleController instance, __RpcParams RpcParams) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //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) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[DestroyCarServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); return; } PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[value]; if (sentByClient != value) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) tried spoofing DestroyCarServerRpc on another player. ({sentByClient})"); } else if (StartOfRound.Instance.inShipPhase) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) tried destroying the vehicle while ship is in space."); } else { instance.DestroyCarServerRpc(value); } } public void SpringDriverSeatServerRpc(VehicleController instance, __RpcParams RpcParams) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //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_0053: 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) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[SpringDriverSeatServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); return; } PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[value]; float num = Vector3.Distance(((Component)val).transform.position, ((Component)instance).transform.position); if (num > 10f) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) tried to eject driver out of vehicle from too far away. ({num})"); return; } if (configLogVehicle.Value && (Object)(object)instance.currentDriver != (Object)null && (Object)(object)instance.currentDriver != (Object)(object)val) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) ejected the driver out of the vehicle."); } instance.SpringDriverSeatServerRpc(); } public void PushTruckFromOwnerServerRpc(Vector3 pos, VehicleController instance, __RpcParams RpcParams) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //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_0058: Unknown result type (might be due to invalid IL or missing references) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var _)) { Log.LogError((object)$"[SpringDriverSeatServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); } else if (senderClientId == ((NetworkBehaviour)instance).OwnerClientId && !StartOfRound.Instance.inShipPhase) { instance.PushTruckFromOwnerServerRpc(pos); } } public void PushTruckServerRpc(Vector3 pos, Vector3 dir, VehicleController instance, ServerRpcParams _) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) if (!StartOfRound.Instance.inShipPhase) { instance.PushTruckServerRpc(pos, dir); } } public void CreateMimicServerRpc(bool inFactory, Vector3 playerPositionAtDeath, HauntedMaskItem instance, __RpcParams RpcParams) { //IL_0000: 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_00d4: Unknown result type (might be due to invalid IL or missing references) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[CreateMimicServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); return; } PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[value]; if (!val.isPlayerDead) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) tried to create mimic without dying."); return; } if ((Object)(object)instance.previousPlayerHeldBy != (Object)(object)val) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) tried to create mimic without holding mask."); return; } ((NetworkBehaviour)instance).NetworkObject.Despawn(true); Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) created a Mimic."); instance.CreateMimicServerRpc(inFactory, playerPositionAtDeath); } public void KillPlayerServerRpc(int playerId, bool spawnBody, Vector3 bodyVelocity, int causeOfDeath, int deathAnimation, Vector3 positionOffset, bool setOverrideDropItems, PlayerControllerB instance, __RpcParams RpcParams) { //IL_0000: 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_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[KillPlayerServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); return; } PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[value]; if (playerId != value) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) tried spoofing KillPlayerServerRpc for another player using masked enemy. ({playerId})"); } else { instance.KillPlayerServerRpc(playerId, spawnBody, bodyVelocity, causeOfDeath, deathAnimation, positionOffset, setOverrideDropItems); } } public void KillPlayerAnimationServerRpc(int playerObjectId, MaskedPlayerEnemy instance, __RpcParams RpcParams) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //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) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[KillPlayerAnimationServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); return; } PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[value]; if (playerObjectId != value) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) called KillPlayerAnimationServerRpc on another player."); } instance.KillPlayerAnimationServerRpc(value); } public void OpenDoorAsEnemyServerRpc(DoorLock instance, __RpcParams RpcParams) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //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) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[OpenDoorAsEnemyServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); return; } PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[value]; if (instance.isLocked) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) tried to open door as enemy on a locked door."); } else { instance.OpenDoorAsEnemyServerRpc(); } } public void CloseDoorNonPlayerServerRpc(DoorLock instance, __RpcParams RpcParams) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //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) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[OpenDoorAsEnemyServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); return; } PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[value]; if (instance.isLocked) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) tried to close door as enemy on a locked door."); } } public void EnterBerserkModeServerRpc(int playerWhoTriggered, Turret instance, __RpcParams RpcParams) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //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_008d: 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) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[EnterBerserkModeServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); return; } PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[value]; if (playerWhoTriggered != value) { Log.LogInfo((object)($"Player #{value} ({val.playerUsername}) tried to make a turret go beserk while spoofing another player. " + $"({playerWhoTriggered})")); return; } float num = Vector3.Distance(((Component)instance).transform.position, ((Component)val).transform.position); if (num > 10f) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) tried to make a turret go beserk from too far away. ({num})"); } else { instance.EnterBerserkModeServerRpc(value); } } public void PressMineServerRpc(Landmine instance, __RpcParams RpcParams) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //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_0053: 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) //IL_006f: 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) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[PressMineServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); return; } PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[value]; float num = Vector3.Distance(((Component)instance).transform.position, ((Component)val).transform.position); float num2 = Vector3.Distance(((Component)instance).transform.position, val.positionOfDeath); if (senderClientId == 0L) { instance.PressMineServerRpc(); } else if (!configExperimentalChanges.Value) { instance.PressMineServerRpc(); } else if (num > 10f && num2 > 10f) { Log.LogInfo((object)($"[Experimental] Player #{value} ({val.playerUsername}) tried to play landmine audio from too far away." + $" landmineDistance: ({num}) deathDistance:({num2})")); } else { instance.PressMineServerRpc(); } } public void ExplodeMineServerRpc(Landmine instance, __RpcParams RpcParams) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //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_0053: 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) //IL_006f: 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) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[ExplodeMineServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); return; } PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[value]; float num = Vector3.Distance(((Component)instance).transform.position, ((Component)val).transform.position); float num2 = Vector3.Distance(((Component)instance).transform.position, val.positionOfDeath); if (senderClientId == 0L) { instance.ExplodeMineServerRpc(); } else if (!configExperimentalChanges.Value) { instance.ExplodeMineServerRpc(); } else if (num > 10f && num2 > 10f) { Log.LogInfo((object)($"[Experimental] Player #{value} ({val.playerUsername}) tried to explode landmine from too far away." + $"landmineDistance: ({num}) deathDistance:({num2})")); } else { instance.ExplodeMineServerRpc(); } } public void PlayAudioServerRpc(ServerAudio serverAudio, GlobalEffects instance, __RpcParams RpcParams) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //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_004d: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: 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_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[PlayAudioServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); return; } PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[value]; GameObject val2 = NetworkObjectReference.op_Implicit(serverAudio.audioObj); Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) played GlobalEffect. {serverAudio}"); if (serverSoundCooldown.Contains(val)) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) tried to play global audio on cooldown. {serverAudio}"); return; } if ((Object)(object)val2 == (Object)null) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) serverAudio object was null. ({((NetworkObjectReference)(ref serverAudio.audioObj)).NetworkObjectId})"); return; } if ((Object)(object)val2 != (Object)(object)((Component)val).gameObject) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) played an global audio effect on another object. {((Object)val2).name}"); return; } if (Vector3.Distance(((Component)val).transform.position, val2.transform.position) > 10f) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) played a global audio effect from to far from them."); return; } ((MonoBehaviour)Instance).StartCoroutine(ServerAudioCooldown(val)); instance.PlayAudioServerRpc(serverAudio); } public void PlayAnimAndAudioServerRpc(ServerAnimAndAudio serverAnimAndAudio, GlobalEffects instance, __RpcParams RpcParams) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //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_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[PlayAnimAndAudioServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); return; } PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[value]; Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) played a global anim and audio. ({serverAnimAndAudio})"); instance.PlayAnimAndAudioServerRpc(serverAnimAndAudio); } public void PlayAudio1AtPositionServerRpc(Vector3 audioPos, int clipIndex, SoundManager instance, __RpcParams RpcParams) { //IL_0000: 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_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[PlayAudio1AtPositionServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); return; } PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[value]; if (playAudio1AtPositionCooldown.Contains(val)) { return; } if (val.isPlayerDead) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) tried to play interact trigger sound while dead on the server."); return; } float num = Vector3.Distance(((Component)val).transform.position, audioPos); if (num > 10f) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) tried to play interact trigger sound from too far away. ({num})"); return; } ((MonoBehaviour)Instance).StartCoroutine(PlayAudio1AtPositionCooldown(val)); instance.PlayAudio1AtPositionServerRpc(audioPos, clipIndex); } public void PlayAmbienceClipServerRpc(int soundType, int clipIndex, float soundVolume, bool playInsanitySounds, SoundManager instance, __RpcParams RpcParams) { //IL_0000: 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) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[PlayAmbienceClipServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); return; } PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[value]; if (senderClientId == 0L) { instance.PlayAmbienceClipServerRpc(soundType, clipIndex, soundVolume, playInsanitySounds); } else if (val.isPlayerDead) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) tried to play AmbienceClip while dead on the server."); } else { instance.PlayAmbienceClipServerRpc(soundType, clipIndex, soundVolume, playInsanitySounds); } } public void DropAllHeldItemsRpc(Vector3 playerPosition, Vector3 itemsPosition, Vector3 itemsRotation, Vector3 playerCameraPosition, Vector3 playerCameraRotation, bool setInShip, bool setInElevator, PlayerControllerB instance, __RpcParams RpcParams) { //IL_0000: 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_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0048: 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_004b: 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_009e: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) ulong senderClientId = RpcParams.Ext.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[DropAllHeldItemsServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); return; } if (senderClientId == 0L) { instance.DropAllHeldItemsRpc(playerPosition, itemsPosition, itemsRotation, playerCameraPosition, playerCameraRotation, setInShip, setInElevator); return; } PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[value]; if ((Object)(object)instance != (Object)(object)val) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) tried to call DropAllHeldItemsServerRpc on another player #{instance.playerClientId}."); } else { instance.DropAllHeldItemsRpc(playerPosition, itemsPosition, itemsRotation, playerCameraPosition, playerCameraRotation, setInShip, setInElevator); } } public void SwitchRadarTargetServerRpc(int targetIndex, ManualCameraRenderer instance, __RpcParams RpcParams) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //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_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[SwitchRadarTargetServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); return; } PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[value]; if (!val.isPlayerDead) { if (Vector3.Distance(((Component)instance).transform.position, ((Component)val).transform.position) > 20f) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) tried to swap radar target too far away from screen."); } else { instance.SwitchRadarTargetServerRpc(targetIndex); } } } public void PullCordServerRpc(int playerPullingCord, ShipAlarmCord instance, __RpcParams RpcParams) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //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_0087: 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) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[PullCordServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); return; } PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[value]; if (playerPullingCord != value) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) tried to spoof pulling ship horn cord from another player. ({playerPullingCord})"); } else if (!val.isPlayerDead) { if (Vector3.Distance(((Component)instance).transform.position, ((Component)val).transform.position) > 20f) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) tried to pull ship horn cord from too far away."); } else { instance.PullCordServerRpc(playerPullingCord); } } } public void StopPullingCordServerRpc(int playerPullingCord, ShipAlarmCord instance, __RpcParams RpcParams) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //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) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[StopPullingCordServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); return; } PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[value]; if (playerPullingCord != value) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) tried to spoof stopping pulling ship horn cord from another player. ({playerPullingCord})"); } else { instance.StopPullingCordServerRpc(playerPullingCord); } } public void RemoveFromBagNonElevatorParentServerRpc(NetworkObjectReference objectRef, NetworkObjectReference nonElevatorParent, Vector3 targetPosition, int playerWhoRemoved, bool inFactory, BeltBagItem instance, __RpcParams RpcParams) { //IL_0000: 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_007d: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_022e: Unknown result type (might be due to invalid IL or missing references) //IL_0236: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[RemoveFromBagNonElevatorParentServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); return; } PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[value]; string playerUsername = val.playerUsername; if (playerWhoRemoved != value) { Log.LogInfo((object)$"Player #{value} ({playerUsername}) tried to spoof removing item from belt bag as another player. ({playerWhoRemoved})"); return; } GameObject val2 = NetworkObjectReference.op_Implicit(nonElevatorParent); if ((Object)(object)val2 == (Object)null) { Log.LogInfo((object)$"Player #{value} ({playerUsername}) sent a parent object that doesn't exist ({((NetworkObjectReference)(ref nonElevatorParent)).NetworkObjectId})"); return; } GameObject val3 = NetworkObjectReference.op_Implicit(objectRef); if ((Object)(object)val3 == (Object)null) { Log.LogInfo((object)$"Player #{value} ({playerUsername}) sent a dropped from belt bag item that doesn't exist ({((NetworkObjectReference)(ref objectRef)).NetworkObjectId})"); return; } GrabbableObject val4 = default(GrabbableObject); if (!val3.TryGetComponent(ref val4)) { Log.LogInfo((object)$"Player #{value} ({playerUsername}) tried to drop an object from belt bag that isn't a grabbable object ({((Object)val3).name})"); return; } float num = Vector3.Distance(((Component)val).transform.position, val2.transform.position); Vector3 itemFloorPosition = val4.GetItemFloorPosition(default(Vector3)); Vector3 val5 = ((!val.isInElevator) ? val.playersManager.propsContainer.InverseTransformPoint(itemFloorPosition) : val.playersManager.elevatorTransform.InverseTransformPoint(itemFloorPosition)); if (num > val.grabDistance + 7f) { if (itemFloorPosition == ((Component)val).transform.position) { Log.LogInfo((object)$"Player #{value} ({playerUsername}) tried to drop an object from belt bag too far away and it didn't fall. {((Object)val4).name} {itemFloorPosition}"); } Log.LogInfo((object)$"Player #{value} ({playerUsername}) tried to drop an object from belt bag too far away. ({(int)num}) ({((Object)val4).name})"); val.ThrowObjectServerRpc(objectRef, val.isInElevator, val.isInHangarShipRoom, val5, (int)((Component)val).transform.localEulerAngles.y); } else { instance.RemoveFromBagNonElevatorParentServerRpc(objectRef, nonElevatorParent, targetPosition, value, inFactory); } } public void RemoveFromBagServerRpc(NetworkObjectReference objectRef, bool setInElevator, bool setInShip, Vector3 targetPosition, int playerWhoRemoved, bool inFactory, BeltBagItem instance, __RpcParams RpcParams) { //IL_0000: 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_007d: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: 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) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010a: 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_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_011a: 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_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[RemoveFromBagServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); return; } PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[value]; string playerUsername = val.playerUsername; if (playerWhoRemoved != value) { Log.LogInfo((object)$"Player #{value} ({playerUsername}) tried to spoof removing item from belt bag as another player. ({playerWhoRemoved})"); return; } GameObject val2 = NetworkObjectReference.op_Implicit(objectRef); if ((Object)(object)val2 == (Object)null) { Log.LogInfo((object)$"Player #{value} ({playerUsername}) sent a item to drop from belt bag that doesn't exist ({((NetworkObjectReference)(ref objectRef)).NetworkObjectId})"); return; } GrabbableObject val3 = default(GrabbableObject); if (!val2.TryGetComponent(ref val3)) { Log.LogInfo((object)$"Player #{value} ({playerUsername}) tried to drop an object from belt bag that isn't a grabbable object ({((Object)val2).name})"); return; } float num = Vector3.Distance(((Component)val).transform.position, targetPosition); Vector3 itemFloorPosition = val3.GetItemFloorPosition(default(Vector3)); Vector3 val4 = ((!setInElevator) ? val.playersManager.propsContainer.InverseTransformPoint(itemFloorPosition) : val.playersManager.elevatorTransform.InverseTransformPoint(itemFloorPosition)); if (num > val.grabDistance + 7f) { if (itemFloorPosition == ((Component)val).transform.position) { Log.LogInfo((object)$"Player #{value} ({playerUsername}) tried to drop an object from belt bag too far away and it didn't fall. {((Object)val3).name} {itemFloorPosition}"); } Log.LogInfo((object)$"Player #{value} ({playerUsername}) tried to drop an object from belt bag too far away. ({(int)num}) ({((Object)val3).name})"); val.ThrowObjectServerRpc(objectRef, val.isInElevator, val.isInHangarShipRoom, val4, (int)((Component)val).transform.localEulerAngles.y); } else { instance.RemoveFromBagServerRpc(objectRef, setInElevator, setInShip, targetPosition, value, inFactory); } } public void TryAddObjectToBagServerRpc(NetworkObjectReference netObjectRef, int playerWhoAdded, BeltBagItem instance, __RpcParams RpcParams) { //IL_0000: 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_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: 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_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0109: 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) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_014e: 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) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[TryAddObjectToBagServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); return; } string playerUsername = StartOfRound.Instance.allPlayerScripts[value].playerUsername; if (playerWhoAdded != value) { Log.LogInfo((object)$"Player #{value} ({playerUsername}) tried to spoof adding item to belt bag as another player. ({playerWhoAdded})"); ClientRpcParams clientRpcParams = new ClientRpcParams { Send = new ClientRpcSendParams { TargetClientIds = new <>z__ReadOnlySingleElementList(senderClientId) } }; HostFixesServerSendRpcs.Instance.CancelAddObjectToBagClientRpc(value, instance, clientRpcParams); return; } GameObject val = NetworkObjectReference.op_Implicit(netObjectRef); GrabbableObject val2 = default(GrabbableObject); if ((Object)(object)val == (Object)null) { Log.LogInfo((object)$"Player #{value} ({playerUsername}) sent a item to add to belt bag that doesn't exist ({((NetworkObjectReference)(ref netObjectRef)).NetworkObjectId})"); ClientRpcParams clientRpcParams2 = new ClientRpcParams { Send = new ClientRpcSendParams { TargetClientIds = new <>z__ReadOnlySingleElementList(senderClientId) } }; HostFixesServerSendRpcs.Instance.CancelAddObjectToBagClientRpc(value, instance, clientRpcParams2); } else if (!val.TryGetComponent(ref val2)) { Log.LogInfo((object)$"Player #{value} ({playerUsername}) tried to add item to belt bag that isn't a grabbable item ({((Object)val).name})"); ClientRpcParams clientRpcParams3 = new ClientRpcParams { Send = new ClientRpcSendParams { TargetClientIds = new <>z__ReadOnlySingleElementList(senderClientId) } }; HostFixesServerSendRpcs.Instance.CancelAddObjectToBagClientRpc(value, instance, clientRpcParams3); } else if (configLimitBeltBagToNonScrap.Value && val2.itemProperties.isScrap) { Log.LogInfo((object)$"Player #{value} ({playerUsername}) tried to pickup scrap using the belt bag ({((Object)val).name})"); ClientRpcParams clientRpcParams4 = new ClientRpcParams { Send = new ClientRpcSendParams { TargetClientIds = new <>z__ReadOnlySingleElementList(senderClientId) } }; HostFixesServerSendRpcs.Instance.CancelAddObjectToBagClientRpc(value, instance, clientRpcParams4); } else { instance.TryAddObjectToBagServerRpc(netObjectRef, value); } } public void TryCheckingBagServerRpc(int playerId, BeltBagItem instance, __RpcParams RpcParams) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //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) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[TryCheckingBagServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); return; } PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[value]; if (playerId != value) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) tried to spoof checking bag as another player ({playerId})"); } else { instance.TryCheckingBagServerRpc(value); } } public void SpawnExplosionAtPlayerBodyServerRpc(Vector3 pos, Quaternion rot, int _, int deactivatePlayerBody, GiantKiwiAI instance, __RpcParams RpcParams) { //IL_0000: 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_0072: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) ulong senderClientId = RpcParams.Server.Receive.SenderClientId; if (!StartOfRound.Instance.ClientPlayerList.TryGetValue(senderClientId, out var value)) { Log.LogError((object)$"[SyncWatchingThreatServerRpc] Failed to get the playerId from senderClientId: {senderClientId}"); return; } PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[value]; if (deactivatePlayerBody >= 0 && deactivatePlayerBody < StartOfRound.Instance.allPlayerScripts.Length) { PlayerControllerB val2 = StartOfRound.Instance.allPlayerScripts[deactivatePlayerBody]; if (Vector3.Distance(pos, ((Component)instance).transform.position) > 10f) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) tried sending an invalid body to deactivate. ({deactivatePlayerBody})"); } else if ((Object)(object)val2.deadBody == (Object)null || !((Behaviour)val2.deadBody).isActiveAndEnabled) { Log.LogInfo((object)$"Player #{value} ({val.playerUsername}) tried to spawn an explosion on an invalid body. ({deactivatePlayerBody})"); } else { instance.SpawnExplosionAtPlayerBodyServerRpc(pos, rot, value, deactivatePlayerBody); } } } } public class HostFixesServerSendRpcs : NetworkBehaviour { public static HostFixesServerSendRpcs Instance; public HostFixesServerSendRpcs() { Instance = this; } public void PlayLeverPullEffectsClientRpc(bool leverPulled, StartMatchLever instance, ClientRpcParams clientRpcParams = default(ClientRpcParams)) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Invalid comparison between Unknown and I4 //IL_0042: 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_005c: 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_0069: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) if ((int)base.__rpc_exec_stage != 2 && (NetworkManager.Singleton.IsServer || NetworkManager.Singleton.IsHost)) { FastBufferWriter val = (FastBufferWriter)BeginSendClientRpc.Invoke(instance, new object[3] { 2951629574u, clientRpcParams, (object)(RpcDelivery)0 }); ((FastBufferWriter)(ref val)).WriteValueSafe(ref leverPulled, default(ForPrimitives)); EndSendClientRpc.Invoke(instance, new object[4] { val, 2951629574u, clientRpcParams, (object)(RpcDelivery)0 }); } } public void UpdateAnimClientRpc(bool setBool, bool playSecondaryAudios, int playerWhoTriggered, AnimatedObjectTrigger instance, ClientRpcParams clientRpcParams = default(ClientRpcParams)) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0059: 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) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) if ((int)base.__rpc_exec_stage != 2 && (NetworkManager.Singleton.IsServer || NetworkManager.Singleton.IsHost)) { FastBufferWriter val = (FastBufferWriter)BeginSendClientRpc.Invoke(instance, new object[3] { 848048148u, clientRpcParams, (object)(RpcDelivery)0 }); ((FastBufferWriter)(ref val)).WriteValueSafe(ref setBool, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref playSecondaryAudios, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val, playerWhoTriggered); EndSendClientRpc.Invoke(instance, new object[4] { val, 848048148u, clientRpcParams, (object)(RpcDelivery)0 }); } } public void UpdateAnimTriggerClientRpc(AnimatedObjectTrigger instance, ClientRpcParams clientRpcParams = default(ClientRpcParams)) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Invalid comparison between Unknown and I4 //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) if ((int)base.__rpc_exec_stage != 2 && (NetworkManager.Singleton.IsServer || NetworkManager.Singleton.IsHost)) { FastBufferWriter val = (FastBufferWriter)BeginSendClientRpc.Invoke(instance, new object[3] { 1023577379u, clientRpcParams, (object)(RpcDelivery)0 }); EndSendClientRpc.Invoke(instance, new object[4] { val, 1023577379u, clientRpcParams, (object)(RpcDelivery)0 }); } } public void GrabObjectClientRpc(bool grabValidated, NetworkObjectReference grabbedObject, PlayerControllerB instance, ClientRpcParams clientRpcParams = default(ClientRpcParams)) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Invalid comparison between Unknown and I4 //IL_0042: 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_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0064: 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: 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_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) if ((int)base.__rpc_exec_stage != 2 && (NetworkManager.Singleton.IsServer || NetworkManager.Singleton.IsHost)) { FastBufferWriter val = (FastBufferWriter)BeginSendClientRpc.Invoke(instance, new object[3] { 2552479808u, clientRpcParams, (object)(RpcDelivery)0 }); ((FastBufferWriter)(ref val)).WriteValueSafe(ref grabValidated, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref grabbedObject, default(ForNetworkSerializable)); EndSendClientRpc.Invoke(instance, new object[4] { val, 2552479808u, clientRpcParams, (object)(RpcDelivery)0 }); } } public void SyncTerminalValuesClientRpc(int groupCredits, int numItemsInDropship, bool vehicleWarranty, Terminal instance, ClientRpcParams clientRpcParams = default(ClientRpcParams)) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0059: 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) //IL_005f: 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) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) if ((int)base.__rpc_exec_stage != 2 && (NetworkManager.Singleton.IsServer || NetworkManager.Singleton.IsHost)) { FastBufferWriter val = (FastBufferWriter)BeginSendClientRpc.Invoke(instance, new object[3] { 1505747100u, clientRpcParams, (object)(RpcDelivery)0 }); BytePacker.WriteValueBitPacked(val, groupCredits); BytePacker.WriteValueBitPacked(val, numItemsInDropship); ((FastBufferWriter)(ref val)).WriteValueSafe(ref vehicleWarranty, default(ForPrimitives)); EndSendClientRpc.Invoke(instance, new object[4] { val, 1505747100u, clientRpcParams, (object)(RpcDelivery)0 }); } } public void CancelAddObjectToBagClientRpc(int playerWhoAdded, BeltBagItem instance, ClientRpcParams clientRpcParams = default(ClientRpcParams)) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Invalid comparison between Unknown and I4 //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: 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_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) if ((int)base.__rpc_exec_stage != 2 && (NetworkManager.Singleton.IsServer || NetworkManager.Singleton.IsHost)) { FastBufferWriter val = (FastBufferWriter)BeginSendClientRpc.Invoke(instance, new object[3] { 1076504254u, clientRpcParams, (object)(RpcDelivery)0 }); BytePacker.WriteValueBitPacked(val, playerWhoAdded); EndSendClientRpc.Invoke(instance, new object[4] { val, 1076504254u, clientRpcParams, (object)(RpcDelivery)0 }); } } } private class ServerRPCMessageHandlers { [HarmonyPatch] private class BuyItemsServerRpc_Transpile { [HarmonyPatch(typeof(Terminal), "__rpc_handler_4003509079")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "BuyItemsServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("BuyItemsServerRpc"); } else { Log.LogError((object)"Could not patch BuyItemsServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class PlayTerminalAudioServerRpc_Transpile { [HarmonyPatch(typeof(Terminal), "__rpc_handler_1713627637")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "PlayTerminalAudioServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("PlayTerminalAudioServerRpc"); } else { Log.LogError((object)"Could not patch PlayTerminalAudioServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class BuyShipUnlockableServerRpc_Transpile { [HarmonyPatch(typeof(StartOfRound), "__rpc_handler_3953483456")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "BuyShipUnlockableServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("BuyShipUnlockableServerRpc"); } else { Log.LogError((object)"Could not patch BuyShipUnlockableServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class ChangeLevelServerRpc_Transpile { [HarmonyPatch(typeof(StartOfRound), "__rpc_handler_1134466287")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "ChangeLevelServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("ChangeLevelServerRpc"); } else { Log.LogError((object)"Could not patch ChangeLevelServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class AddPlayerChatMessageServerRpcHandler_Transpile { [HarmonyPatch(typeof(HUDManager), "__rpc_handler_2930587515")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "AddPlayerChatMessageServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("AddPlayerChatMessageServerRpc"); } else { Log.LogError((object)"Could not patch AddPlayerChatMessageServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class AddTextMessageServerRpc_Transpile { [HarmonyPatch(typeof(HUDManager), "__rpc_handler_2787681914")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "AddTextMessageServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("AddTextMessageServerRpc"); } else { Log.LogError((object)"Could not patch AddTextMessageServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class SetShipLeaveEarlyServerRpc_Transpile { [HarmonyPatch(typeof(TimeOfDay), "__rpc_handler_543987598")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "SetShipLeaveEarlyServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("SetShipLeaveEarlyServerRpc"); } else { Log.LogError((object)"Could not patch SetShipLeaveEarlyServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class PlaceShipObjectServerRpc_Transpile { [HarmonyPatch(typeof(ShipBuildModeManager), "__rpc_handler_861494715")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "PlaceShipObjectServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("PlaceShipObjectServerRpc"); } else { Log.LogError((object)"Could not patch PlaceShipObjectServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class DespawnEnemyServerRpc_Transpile { [HarmonyPatch(typeof(RoundManager), "__rpc_handler_3840785488")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "DespawnEnemyServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("DespawnEnemyServerRpc"); } else { Log.LogError((object)"Could not patch DespawnEnemyServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class EndGameServerRpc_Transpile { [HarmonyPatch(typeof(StartOfRound), "__rpc_handler_2028434619")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "EndGameServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("EndGameServerRpc"); } else { Log.LogError((object)"Could not patch EndGameServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class PlayerLoadedServerRpc_Transpile { [HarmonyPatch(typeof(StartOfRound), "__rpc_handler_4249638645")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "PlayerLoadedServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("PlayerLoadedServerRpc"); } else { Log.LogError((object)"Could not patch PlayerLoadedServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class FinishedGeneratingLevelServerRpc_Transpile { [HarmonyPatch(typeof(RoundManager), "__rpc_handler_192551691")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "FinishedGeneratingLevelServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("FinishedGeneratingLevelServerRpc"); } else { Log.LogError((object)"Could not patch FinishedGeneratingLevelServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class SendNewPlayerValuesServerRpc_Transpile { [HarmonyPatch(typeof(PlayerControllerB), "__rpc_handler_2504133785")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "SendNewPlayerValuesServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("SendNewPlayerValuesServerRpc"); } else { Log.LogError((object)"Could not patch SendNewPlayerValuesServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class DamagePlayerFromOtherClientServerRpc_Transpile { [HarmonyPatch(typeof(PlayerControllerB), "__rpc_handler_638895557")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "DamagePlayerFromOtherClientServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("DamagePlayerFromOtherClientServerRpc"); } else { Log.LogError((object)"Could not patch DamagePlayerFromOtherClientServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class ShootGunServerRpc_Transpile { [HarmonyPatch(typeof(ShotgunItem), "__rpc_handler_1329927282")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "ShootGunServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("ShootGunServerRpc"); } else { Log.LogError((object)"Could not patch ShootGunServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class ReloadGunEffectsServerRpc_Transpile { [HarmonyPatch(typeof(ShotgunItem), "__rpc_handler_3349119596")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "ReloadGunEffectsServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("ReloadGunEffectsServerRpc"); } else { Log.LogError((object)"Could not patch ReloadGunEffectsServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class DestroyItemInSlotServerRpc_Transpile { [HarmonyPatch(typeof(PlayerControllerB), "__rpc_handler_1388366573")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "DestroyItemInSlotServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("DestroyItemInSlotServerRpc"); } else { Log.LogError((object)"Could not patch DestroyItemInSlotServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class ChangeOwnershipOfPropServerRpc_Transpile { [HarmonyPatch(typeof(GrabbableObject), "__rpc_handler_1391130874")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "ChangeOwnershipOfPropServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("ChangeOwnershipOfPropServerRpc"); } else { Log.LogError((object)"Could not patch ChangeOwnershipOfPropServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class GrabObjectServerRpc_Transpile { [HarmonyPatch(typeof(PlayerControllerB), "__rpc_handler_1554282707")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "GrabObjectServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("GrabObjectServerRpc"); } else { Log.LogError((object)"Could not patch GrabObjectServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class EquipItemServerRpc_Transpile { [HarmonyPatch(typeof(GrabbableObject), "__rpc_handler_947748389")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "EquipItemServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("EquipItemServerRpc"); } else { Log.LogError((object)"Could not patch EquipItemServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class ThrowObjectServerRpc_Transpile { [HarmonyPatch(typeof(PlayerControllerB), "__rpc_handler_2376977494")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "ThrowObjectServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("ThrowObjectServerRpc"); } else { Log.LogError((object)"Could not patch ThrowObjectServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class PlaceObjectServerRpc_Transpile { [HarmonyPatch(typeof(PlayerControllerB), "__rpc_handler_3830452098")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "PlaceObjectServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("PlaceObjectServerRpc"); } else { Log.LogError((object)"Could not patch PlaceObjectServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class AddObjectToDeskServerRpc_Transpile { [HarmonyPatch(typeof(DepositItemsDesk), "__rpc_handler_4150038830")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "AddObjectToDeskServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("AddObjectToDeskServerRpc"); } else { Log.LogError((object)"Could not patch AddObjectToDeskServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class SetTimesHeardNoiseServerRpc_Transpile { [HarmonyPatch(typeof(DepositItemsDesk), "__rpc_handler_745684781")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "SetTimesHeardNoiseServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("SetTimesHeardNoiseServerRpc"); } else { Log.LogError((object)"Could not patch SetTimesHeardNoiseServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class SetShipLightsServerRpc_Transpile { [HarmonyPatch(typeof(ShipLights), "__rpc_handler_1625678258")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "SetShipLightsServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("SetShipLightsServerRpc"); } else { Log.LogError((object)"Could not patch SetShipLightsServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class UseSignalTranslatorServerRpc_Transpile { [HarmonyPatch(typeof(HUDManager), "__rpc_handler_2436660286")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "UseSignalTranslatorServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("UseSignalTranslatorServerRpc"); } else { Log.LogError((object)"Could not patch UseSignalTranslatorServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class UpdatePlayerPositionRpc_Transpile { [HarmonyPatch(typeof(PlayerControllerB), "__rpc_handler_890924887")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "UpdatePlayerPositionRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("UpdatePlayerPositionRpc"); } else { Log.LogError((object)"Could not patch UpdatePlayerPositionRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class TeleportPlayerServerRpc_Transpile { [HarmonyPatch(typeof(EntranceTeleport), "__rpc_handler_4279190381")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "TeleportPlayerServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("TeleportPlayerServerRpc"); } else { Log.LogError((object)"Could not patch TeleportPlayerServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class PressTeleportButtonServerRpc_Transpile { [HarmonyPatch(typeof(ShipTeleporter), "__rpc_handler_389447712")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "PressTeleportButtonServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("PressTeleportButtonServerRpc"); } else { Log.LogError((object)"Could not patch PressTeleportButtonServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class TeleportPlayerOutServerRpc_Transpile { [HarmonyPatch(typeof(ShipTeleporter), "__rpc_handler_3033548568")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "TeleportPlayerOutServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("TeleportPlayerOutServerRpc"); } else { Log.LogError((object)"Could not patch TeleportPlayerOutServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class UpdatePlayerRotationServerRpc_Transpile { [HarmonyPatch(typeof(PlayerControllerB), "__rpc_handler_588787670")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "UpdatePlayerRotationServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("UpdatePlayerRotationServerRpc"); } else { Log.LogError((object)"Could not patch UpdatePlayerRotationServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class UpdatePlayerRotationFullServerRpc_Transpile { [HarmonyPatch(typeof(PlayerControllerB), "__rpc_handler_2609793477")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "UpdatePlayerRotationFullServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("UpdatePlayerRotationFullServerRpc"); } else { Log.LogError((object)"Could not patch UpdatePlayerRotationFullServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class UpdatePlayerAnimationServerRpc_Transpile { [HarmonyPatch(typeof(PlayerControllerB), "__rpc_handler_3473255830")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "UpdatePlayerAnimationServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("UpdatePlayerAnimationServerRpc"); } else { Log.LogError((object)"Could not patch UpdatePlayerAnimationServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class UpdateUsedByPlayerServerRpc_Transpile { [HarmonyPatch(typeof(InteractTrigger), "__rpc_handler_1430497838")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "UpdateUsedByPlayerServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("UpdateUsedByPlayerServerRpc"); } else { Log.LogError((object)"Could not patch UpdateUsedByPlayerServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class StopUsingServerRpc_Transpile { [HarmonyPatch(typeof(InteractTrigger), "__rpc_handler_880620475")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "StopUsingServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("StopUsingServerRpc"); } else { Log.LogError((object)"Could not patch StopUsingServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class UpdateAnimServerRpc_Transpile { [HarmonyPatch(typeof(AnimatedObjectTrigger), "__rpc_handler_1461767556")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "UpdateAnimServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("UpdateAnimServerRpc"); } else { Log.LogError((object)"Could not patch UpdateAnimServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class UpdateAnimTriggerServerRpc_Transpile { [HarmonyPatch(typeof(AnimatedObjectTrigger), "__rpc_handler_2219526317")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "UpdateAnimTriggerServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("UpdateAnimTriggerServerRpc"); } else { Log.LogError((object)"Could not patch UpdateAnimTriggerServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class SyncAllPlayerLevelsServerRpc_Transpile { [HarmonyPatch(typeof(HUDManager), "__rpc_handler_4217433937")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "SyncAllPlayerLevelsServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("SyncAllPlayerLevelsServerRpc"); } else { Log.LogError((object)"Could not patch SyncAllPlayerLevelsServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class StartGameServerRpc_Transpile { [HarmonyPatch(typeof(StartOfRound), "__rpc_handler_1089447320")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "StartGameServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("StartGameServerRpc"); } else { Log.LogError((object)"Could not patch StartGameServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class PlayLeverPullEffectsServerRpc_Transpile { [HarmonyPatch(typeof(StartMatchLever), "__rpc_handler_2406447821")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "PlayLeverPullEffectsServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("PlayLeverPullEffectsServerRpc"); } else { Log.LogError((object)"Could not patch PlayLeverPullEffectsServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class SyncAlreadyHeldObjectsServerRpc_Transpile { [HarmonyPatch(typeof(StartOfRound), "__rpc_handler_682230258")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "SyncAlreadyHeldObjectsServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("SyncAlreadyHeldObjectsServerRpc"); } else { Log.LogError((object)"Could not patch SyncAlreadyHeldObjectsServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class SetPatienceServerRpc_Transpile { [HarmonyPatch(typeof(DepositItemsDesk), "__rpc_handler_892728304")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "SetPatienceServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("SetPatienceServerRpc"); } else { Log.LogError((object)"Could not patch SetPatienceServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class CheckAnimationGrabPlayerServerRpc_Transpile { [HarmonyPatch(typeof(DepositItemsDesk), "__rpc_handler_1392297385")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "CheckAnimationGrabPlayerServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("CheckAnimationGrabPlayerServerRpc"); } else { Log.LogError((object)"Could not patch CheckAnimationGrabPlayerServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class AttackPlayersServerRpc_Transpile { [HarmonyPatch(typeof(DepositItemsDesk), "__rpc_handler_3230280218")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "AttackPlayersServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("AttackPlayersServerRpc"); } else { Log.LogError((object)"Could not patch AttackPlayersServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class ChangeEnemyOwnerServerRpc_Transpile { [HarmonyPatch(typeof(EnemyAI), "__rpc_handler_3587030867")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "ChangeEnemyOwnerServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("ChangeEnemyOwnerServerRpc"); } else { Log.LogError((object)"Could not patch ChangeEnemyOwnerServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class UpdateEnemyPositionRpc_Transpile { [HarmonyPatch(typeof(EnemyAI), "__rpc_handler_1277166335")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "UpdateEnemyPositionRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("UpdateEnemyPositionRpc"); } else { Log.LogError((object)"Could not patch UpdateEnemyPositionRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class ActivateItemRpc_Transpile { [HarmonyPatch(typeof(GrabbableObject), "__rpc_handler_319375719")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "ActivateItemRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("ActivateItemRpc"); } else { Log.LogError((object)"Could not patch ActivateItemRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class KillEnemyServerRpc_Transpile { [HarmonyPatch(typeof(EnemyAI), "__rpc_handler_1810146992")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "KillEnemyServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("KillEnemyServerRpc"); } else { Log.LogError((object)"Could not patch KillEnemyServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class HitKnifeServerRpc_Transpile { [HarmonyPatch(typeof(KnifeItem), "__rpc_handler_2696735117")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "HitShovelServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("HitKnifeServerRpc"); } else { Log.LogError((object)"Could not patch HitShovelServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class HitEnemyServerRpc_Transpile { [HarmonyPatch(typeof(EnemyAI), "__rpc_handler_3538577804")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "HitEnemyServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("HitEnemyServerRpc"); } else { Log.LogError((object)"Could not patch HitEnemyServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class SetMagnetOnServerRpc_Transpile { [HarmonyPatch(typeof(StartOfRound), "__rpc_handler_3212216718")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "SetMagnetOnServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("SetMagnetOnServerRpc"); } else { Log.LogError((object)"Could not patch SetMagnetOnServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class BuyVehicleServerRpc_Transpile { [HarmonyPatch(typeof(Terminal), "__rpc_handler_2452398197")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "BuyVehicleServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("BuyVehicleServerRpc"); } else { Log.LogError((object)"Could not patch BuyVehicleServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class RemoveKeyFromIgnitionServerRpc_Transpile { [HarmonyPatch(typeof(VehicleController), "__rpc_handler_269855870")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "RemoveKeyFromIgnitionServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("RemoveKeyFromIgnitionServerRpc"); } else { Log.LogError((object)"Could not patch RemoveKeyFromIgnitionServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class RevCarServerRpc_Transpile { [HarmonyPatch(typeof(VehicleController), "__rpc_handler_1319663544")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "RevCarServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("RevCarServerRpc"); } else { Log.LogError((object)"Could not patch RevCarServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class StartIgnitionServerRpc_Transpile { [HarmonyPatch(typeof(VehicleController), "__rpc_handler_2403570091")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "StartIgnitionServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("StartIgnitionServerRpc"); } else { Log.LogError((object)"Could not patch StartIgnitionServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class CancelTryIgnitionServerRpc_Transpile { [HarmonyPatch(typeof(VehicleController), "__rpc_handler_4283235241")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "CancelTryIgnitionServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("CancelTryIgnitionServerRpc"); } else { Log.LogError((object)"Could not patch CancelTryIgnitionServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class PassengerLeaveVehicleServerRpc_Transpile { [HarmonyPatch(typeof(VehicleController), "__rpc_handler_2150817317")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "PassengerLeaveVehicleServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("PassengerLeaveVehicleServerRpc"); } else { Log.LogError((object)"Could not patch PassengerLeaveVehicleServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class SetPlayerInControlOfVehicleServerRpc_Transpile { [HarmonyPatch(typeof(VehicleController), "__rpc_handler_2687785832")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "SetPlayerInControlOfVehicleServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("SetPlayerInControlOfVehicleServerRpc"); } else { Log.LogError((object)"Could not patch SetPlayerInControlOfVehicleServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class RemovePlayerControlOfVehicleServerRpc_Transpile { [HarmonyPatch(typeof(VehicleController), "__rpc_handler_2345405857")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "RemovePlayerControlOfVehicleServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("RemovePlayerControlOfVehicleServerRpc"); } else { Log.LogError((object)"Could not patch RemovePlayerControlOfVehicleServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class ShiftToGearServerRpc_Transpile { [HarmonyPatch(typeof(VehicleController), "__rpc_handler_1427257619")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "ShiftToGearServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("ShiftToGearServerRpc"); } else { Log.LogError((object)"Could not patch ShiftToGearServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class SetHonkServerRpc_Transpile { [HarmonyPatch(typeof(VehicleController), "__rpc_handler_735895017")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "SetHonkServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("SetHonkServerRpc"); } else { Log.LogError((object)"Could not patch SetHonkServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class SetRadioOnServerRpc_Transpile { [HarmonyPatch(typeof(VehicleController), "__rpc_handler_2416589835")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "SetRadioOnServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("SetRadioOnServerRpc"); } else { Log.LogError((object)"Could not patch SetRadioOnServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class SetRadioStationServerRpc_Transpile { [HarmonyPatch(typeof(VehicleController), "__rpc_handler_721150963")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "SetRadioStationServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("SetRadioStationServerRpc"); } else { Log.LogError((object)"Could not patch SetRadioStationServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class CarBumpServerRpc_Transpile { [HarmonyPatch(typeof(VehicleController), "__rpc_handler_2627964612")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "CarBumpServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("CarBumpServerRpc"); } else { Log.LogError((object)"Could not patch CarBumpServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class CarCollisionServerRpc_Transpile { [HarmonyPatch(typeof(VehicleController), "__rpc_handler_2778459828")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "CarCollisionServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("CarCollisionServerRpc"); } else { Log.LogError((object)"Could not patch CarCollisionServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class DestroyCarServerRpc_Transpile { [HarmonyPatch(typeof(VehicleController), "__rpc_handler_4012624473")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "DestroyCarServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("DestroyCarServerRpc"); } else { Log.LogError((object)"Could not patch DestroyCarServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class SpringDriverSeatServerRpc_Transpile { [HarmonyPatch(typeof(VehicleController), "__rpc_handler_46143233")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "SpringDriverSeatServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("SpringDriverSeatServerRpc"); } else { Log.LogError((object)"Could not patch SpringDriverSeatServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class PushTruckFromOwnerServerRpc_Transpile { [HarmonyPatch(typeof(VehicleController), "__rpc_handler_1326342869")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "PushTruckFromOwnerServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("PushTruckFromOwnerServerRpc"); } else { Log.LogError((object)"Could not patch PushTruckFromOwnerServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class PushTruckServerRpcRpc_Transpile { [HarmonyPatch(typeof(VehicleController), "__rpc_handler_4058179333")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "PushTruckServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("PushTruckServerRpc"); } else { Log.LogError((object)"Could not patch PushTruckServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class CreateMimicServerRpc_Transpile { [HarmonyPatch(typeof(HauntedMaskItem), "__rpc_handler_1065539967")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "CreateMimicServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("CreateMimicServerRpc"); } else { Log.LogError((object)"Could not patch CreateMimicServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class KillPlayerServerRpcRpc_Transpile { [HarmonyPatch(typeof(PlayerControllerB), "__rpc_handler_1583426973")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "KillPlayerServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("KillPlayerServerRpc"); } else { Log.LogError((object)"Could not patch KillPlayerServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class KillPlayerAnimationServerRpc_Transpile { [HarmonyPatch(typeof(MaskedPlayerEnemy), "__rpc_handler_3192502457")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "KillPlayerAnimationServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("KillPlayerAnimationServerRpc"); } else { Log.LogError((object)"Could not patch KillPlayerAnimationServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class OpenDoorAsEnemyServerRpc_Transpile { [HarmonyPatch(typeof(DoorLock), "__rpc_handler_2046162111")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "OpenDoorAsEnemyServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("OpenDoorAsEnemyServerRpc"); } else { Log.LogError((object)"Could not patch OpenDoorAsEnemyServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class CloseDoorNonPlayerServerRpc_Transpile { [HarmonyPatch(typeof(DoorLock), "__rpc_handler_2211684126")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "CloseDoorNonPlayerServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("CloseDoorNonPlayerServerRpc"); } else { Log.LogError((object)"Could not patch CloseDoorNonPlayerServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class EnterBerserkModeServerRpc_Transpile { [HarmonyPatch(typeof(Turret), "__rpc_handler_4195711963")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "EnterBerserkModeServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("EnterBerserkModeServerRpc"); } else { Log.LogError((object)"Could not patch EnterBerserkModeServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class PressMineServerRpc_Transpile { [HarmonyPatch(typeof(Landmine), "__rpc_handler_4224840819")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "PressMineServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("PressMineServerRpc"); } else { Log.LogError((object)"Could not patch PressMineServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class ExplodeMineServerRpc_Transpile { [HarmonyPatch(typeof(Landmine), "__rpc_handler_3032666565")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "ExplodeMineServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("ExplodeMineServerRpc"); } else { Log.LogError((object)"Could not patch ExplodeMineServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class PlayAudioServerRpc_Transpile { [HarmonyPatch(typeof(GlobalEffects), "__rpc_handler_1842858504")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "PlayAudioServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("PlayAudioServerRpc"); } else { Log.LogError((object)"Could not patch PlayAudioServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class PlayAnimAndAudioServerRpc_Transpile { [HarmonyPatch(typeof(GlobalEffects), "__rpc_handler_2259057361")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "PlayAnimAndAudioServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("PlayAnimAndAudioServerRpc"); } else { Log.LogError((object)"Could not patch PlayAnimAndAudioServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class PlayAudio1AtPositionServerRpc_Transpile { [HarmonyPatch(typeof(SoundManager), "__rpc_handler_2837950577")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "PlayAudio1AtPositionServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("PlayAudio1AtPositionServerRpc"); } else { Log.LogError((object)"Could not patch PlayAudio1AtPositionServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class PlayAmbienceClipServerRpc_Transpile { [HarmonyPatch(typeof(SoundManager), "__rpc_handler_274078295")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "PlayAmbienceClipServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("PlayAmbienceClipServerRpc"); } else { Log.LogError((object)"Could not patch PlayAmbienceClipServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class DropAllHeldItemsRpc_Transpile { [HarmonyPatch(typeof(PlayerControllerB), "__rpc_handler_1748753755")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "DropAllHeldItemsRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("DropAllHeldItemsRpc"); } else { Log.LogError((object)"Could not patch DropAllHeldItemsRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class SwitchRadarTargetServerRpc_Transpile { [HarmonyPatch(typeof(ManualCameraRenderer), "__rpc_handler_1485069450")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "SwitchRadarTargetServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("SwitchRadarTargetServerRpc"); } else { Log.LogError((object)"Could not patch SwitchRadarTargetServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class PullCordServerRpc_Transpile { [HarmonyPatch(typeof(ShipAlarmCord), "__rpc_handler_504098657")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "PullCordServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("PullCordServerRpc"); } else { Log.LogError((object)"Could not patch PullCordServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class StopPullingCordServerRpc_Transpile { [HarmonyPatch(typeof(ShipAlarmCord), "__rpc_handler_967408504")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "StopPullingCordServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("StopPullingCordServerRpc"); } else { Log.LogError((object)"Could not patch StopPullingCordServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class RemoveFromBagNonElevatorParentServerRpc_Transpile { [HarmonyPatch(typeof(BeltBagItem), "__rpc_handler_1618346907")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "RemoveFromBagNonElevatorParentServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("RemoveFromBagNonElevatorParentServerRpc"); } else { Log.LogError((object)"Could not patch RemoveFromBagNonElevatorParentServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class RemoveFromBagServerRpc_Transpile { [HarmonyPatch(typeof(BeltBagItem), "__rpc_handler_4159001947")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "RemoveFromBagServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("RemoveFromBagServerRpc"); } else { Log.LogError((object)"Could not patch RemoveFromBagServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class TryAddObjectToBagServerRpc_Transpile { [HarmonyPatch(typeof(BeltBagItem), "__rpc_handler_2988305002")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "TryAddObjectToBagServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("TryAddObjectToBagServerRpc"); } else { Log.LogError((object)"Could not patch TryAddObjectToBagServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class TryCheckingBagServerRpc_Transpile { [HarmonyPatch(typeof(BeltBagItem), "__rpc_handler_4205663608")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "TryCheckingBagServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("TryCheckingBagServerRpc"); } else { Log.LogError((object)"Could not patch TryCheckingBagServerRpc"); } return list.AsEnumerable(); } } [HarmonyPatch] private class SpawnExplosionAtPlayerBodyServerRpc_Transpile { [HarmonyPatch(typeof(GiantKiwiAI), "__rpc_handler_3238921108")] [HarmonyTranspiler] public static IEnumerable UseServerRpcParams(IEnumerable instructions) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown bool flag = false; int num = -1; List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Callvirt && list[i].operand is MethodInfo { Name: "SpawnExplosionAtPlayerBodyServerRpc" }) { num = i; flag = true; break; } } if (flag) { list.Insert(num, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(num + 1, new CodeInstruction(OpCodes.Ldarg_2, (object)null)); list[num + 2].operand = typeof(HostFixesServerReceiveRpcs).GetMethod("SpawnExplosionAtPlayerBodyServerRpc"); } else { Log.LogError((object)"Could not patch SpawnExplosionAtPlayerBodyServerRpc"); } return list.AsEnumerable(); } } } internal static ManualLogSource Log = null; internal static List votedToLeaveEarlyPlayers = new List(); internal static Dictionary moons = new Dictionary(); internal static Dictionary vehicleCosts = new Dictionary(); internal static Dictionary unlockablePrices = new Dictionary(); internal static Dictionary playerSteamNames = new Dictionary(); internal static Dictionary playerPositions = new Dictionary(); internal static Dictionary allowedMovement = new Dictionary(); internal static Dictionary onShip = new Dictionary(); internal static Dictionary positionCacheUpdateTime = new Dictionary(); internal static Dictionary ammoHasBeenDeletedOnReload = new Dictionary(); internal static bool terminalSoundPlaying; public static ConfigEntry configMinimumVotesToLeaveEarly = null; public static ConfigEntry configDisablePvpInShip = null; public static ConfigEntry configLogSignalTranslatorMessages = null; public static ConfigEntry configLogPvp = null; public static ConfigEntry configLogShipObjects = null; public static ConfigEntry configLogVehicle = null; public static ConfigEntry configCheckPrices = null; public static ConfigEntry configExperimentalChanges = null; public static ConfigEntry configExperimentalPositionCheck = null; public static ConfigEntry configShipObjectRotationCheck = null; public static ConfigEntry configLimitGrabDistance = null; public static ConfigEntry configLimitTwoHandedItemPickup = null; public static ConfigEntry configLimitBeltBagToNonScrap = null; public static ConfigEntry configPreventInfiniteShotgunAmmo = null; public static ConfigEntry configLimitShipLeverDistance = null; public static ConfigEntry configLimitTeleporterButtonDistance = null; private static readonly Dictionary playerMovedShipObject = new Dictionary(); private static readonly Dictionary reloadGunEffectsOnCooldown = new Dictionary(); private static readonly Dictionary damagePlayerFromOtherClientOnCooldown = new Dictionary(); private static readonly Dictionary startGameOnCoolown = new Dictionary(); private static readonly Dictionary endGameOnCoolown = new Dictionary(); private static readonly Dictionary shipLeverAnimationOnCooldown = new Dictionary(); private static readonly Dictionary changeLevelCooldown = new Dictionary(); private static readonly List itemOnCooldown = new List(); private static readonly List knifeSoundCooldown = new List(); private static readonly List serverSoundCooldown = new List(); private static readonly List playAudio1AtPositionCooldown = new List(); private static bool shipLightsOnCooldown; private static bool buyShipUnlockableOnCooldown; private static readonly HashSet pressTeleportButtonOnCooldown = new HashSet(); private static readonly MethodInfo BeginSendClientRpc = typeof(NetworkBehaviour).GetMethod("__beginSendClientRpc", BindingFlags.Instance | BindingFlags.NonPublic); private static readonly MethodInfo EndSendClientRpc = typeof(NetworkBehaviour).GetMethod("__endSendClientRpc", BindingFlags.Instance | BindingFlags.NonPublic); public static Plugin Instance { get; private set; } = null; public static Dictionary SteamIdtoConnectionIdMap { get; private set; } = new Dictionary(); public static Dictionary ConnectionIdtoSteamIdMap { get; private set; } = new Dictionary(); public static Dictionary SteamIdtoClientIdMap { get; private set; } = new Dictionary(); public static Dictionary ClientIdToSteamIdMap { get; private set; } = new Dictionary(); private void Awake() { //IL_0223: Unknown result type (might be due to invalid IL or missing references) Instance = this; Log = ((BaseUnityPlugin)this).Logger; ((Object)((Component)this).gameObject).hideFlags = (HideFlags)61; configMinimumVotesToLeaveEarly = ((BaseUnityPlugin)this).Config.Bind("General", "Minimum Votes To Leave Early", 1, "Minimum number of votes needed for the ship to leave early. Still requires that all the dead players have voted to leave."); configDisablePvpInShip = ((BaseUnityPlugin)this).Config.Bind("General", "Disable PvP inside the ship", false, "If a player is inside the ship, they can't be damaged by other players."); configLogSignalTranslatorMessages = ((BaseUnityPlugin)this).Config.Bind("Logging", "Log Signal Translator Messages", false, "Log messages that players send on the signal translator."); configLogPvp = ((BaseUnityPlugin)this).Config.Bind("Logging", "Log PvP damage", false, "Log when a player damages another player."); configLogShipObjects = ((BaseUnityPlugin)this).Config.Bind("Logging", "Log movement of ship furniture.", false, "Log when a player moves ship unlockables."); configLogVehicle = ((BaseUnityPlugin)this).Config.Bind("Logging", "Log vehicle interactions.", false, "Log when a player interacts with a vehicle."); configCheckPrices = ((BaseUnityPlugin)this).Config.Bind("General", "Check prices", false, "Check if the price on the terminal matches what is sent by the client."); configExperimentalChanges = ((BaseUnityPlugin)this).Config.Bind("Experimental", "Experimental Changes.", false, "Enable experimental changes that may trigger on legitimate players (Requires more testing)"); configExperimentalPositionCheck = ((BaseUnityPlugin)this).Config.Bind("Experimental", "Experimental Position Checks.", false, "Enable experimental checks to prevent extreme client teleporting (Requires more testing)"); configShipObjectRotationCheck = ((BaseUnityPlugin)this).Config.Bind("General", "Check ship object rotation", true, "Only allow ship objects to be placed if the they are still upright."); configLimitGrabDistance = ((BaseUnityPlugin)this).Config.Bind("General", "Limit grab distance", false, "Limit the grab distance to twice of the hosts grab distance. Defaulted to off because of grabbable desync."); configLimitTwoHandedItemPickup = ((BaseUnityPlugin)this).Config.Bind("General", "Prevent carrying multiple 2 handed items", false, "Prevent players from carrying more than one two handed item at once"); configLimitBeltBagToNonScrap = ((BaseUnityPlugin)this).Config.Bind("General", "Limit Belt bag to non scrap", false, "Prevent any scrap from being picked up using the belt bag"); configPreventInfiniteShotgunAmmo = ((BaseUnityPlugin)this).Config.Bind("General", "Prevent firing the shotgun without ammo.", false, "Prevent firing the shotgun without ammo by reqiring the ammo to be used when reloading."); configLimitShipLeverDistance = ((BaseUnityPlugin)this).Config.Bind("General", "Limit ship lever distance", 5, "Limit distance that someone can pull the ship lever from. 0 to disable."); configLimitTeleporterButtonDistance = ((BaseUnityPlugin)this).Config.Bind("General", "Limit teleporter button distance", 5, "Limit distance that someone can press the teleporter buttton from. 0 to disable."); new Harmony("com.github.CharlesE2.HostFixes").PatchAll(); SteamMatchmaking.OnLobbyCreated += ConnectionEvents.LobbyCreated; SteamMatchmaking.OnLobbyMemberJoined += ConnectionEvents.ConnectionAttempt; SteamMatchmaking.OnLobbyMemberLeave += ConnectionEvents.ConnectionCleanup; if (Chainloader.PluginInfos.ContainsKey("BMX.LobbyCompatibility")) { LobbyCompatibility(); } ((MonoBehaviour)this).InvokeRepeating("UpdatePlayerPositionCache", 0f, 1f); new HostFixesServerSendRpcs(); Log.LogMessage((object)"Host Fixes v1.0.30 is loaded!"); } private void LobbyCompatibility() { PluginHelper.RegisterPlugin("com.github.CharlesE2.HostFixes", Version.Parse("1.0.30"), (CompatibilityLevel)1, (VersionStrictness)0); } private void UpdatePlayerPositionCache() { //IL_005c: Unknown result type (might be due to invalid IL or missing references) if (((Object)(object)NetworkManager.Singleton != (Object)null && !NetworkManager.Singleton.IsHost) || (Object)(object)StartOfRound.Instance == (Object)null) { return; } PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; foreach (PlayerControllerB val in allPlayerScripts) { if (val.isPlayerDead || !val.isPlayerControlled) { break; } playerPositions[val.playerClientId] = ((Component)val).transform.localPosition; positionCacheUpdateTime[val.playerClientId] = Time.time; } } internal static IEnumerator TerminalAwakeWait(Terminal terminal) { yield return null; unlockablePrices = terminal.terminalNodes.allKeywords.First((TerminalKeyword keyword) => ((Object)keyword).name == "Buy").compatibleNouns.Where((CompatibleNoun item) => item.result.shipUnlockableID != -1 && item.result.itemCost != -1).ToDictionary((CompatibleNoun item) => item.result.shipUnlockableID, (CompatibleNoun item) => item.result.terminalOptions.First((CompatibleNoun option) => ((Object)option.noun).name == "Confirm").result.itemCost); } internal static IEnumerator TerminalSoundCooldown() { terminalSoundPlaying = true; yield return (object)new WaitForSeconds(1f); terminalSoundPlaying = false; } private static IEnumerator PlaceShipObjectCooldown(int player) { playerMovedShipObject[player] = true; yield return (object)new WaitForSeconds(1f); playerMovedShipObject[player] = false; } private static IEnumerator ReloadGunEffectsCooldown(int player) { reloadGunEffectsOnCooldown[player] = true; yield return (object)new WaitForSeconds(2.5f); reloadGunEffectsOnCooldown[player] = false; } private static IEnumerator ShipLightsCooldown() { shipLightsOnCooldown = true; yield return (object)new WaitForSeconds(0.5f); shipLightsOnCooldown = false; } private static IEnumerator BuyShipUnlockableCooldown() { buyShipUnlockableOnCooldown = true; yield return (object)new WaitForSeconds(0.5f); buyShipUnlockableOnCooldown = false; } private static IEnumerator PressTeleportButtonCooldown(ShipTeleporter instance) { pressTeleportButtonOnCooldown.Add(instance); yield return (object)new WaitForSeconds(0.65833f); pressTeleportButtonOnCooldown.Remove(instance); } private static IEnumerator ActivateItemCooldown(ulong itemNetworkId) { itemOnCooldown.Add(itemNetworkId); yield return (object)new WaitForSeconds(1f); itemOnCooldown.Remove(itemNetworkId); } private static IEnumerator KnifeSoundCooldown(ulong itemNetworkId) { knifeSoundCooldown.Add(itemNetworkId); yield return (object)new WaitForSeconds(0.43f); knifeSoundCooldown.Remove(itemNetworkId); } private static IEnumerator ServerAudioCooldown(PlayerControllerB player) { serverSoundCooldown.Add(player); yield return (object)new WaitForSeconds(0.25f); serverSoundCooldown.Remove(player); } private static IEnumerator DamageOtherPlayerCooldown(int sendingPlayer) { damagePlayerFromOtherClientOnCooldown[sendingPlayer] = true; yield return (object)new WaitForSeconds(0.65f); damagePlayerFromOtherClientOnCooldown[sendingPlayer] = false; } private static IEnumerator ShipLeverAnimationCooldown(int sendingPlayer) { shipLeverAnimationOnCooldown[sendingPlayer] = true; yield return (object)new WaitForSeconds(1f); shipLeverAnimationOnCooldown[sendingPlayer] = false; } private static IEnumerator StartGameCooldown(int sendingPlayer) { startGameOnCoolown[sendingPlayer] = true; yield return (object)new WaitForSeconds(1f); startGameOnCoolown[sendingPlayer] = false; } private static IEnumerator EndGameCooldown(int sendingPlayer) { endGameOnCoolown[sendingPlayer] = true; yield return (object)new WaitForSeconds(1f); endGameOnCoolown[sendingPlayer] = false; } private static IEnumerator ChangeLevelCooldown(int sendingPlayer) { changeLevelCooldown[sendingPlayer] = true; yield return (object)new WaitForSeconds(0.25f); changeLevelCooldown[sendingPlayer] = false; } private static IEnumerator PlayAudio1AtPositionCooldown(PlayerControllerB sendingPlayer) { playAudio1AtPositionCooldown.Add(sendingPlayer); yield return (object)new WaitForSeconds(10f); playAudio1AtPositionCooldown.Remove(sendingPlayer); } private static IEnumerator Call_UpdateAnimTriggerClientRpc_AfterOneFrame(AnimatedObjectTrigger instance, ClientRpcParams clientRpcParams) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) yield return null; HostFixesServerSendRpcs.Instance.UpdateAnimTriggerClientRpc(instance, clientRpcParams); } private static IEnumerator Call_GrabObjectClientRpc_AfterOneFrame(bool grabValidated, NetworkObjectReference grabbedObject, PlayerControllerB player, ClientRpcParams clientRpcParams) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) yield return null; HostFixesServerSendRpcs.Instance.GrabObjectClientRpc(grabValidated, grabbedObject, player, clientRpcParams); } internal static void ServerStopped(bool _) { Log.LogEvent -= InfoPanel.Instance.Log_LogEvent; InfoPanel.Instance.action.performed -= InfoPanel.Instance.ToggleVisibility; InfoPanel.Instance.action.Disable(); playerSteamNames.Clear(); SteamIdtoConnectionIdMap.Clear(); ConnectionIdtoSteamIdMap.Clear(); SteamIdtoClientIdMap.Clear(); ClientIdToSteamIdMap.Clear(); } } public static class MyPluginInfo { public const string PLUGIN_GUID = "com.github.CharlesE2.HostFixes"; public const string PLUGIN_NAME = "Host Fixes"; public const string PLUGIN_VERSION = "1.0.30"; } } namespace HostFixes.UI { internal class InfoPanel { public static InfoPanel Instance; public readonly InputAction action; private static GameObject GameObjectInstance; private readonly Text MyText; private readonly Queue logQueue = new Queue(10); private string? LastLogMessage; private int TimesRepeated = 1; private bool visible; public InfoPanel() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: 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_0194: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Expected O, but got Unknown Instance = this; GameObjectInstance = new GameObject("InfoPanel"); GameObjectInstance.transform.SetParent(GameObject.Find("Systems/UI/Canvas").transform); GameObjectInstance.transform.localPosition = Vector3.zero; GameObjectInstance.transform.localScale = new Vector3(1f, 1f, 1f); RectTransform obj = GameObjectInstance.AddComponent(); obj.anchorMin = new Vector2(0.6f, 0.6f); obj.anchorMax = new Vector2(0.943f, 0.89f); GameObjectInstance.AddComponent().SetColor(new Color(1f, 1f, 1f, 1f)); GameObjectInstance.AddComponent().blocksRaycasts = false; Font font = Font.CreateDynamicFontFromOSFont("Noto Sans", 8); MyText = GameObjectInstance.AddComponent(); if ((Object)(object)MyText != (Object)null) { MyText.font = font; MyText.fontSize = 7; MyText.text = "Host Fixes"; MyText.supportRichText = false; Plugin.Log.LogEvent += Log_LogEvent; GameObjectInstance.SetActive(visible); action = new InputAction("ToggleLogGUI", (InputActionType)0, "/f9", (string)null, (string)null, (string)null); action.performed += ToggleVisibility; action.Enable(); } else { Plugin.Log.LogError((object)"MyText is null"); } } internal void Log_LogEvent(object sender, LogEventArgs logEvent) { Log(logEvent.Data.ToString().Replace("\n", "")); } public void Log(string data) { if (LastLogMessage == data) { TimesRepeated++; } else { if (LastLogMessage != null) { if (logQueue.Count >= 9) { logQueue.Dequeue(); } logQueue.Enqueue(LastLogMessage + ((TimesRepeated > 1) ? $" x{TimesRepeated}" : "")); TimesRepeated = 1; } LastLogMessage = data; } if ((Object)(object)MyText == (Object)null) { Plugin.Log.LogError((object)"MyText is null. Can't add to GUI log."); return; } MyText.text = ""; foreach (string item in logQueue) { Text myText = MyText; myText.text = myText.text + item + "\n"; } if (LastLogMessage != null) { Text myText2 = MyText; myText2.text = myText2.text + LastLogMessage + ((TimesRepeated > 1) ? $" x{TimesRepeated}" : ""); } } public void ToggleVisibility(CallbackContext _) { visible = !visible; GameObjectInstance.SetActive(visible); } } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { public IgnoresAccessChecksToAttribute(string assemblyName) { } } }