using System; using System.CodeDom.Compiler; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.Globalization; using System.Linq; using System.Reflection; using System.Reflection.Emit; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Logging; using GameNetcodeStuff; using HarmonyLib; using LethalChatSpawner.NetcodePatcher; using LethalChatSpawner.Properties; using Microsoft.CodeAnalysis; using Unity.Netcode; using UnityEngine; using UnityEngine.AI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("LethalChatSpawner")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyCopyright("zhiyan114 © All Rights Reserved")] [assembly: AssemblyDescription("Twitch Chat Entity Spawner")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+fe789b1309d56fe6b7d40ea073e51dd65d0eb0dd")] [assembly: AssemblyProduct("LethalChatSpawner")] [assembly: AssemblyTitle("LethalChatSpawner")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: NetcodePatchedAssembly] 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; } } } namespace LethalChatSpawner { [BepInPlugin("FurryNet.lethalCommService", "lethalCommService", "1.0.1")] public class LCSMain : BaseUnityPlugin { public const string modGUID = "FurryNet.lethalCommService"; public const string modName = "lethalCommService"; public const string modVersion = "1.0.1"; public static readonly LoggerWarpper logger = new LoggerWarpper("FurryNet.lethalCommService"); private static readonly Harmony harmony = new Harmony("FurryNet.lethalCommService"); public static GameObject netPrefab; private void Awake() { Type[] types = Assembly.GetExecutingAssembly().GetTypes(); for (int i = 0; i < types.Length; i++) { MethodInfo[] methods = types[i].GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic); foreach (MethodInfo methodInfo in methods) { if (methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false).Length != 0) { methodInfo.Invoke(null, null); } } } ((ManualLogSource)logger).LogMessage((object)"RPCHandle Object Created!"); netPrefab = AssetBundle.LoadFromMemory(Resources.netcodemod).LoadAsset("Assets/InternalAssets/NetPrefab.prefab"); netPrefab.AddComponent(); netPrefab.AddComponent(); netPrefab.AddComponent(); ((ManualLogSource)logger).LogMessage((object)"lethalCommService Loaded..."); harmony.PatchAll(); } private void InitNetworkBehaviour(Type type) { MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic); foreach (MethodInfo methodInfo in methods) { if (methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false).Length != 0) { methodInfo.Invoke(null, null); } } } } [HarmonyPatch(typeof(StartOfRound))] public class ShipLandState { private static bool _onMoon; private static bool _loaded; public static bool onMoon => _onMoon; public static bool loaded => _loaded; [HarmonyPatch("OnShipLandedMiscEvents")] [HarmonyPrefix] public static void shipLanded() { _onMoon = true; ((ManualLogSource)LCSMain.logger).LogInfo((object)"Player Land On Moon"); } [HarmonyPatch("ShipHasLeft")] [HarmonyPrefix] public static void shipLeft() { _onMoon = false; RPCHandle.Instance?.cleanFakeObjects(); ((ManualLogSource)LCSMain.logger).LogInfo((object)"Player Left Moon"); } [HarmonyPatch("Start")] [HarmonyPrefix] public static void saveLoaded() { LCSLogic.syncInternalSet(); if (NetworkManager.Singleton.IsServer) { Object.Instantiate(LCSMain.netPrefab).GetComponent().Spawn(false); } ((ManualLogSource)LCSMain.logger).LogInfo((object)"Mod Initialized..."); _loaded = true; } } [HarmonyPatch(typeof(GameNetworkManager))] public class NetworkHook { [HarmonyPatch("Start")] [HarmonyPostfix] public static void NetStart(GameNetworkManager __instance) { ((ManualLogSource)LCSMain.logger).LogInfo((object)"Loading netPrefab into NetworkManager"); ((Component)__instance).GetComponent().AddNetworkPrefab(LCSMain.netPrefab); } } [HarmonyPatch(typeof(Terminal))] public class TerminalHook { public static Terminal instance; [HarmonyPatch("Awake")] [HarmonyPostfix] public static void getTerminal(Terminal __instance) { instance = __instance; } [HarmonyPatch("ParsePlayerSentence")] [HarmonyPrefix] public static bool TerminalHandle(Terminal __instance) { char[] whitelistPunc = new char[2] { '_', ',' }; string[] array = new string((from k in __instance.screenText.text.Substring(__instance.screenText.text.Length - __instance.textAdded) where !char.IsPunctuation(k) || whitelistPunc.Contains(k) select k).ToArray()).ToLower().Split(" ", StringSplitOptions.RemoveEmptyEntries); if (array.Length < 1) { return true; } if (array[0] != "lcs") { return true; } if (array.Length < 2) { string text = GeneralExtensions.Join((IEnumerable)TerminalCmd.lists.Values, (Func)delegate(TerminalCmd c) { Dictionary? argDesc = c.argDesc; return (argDesc != null && argDesc.Count > 0) ? (c.name + " " + GeneralExtensions.Join>((IEnumerable>)c.argDesc, (Func, string>)((KeyValuePair p) => p.Key), " ")) : c.name; }, "\n"); TerminalCmd.Print(__instance, "All Available Commands:\n" + text); return false; } if (!TerminalCmd.lists.TryGetValue(array[1], out TerminalCmd value)) { TerminalCmd.Print(__instance, "lcs: Bad command :("); ((ManualLogSource)LCSMain.logger).LogWarning((object)(array[1] + " is not a valid command")); return false; } string[] array2 = array.Skip(2).ToArray(); value.callfunc(__instance, array2); LCSMain.logger.LogInfo("Successfully execute command: " + array[1], new Dictionary { ["args"] = GeneralExtensions.Join((IEnumerable)array2, (Func)((string k) => k), ",") }); return false; } [HarmonyPatch("TextChanged")] [HarmonyPrefix] public static bool BypassLimit(Terminal __instance) { if ((Object)(object)__instance.currentNode != (Object)null) { __instance.currentNode.maxCharactersToType = 100; } return true; } } [HarmonyPatch(typeof(PlayerControllerB))] public class PlayerControllerHook { [HarmonyPatch("DamagePlayer")] [HarmonyTranspiler] private static IEnumerable Transpiler(IEnumerable instructions) { //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Expected O, but got Unknown //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Expected O, but got Unknown //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Expected O, but got Unknown List list = new List(instructions); MethodInfo method = typeof(Mathf).GetMethod("Clamp", new Type[3] { typeof(int), typeof(int), typeof(int) }); for (int i = 0; i < list.Count; i++) { if (CodeInstructionExtensions.Calls(list[i], method)) { list[i] = new CodeInstruction(OpCodes.Nop, (object)null); if (i - 1 >= 0) { list[i - 1] = new CodeInstruction(OpCodes.Nop, (object)null); } if (i - 2 >= 0) { list[i - 2] = new CodeInstruction(OpCodes.Nop, (object)null); } break; } } return list; } } public class LCSLogic { public static HashSet globalEnemies = new HashSet(); public static HashSet globalTraps = new HashSet(); private static List fakeItems = new List(); public static int FakeItemsCount => fakeItems.Count; public static void syncInternalSet() { EnemyType[] array = Resources.FindObjectsOfTypeAll(); foreach (EnemyType item in array) { globalEnemies.Add(item); } IndoorMapHazardType[] array2 = Resources.FindObjectsOfTypeAll(); foreach (IndoorMapHazardType val in array2) { val.prefabToSpawn.AddComponent(); globalTraps.Add(val); } ((ManualLogSource)LCSMain.logger).LogInfo((object)"All traps prefab patched with FakeObject class!"); ((ManualLogSource)LCSMain.logger).LogInfo((object)"Enemy/Trap set has been successfully synced with the global state!"); } public static void cleanFakeObjects() { if (!NetworkManager.Singleton.IsServer || fakeItems.Count == 0) { return; } foreach (GameObject fakeItem in fakeItems) { fakeItem.GetComponent().Despawn(true); } ((ManualLogSource)LCSMain.logger).LogInfo((object)$"Cleaned up {fakeItems.Count} managed objects!"); fakeItems.Clear(); } public static void spawnItem(PlayerControllerB player, Item item, bool isFake = false, int price = 0) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: 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) if (!NetworkManager.Singleton.IsServer) { return; } GameObject val = Object.Instantiate(item.spawnPrefab, Utils.SearchBestPosition(player, item.spawnPrefab, 1f), Quaternion.identity); if (isFake) { GrabbableObject[] componentsInChildren = val.GetComponentsInChildren(); for (int i = 0; i < componentsInChildren.Length; i++) { Object.Destroy((Object)(object)componentsInChildren[i]); } InteractTrigger[] componentsInChildren2 = val.GetComponentsInChildren(); for (int i = 0; i < componentsInChildren2.Length; i++) { Object.Destroy((Object)(object)componentsInChildren2[i]); } fakeItems.Add(val); } NetworkObject component = val.GetComponent(); if ((Object)(object)component == (Object)null) { ((ManualLogSource)LCSMain.logger).LogWarning((object)"Object has not network property?"); return; } component.Spawn(false); GrabbableObject componentInChildren = val.GetComponentInChildren(); if (!isFake && price > 0 && (Object)(object)componentInChildren != (Object)null) { componentInChildren.SetScrapValue(price); RoundManager.Instance.SyncScrapValuesClientRpc((NetworkObjectReference[])(object)new NetworkObjectReference[1] { new NetworkObjectReference(component) }, new int[1] { price }); } LCSMain.logger.LogInfo("Item Spawned!", new Dictionary { ["target"] = player.playerUsername, ["item"] = item.itemName, ["isFake"] = isFake, ["price"] = price }); } public static void spawnEntity(PlayerControllerB player, EnemyType enemy, bool isFake = false) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) if (NetworkManager.Singleton.IsServer) { GameObject val = Object.Instantiate(enemy.enemyPrefab, Utils.SearchBestPosition(player, enemy.enemyPrefab), Quaternion.identity); EnemyAI component = val.GetComponent(); if (isFake) { Object.Destroy((Object)(object)component); fakeItems.Add(val); } val.GetComponentInChildren().Spawn(true); if (!isFake) { RoundManager.Instance.SpawnedEnemies.Add(component); EnemyType enemyType = component.enemyType; enemyType.numberSpawned++; component.enemyType.hasSpawnedAtLeastOne = true; } else { RPCHandle.Instance.syncFakeEntityClientRpc(val.GetComponent().NetworkObjectId); } LCSMain.logger.LogInfo("Entity Spawned!", new Dictionary { ["target"] = player.playerUsername, ["item"] = enemy.enemyName, ["isFake"] = isFake }); } } public static void spawnTrap(PlayerControllerB player, IndoorMapHazardType trap, bool isFake = false) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) if (NetworkManager.Singleton.IsServer) { Vector3 val = Utils.SearchBestPosition(player, trap.prefabToSpawn); Vector3 val2 = ((Component)player).transform.position - val; val2.y = 0f; GameObject val3 = Object.Instantiate(trap.prefabToSpawn, val, Quaternion.LookRotation(((Vector3)(ref val2)).normalized), RoundManager.Instance.mapPropsContainer.transform); if (isFake) { val3.GetComponent().isFake.Value = isFake; fakeItems.Add(val3); } val3.GetComponent().Spawn(true); LCSMain.logger.LogInfo("Trap Spawned!", new Dictionary { ["target"] = player.playerUsername, ["trap"] = ((Object)trap.prefabToSpawn).name, ["isFake"] = isFake }); } } public static void changeQuota(string type, int val = 0) { if (NetworkManager.Singleton.IsServer) { TimeOfDay instance = TimeOfDay.Instance; switch (type) { case "time": instance.quotaVariables.deadlineDaysAmount = ((val > 0) ? val : 100); instance.timeUntilDeadline = (float)((val > 0) ? val : 100) * instance.totalTime; break; case "cur": instance.quotaFulfilled = ((val > 0) ? val : 9999); break; case "due": instance.profitQuota = ((val > 0) ? val : 9999); break; } RPCHandle.Instance.syncQuotaClientRpc(instance.quotaFulfilled, instance.profitQuota, instance.timeUntilDeadline); ((ManualLogSource)LCSMain.logger).LogInfo((object)$"Changed quota for {type} to {val}"); } } public static void SetBalance(int val) { if (NetworkManager.Singleton.IsServer) { Terminal val2 = Object.FindObjectOfType(); if ((Object)(object)val2 == (Object)null) { ((ManualLogSource)LCSMain.logger).LogError((object)"Terminal not found!"); return; } val2.groupCredits = val; TerminalHook.instance.SyncGroupCreditsClientRpc(val, TerminalHook.instance.numberOfItemsInDropship); ((ManualLogSource)LCSMain.logger).LogInfo((object)"Terminal Balance successfully updated!"); } } } public class FakeObject : NetworkBehaviour { public NetworkVariable isFake = new NetworkVariable(false, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public bool isReal() { return !isFake.Value; } protected override void __initializeVariables() { if (isFake == null) { throw new Exception("FakeObject.isFake cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)isFake).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)isFake, "isFake"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)isFake); ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { ((NetworkBehaviour)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "FakeObject"; } } [HarmonyPatch(typeof(Landmine))] public class LandMineHook { [HarmonyPatch("Detonate")] [HarmonyPrefix] public static bool FakeStatePatch(Landmine __instance) { //IL_0055: 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_005f: Unknown result type (might be due to invalid IL or missing references) FakeObject componentInParent = ((Component)__instance).GetComponentInParent(); if ((Object)(object)componentInParent == (Object)null || !componentInParent.isFake.Value) { return true; } __instance.mineAudio.pitch = Random.Range(0.93f, 1.07f); __instance.mineAudio.PlayOneShot(__instance.mineDetonate, 1f); Landmine.SpawnExplosion(((Component)__instance).transform.position + Vector3.up, true, 0f, 0f, 50, 0f, (GameObject)null, false); LCSMain.logger.LogDebug("Landmine Fake State: true (triggered)"); return false; } } [HarmonyPatch(typeof(SpikeRoofTrap))] internal class SpikeTrapHook { [HarmonyPatch("OnTriggerStay")] [HarmonyPrefix] public static bool FakeStatePatch(SpikeRoofTrap __instance) { FakeObject componentInParent = ((Component)__instance).GetComponentInParent(); if (!((Object)(object)componentInParent == (Object)null)) { return !componentInParent.isFake.Value; } return true; } } [HarmonyPatch(typeof(Turret))] internal class TurretTrapHook { [HarmonyPatch("CheckForPlayersInLineOfSight")] [HarmonyPostfix] private static void FakeStatePatch(Turret __instance, float radius, ref PlayerControllerB? __result) { if (radius == 3f && !((Object)(object)__result == (Object)null) && ((Component)__instance).GetComponentInParent().isFake.Value) { __result = null; } } } public class PlayerManager : NetworkBehaviour { public static PlayerManager? Instance { get; private set; } private void Awake() { Instance = this; } private void _updatePlayerStat(PlayerControllerB target, string type, int val) { switch (type) { case "health": target.health = val; break; case "speed": target.movementSpeed = val; break; case "jmpheight": target.jumpForce = val; break; case "reset": target.health = 100; target.movementSpeed = 5f; target.jumpForce = 13f; break; } } private void _setPlayerStat(PlayerControllerB target, string type, int val) { if (NetworkManager.Singleton.IsServer) { _updatePlayerStat(target, type, val); syncStatClientRpc(target.playerClientId, type, val); LCSMain.logger.LogInfo("Changed Player Stat Successfully!", new Dictionary { ["target"] = target.playerUsername, ["type"] = type, ["value"] = val }); } } public void setPlayerStat(PlayerControllerB target, string type, int val) { if (NetworkManager.Singleton.IsServer) { _setPlayerStat(target, type, val); } else { setPlayerStatServerRpc(target.playerClientId, type, val); } } [Rpc(/*Could not decode attribute arguments.*/)] private void setPlayerStatServerRpc(ulong playerid, string type, int val) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Invalid comparison between Unknown and I4 //IL_0043: 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_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: 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_0076: Unknown result type (might be due to invalid IL or missing references) //IL_009a: 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_010b: 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_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val2 = new RpcAttributeParams { RequireOwnership = false }; RpcParams val4 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(1226022596u, val4, val2, (SendTo)2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, playerid); bool flag = type != null; ((FastBufferWriter)(ref val3)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val3)).WriteValueSafe(type, false); } BytePacker.WriteValueBitPacked(val3, val); ((NetworkBehaviour)this).__endSendRpc(ref val3, 1226022596u, val4, val2, (SendTo)2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; ulong playerid2 = playerid; PlayerControllerB val5 = ((IEnumerable)StartOfRound.Instance.allPlayerScripts).FirstOrDefault((Func)((PlayerControllerB k) => k.playerClientId == playerid2)); if ((Object)(object)val5 == (Object)null) { ((ManualLogSource)LCSMain.logger).LogWarning((object)"setPlayerStatServerRpc: Attempt to match playerid, but player not found!"); } else { _setPlayerStat(val5, type, val); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void syncStatClientRpc(ulong playerid, string type, int val) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Invalid comparison between Unknown and I4 //IL_0043: 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_0051: 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_0064: 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_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val2 = default(RpcAttributeParams); RpcParams val4 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(124201922u, val4, val2, (SendTo)7, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, playerid); bool flag = type != null; ((FastBufferWriter)(ref val3)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val3)).WriteValueSafe(type, false); } BytePacker.WriteValueBitPacked(val3, val); ((NetworkBehaviour)this).__endSendRpc(ref val3, 124201922u, val4, val2, (SendTo)7, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; ulong playerid2 = playerid; PlayerControllerB val5 = ((IEnumerable)StartOfRound.Instance.allPlayerScripts).FirstOrDefault((Func)((PlayerControllerB k) => k.playerClientId == playerid2)); if ((Object)(object)val5 == (Object)null) { ((ManualLogSource)LCSMain.logger).LogWarning((object)"syncStatClientRpc: Attempt to match playerid, but player not found!"); } else { _updatePlayerStat(val5, type, val); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void requestPlrMessageServerRpc(ulong[] playerid, string header, string message, RpcParams param = default(RpcParams)) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Invalid comparison between Unknown and I4 //IL_0043: 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_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: 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_008d: 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) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_018f: 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) //IL_00de: 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_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_0116: 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_0148: 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_0221: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2903883302u, param, val, (SendTo)2, (RpcDelivery)0); bool flag = playerid != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(playerid, default(ForPrimitives)); } bool flag2 = header != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag2, default(ForPrimitives)); if (flag2) { ((FastBufferWriter)(ref val2)).WriteValueSafe(header, false); } bool flag3 = message != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag3, default(ForPrimitives)); if (flag3) { ((FastBufferWriter)(ref val2)).WriteValueSafe(message, false); } ((NetworkBehaviour)this).__endSendRpc(ref val2, 2903883302u, param, val, (SendTo)2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; ulong[] playerid2 = playerid; RpcParams param2 = param; if (playerid2.Length == 0) { ((ManualLogSource)LCSMain.logger).LogWarning((object)"requestPlrMessageServerRpc: No playerid are supplied!"); return; } PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; PlayerControllerB[] array = allPlayerScripts.Where((PlayerControllerB k) => playerid2.Contains(k.playerClientId)).ToArray(); if (array.Count() == 0) { ((ManualLogSource)LCSMain.logger).LogWarning((object)"requestPlrMessageServerRpc: No Player are found!"); return; } receivePlrMessageClientRpc(header, message, RpcParams.op_Implicit(((NetworkBehaviour)this).RpcTarget.Group(array.Select((PlayerControllerB k) => ((NetworkBehaviour)k).NetworkObject.OwnerClientId).ToArray(), (RpcTargetUse)0))); string playerUsername = ((IEnumerable)allPlayerScripts).FirstOrDefault((Func)((PlayerControllerB k) => ((NetworkBehaviour)k).NetworkObject.OwnerClientId == param2.Receive.SenderClientId)).playerUsername; string text = GeneralExtensions.Join((IEnumerable)array, (Func)((PlayerControllerB k) => k.playerUsername), ", "); LCSMain.logger.LogInfo(playerUsername + " sent " + text + " messages", new Dictionary { ["header"] = header, ["message"] = message }); } [Rpc(/*Could not decode attribute arguments.*/)] public void receivePlrMessageClientRpc(string header, string message, RpcParams param = default(RpcParams)) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Invalid comparison between Unknown and I4 //IL_0043: 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_0051: 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_0064: 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_0085: 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_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: 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_00f3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2058208831u, param, val, (SendTo)8, (RpcDelivery)0); bool flag = header != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(header, false); } bool flag2 = message != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag2, default(ForPrimitives)); if (flag2) { ((FastBufferWriter)(ref val2)).WriteValueSafe(message, false); } ((NetworkBehaviour)this).__endSendRpc(ref val2, 2058208831u, param, val, (SendTo)8, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; HUDManager.Instance.DisplayTip(header, message, false, false, "LC_Tip1"); } } private void _teleportPlayer(PlayerControllerB playerA, PlayerControllerB playerB) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) if (NetworkManager.Singleton.IsServer) { playerA.TeleportPlayer(((Component)playerB).transform.position, false, 0f, false, true); syncTpPlayerClientRpc(playerA.playerClientId, playerB.playerClientId); ((ManualLogSource)LCSMain.logger).LogInfo((object)("Server teleported " + playerA.playerUsername + " to " + playerB.playerUsername + "!")); } } public void teleportPlayer(PlayerControllerB playerA, PlayerControllerB playerB) { if (NetworkManager.Singleton.IsServer) { _teleportPlayer(playerA, playerB); } else { teleportPlayerServerRpc(playerA.playerClientId, playerB.playerClientId); } } public string? tpPlayerValidation(PlayerControllerB playerA, PlayerControllerB playerB) { if (playerA.playerClientId == playerB.playerClientId) { return "You cannot teleport a player to themselves"; } if (playerA.isInsideFactory != playerB.isInsideFactory) { return playerA.playerUsername + " and " + playerA.playerUsername + " are not in the same area (in-door plr can only tp to in-door plr and vice versa)"; } if (!Utils.isPlayerConnected(playerA) || !Utils.isPlayerConnected(playerB)) { return playerA.playerUsername + " or " + playerB.playerUsername + " may be disconnected from the game during tp process"; } if (playerA.isPlayerDead || playerB.isPlayerDead) { return $"You cannot teleport (to) dead players {playerA.playerUsername}:{playerA.isPlayerDead} or {playerB.playerUsername}:{playerB.isPlayerDead}"; } return null; } [Rpc(/*Could not decode attribute arguments.*/)] private void teleportPlayerServerRpc(ulong playeridA, ulong playeridB) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_0043: 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_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: 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_0076: 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_009b: 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_00cd: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3895270059u, val3, val, (SendTo)2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playeridA); BytePacker.WriteValueBitPacked(val2, playeridB); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3895270059u, val3, val, (SendTo)2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; ulong playeridA2 = playeridA; ulong playeridB2 = playeridB; PlayerControllerB val4 = ((IEnumerable)StartOfRound.Instance.allPlayerScripts).FirstOrDefault((Func)((PlayerControllerB k) => k.playerClientId == playeridA2)); PlayerControllerB val5 = ((IEnumerable)StartOfRound.Instance.allPlayerScripts).FirstOrDefault((Func)((PlayerControllerB k) => k.playerClientId == playeridB2)); if ((Object)(object)val4 == (Object)null || (Object)(object)val5 == (Object)null) { ((ManualLogSource)LCSMain.logger).LogWarning((object)$"Either targets are not found -> A: {val4} | B: {val5}"); return; } string text = tpPlayerValidation(val4, val5); if (text != null) { ((ManualLogSource)LCSMain.logger).LogWarning((object)("Player Teleportation Failed -> " + text)); } else { _teleportPlayer(val4, val5); } } [Rpc(/*Could not decode attribute arguments.*/)] private void syncTpPlayerClientRpc(ulong playeridA, ulong playeridB) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_0043: 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_0051: 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_0064: 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_0075: 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_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(488402402u, val3, val, (SendTo)7, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playeridA); BytePacker.WriteValueBitPacked(val2, playeridB); ((NetworkBehaviour)this).__endSendRpc(ref val2, 488402402u, val3, val, (SendTo)7, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; ulong playeridA2 = playeridA; ulong playeridB2 = playeridB; PlayerControllerB? obj = ((IEnumerable)StartOfRound.Instance.allPlayerScripts).FirstOrDefault((Func)((PlayerControllerB k) => k.playerClientId == playeridA2)); PlayerControllerB val4 = ((IEnumerable)StartOfRound.Instance.allPlayerScripts).FirstOrDefault((Func)((PlayerControllerB k) => k.playerClientId == playeridB2)); obj.TeleportPlayer(((Component)val4).transform.position, false, 0f, false, true); } } private void _killPlayer(PlayerControllerB player) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) if (NetworkManager.Singleton.IsServer) { player.KillPlayer(Vector3.zero, true, (CauseOfDeath)0, 0, default(Vector3), false); syncKillPlayerClientRpc(player.playerClientId); ((ManualLogSource)LCSMain.logger).LogInfo((object)("Killed player " + player.playerUsername + "!")); } } public void killPlayer(PlayerControllerB player) { if (NetworkManager.Singleton.IsServer) { _killPlayer(player); } else { killPlayerServerRPC(player.playerClientId); } } [Rpc(/*Could not decode attribute arguments.*/)] private void killPlayerServerRPC(ulong playeridA) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_0043: 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_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: 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_0076: 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_0092: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1488204687u, val3, val, (SendTo)2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playeridA); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1488204687u, val3, val, (SendTo)2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; ulong playeridA2 = playeridA; PlayerControllerB val4 = ((IEnumerable)StartOfRound.Instance.allPlayerScripts).FirstOrDefault((Func)((PlayerControllerB k) => k.playerClientId == playeridA2)); if ((Object)(object)val4 == (Object)null) { ((ManualLogSource)LCSMain.logger).LogWarning((object)"Player not found!"); } else if (val4.isPlayerDead) { ((ManualLogSource)LCSMain.logger).LogWarning((object)"Cannot kill dead player!"); } else { _killPlayer(val4); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void syncKillPlayerClientRpc(ulong playerid) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_0043: 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_0051: 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_0064: 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_0080: 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_00b2: 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) //IL_00e9: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(36225306u, val3, val, (SendTo)7, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerid); ((NetworkBehaviour)this).__endSendRpc(ref val2, 36225306u, val3, val, (SendTo)7, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; ulong playerid2 = playerid; ((IEnumerable)StartOfRound.Instance.allPlayerScripts).FirstOrDefault((Func)((PlayerControllerB k) => k.playerClientId == playerid2)).KillPlayer(Vector3.zero, true, (CauseOfDeath)0, 0, default(Vector3), false); } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(1226022596u, new RpcReceiveHandler(__rpc_handler_1226022596), "setPlayerStatServerRpc"); ((NetworkBehaviour)this).__registerRpc(124201922u, new RpcReceiveHandler(__rpc_handler_124201922), "syncStatClientRpc"); ((NetworkBehaviour)this).__registerRpc(2903883302u, new RpcReceiveHandler(__rpc_handler_2903883302), "requestPlrMessageServerRpc"); ((NetworkBehaviour)this).__registerRpc(2058208831u, new RpcReceiveHandler(__rpc_handler_2058208831), "receivePlrMessageClientRpc"); ((NetworkBehaviour)this).__registerRpc(3895270059u, new RpcReceiveHandler(__rpc_handler_3895270059), "teleportPlayerServerRpc"); ((NetworkBehaviour)this).__registerRpc(488402402u, new RpcReceiveHandler(__rpc_handler_488402402), "syncTpPlayerClientRpc"); ((NetworkBehaviour)this).__registerRpc(1488204687u, new RpcReceiveHandler(__rpc_handler_1488204687), "killPlayerServerRPC"); ((NetworkBehaviour)this).__registerRpc(36225306u, new RpcReceiveHandler(__rpc_handler_36225306), "syncKillPlayerClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_1226022596(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: 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_007b: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong playerid = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref playerid); bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string type = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref type, false); } int val = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref val); target.__rpc_exec_stage = (__RpcExecStage)1; ((PlayerManager)(object)target).setPlayerStatServerRpc(playerid, type, val); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_124201922(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: 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_007b: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong playerid = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref playerid); bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string type = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref type, false); } int val = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref val); target.__rpc_exec_stage = (__RpcExecStage)1; ((PlayerManager)(object)target).syncStatClientRpc(playerid, type, val); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2903883302(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: 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) //IL_0074: 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_0058: 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_00ac: 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_00d8: 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_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); ulong[] playerid = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref playerid, default(ForPrimitives)); } bool flag2 = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag2, default(ForPrimitives)); string header = null; if (flag2) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref header, false); } bool flag3 = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag3, default(ForPrimitives)); string message = null; if (flag3) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref message, false); } RpcParams ext = rpcParams.Ext; target.__rpc_exec_stage = (__RpcExecStage)1; ((PlayerManager)(object)target).requestPlrMessageServerRpc(playerid, header, message, ext); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2058208831(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: 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) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006d: 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) //IL_0094: 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_00a3: 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_00c5: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string header = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref header, false); } bool flag2 = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag2, default(ForPrimitives)); string message = null; if (flag2) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref message, false); } RpcParams ext = rpcParams.Ext; target.__rpc_exec_stage = (__RpcExecStage)1; ((PlayerManager)(object)target).receivePlrMessageClientRpc(header, message, ext); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3895270059(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong playeridA = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref playeridA); ulong playeridB = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref playeridB); target.__rpc_exec_stage = (__RpcExecStage)1; ((PlayerManager)(object)target).teleportPlayerServerRpc(playeridA, playeridB); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_488402402(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong playeridA = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref playeridA); ulong playeridB = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref playeridB); target.__rpc_exec_stage = (__RpcExecStage)1; ((PlayerManager)(object)target).syncTpPlayerClientRpc(playeridA, playeridB); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1488204687(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong playeridA = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref playeridA); target.__rpc_exec_stage = (__RpcExecStage)1; ((PlayerManager)(object)target).killPlayerServerRPC(playeridA); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_36225306(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong playerid = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref playerid); target.__rpc_exec_stage = (__RpcExecStage)1; ((PlayerManager)(object)target).syncKillPlayerClientRpc(playerid); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "PlayerManager"; } } public class RPCHandle : NetworkBehaviour { public static RPCHandle? Instance { get; private set; } private void Awake() { Instance = this; } public void cleanFakeObjects() { if (NetworkManager.Singleton.IsServer) { LCSLogic.cleanFakeObjects(); } else { cleanFakeObjectsServerRpc(); } } [Rpc(/*Could not decode attribute arguments.*/)] public void cleanFakeObjectsServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Invalid comparison between Unknown and I4 //IL_0043: 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_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: 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) //IL_008f: 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) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false, Delivery = (RpcDelivery)0 }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2809671309u, val3, val, (SendTo)2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2809671309u, val3, val, (SendTo)2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; LCSLogic.cleanFakeObjects(); } } } public void spawnItem(PlayerControllerB player, Item item, bool isFake = false, int price = 0) { if (NetworkManager.Singleton.IsServer) { LCSLogic.spawnItem(player, item, isFake, price); } else { spawnItemServerRpc(player.playerClientId, item.itemName, isFake, price); } } [Rpc(/*Could not decode attribute arguments.*/)] private void spawnItemServerRpc(ulong playerID, string itemName, bool isFake, int price) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Invalid comparison between Unknown and I4 //IL_0043: 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_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: 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) //IL_0084: 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_00ae: 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_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false, Delivery = (RpcDelivery)0 }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3809075062u, val3, val, (SendTo)2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerID); bool flag = itemName != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(itemName, false); } ((FastBufferWriter)(ref val2)).WriteValueSafe(ref isFake, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val2, price); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3809075062u, val3, val, (SendTo)2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; ulong playerID2 = playerID; string itemName2 = itemName; PlayerControllerB val4 = ((IEnumerable)StartOfRound.Instance.allPlayerScripts).FirstOrDefault((Func)((PlayerControllerB k) => k.playerClientId == playerID2)); if (!Object.op_Implicit((Object)(object)val4)) { ((ManualLogSource)LCSMain.logger).LogWarning((object)("Player " + val4.playerUsername + " left before spawnItemRPC processes them!")); return; } Item item = StartOfRound.Instance.allItemsList.itemsList.Find((Item k) => k.itemName == itemName2); LCSLogic.spawnItem(val4, item, isFake, price); } public void spawnEntity(PlayerControllerB player, EnemyType enemy, bool isFake = false) { if (NetworkManager.Singleton.IsServer) { LCSLogic.spawnEntity(player, enemy, isFake); } else { spawnEntityServerRpc(player.playerClientId, enemy.enemyName, isFake); } } [Rpc(/*Could not decode attribute arguments.*/)] private void spawnEntityServerRpc(ulong playerID, string entityName, bool isFake) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Invalid comparison between Unknown and I4 //IL_0043: 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_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: 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) //IL_0084: 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_00ae: 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_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false, Delivery = (RpcDelivery)0 }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1364047745u, val3, val, (SendTo)2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerID); bool flag = entityName != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(entityName, false); } ((FastBufferWriter)(ref val2)).WriteValueSafe(ref isFake, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1364047745u, val3, val, (SendTo)2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; ulong playerID2 = playerID; string entityName2 = entityName; PlayerControllerB val4 = ((IEnumerable)StartOfRound.Instance.allPlayerScripts).FirstOrDefault((Func)((PlayerControllerB k) => k.playerClientId == playerID2)); if (!Object.op_Implicit((Object)(object)val4)) { ((ManualLogSource)LCSMain.logger).LogWarning((object)("Player " + val4.playerUsername + " left before spawnEntityRPC processes them!")); return; } EnemyType enemy = ((IEnumerable)LCSLogic.globalEnemies).FirstOrDefault((Func)((EnemyType k) => k.enemyName == entityName2)); LCSLogic.spawnEntity(val4, enemy, isFake); } [Rpc(/*Could not decode attribute arguments.*/)] public void syncFakeEntityClientRpc(ulong netObjId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_0043: 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_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: 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_0076: 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_0092: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { DeferLocal = true }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1575146857u, val3, val, (SendTo)7, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, netObjId); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1575146857u, val3, val, (SendTo)7, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; Object.Destroy((Object)(object)((Component)NetworkManager.Singleton.SpawnManager.SpawnedObjects.GetValueOrDefault(netObjId)).GetComponentInParent()); } } } public void spawnTrap(PlayerControllerB player, IndoorMapHazardType trap, bool isFake = false) { if (NetworkManager.Singleton.IsServer) { LCSLogic.spawnTrap(player, trap, isFake); } else { spawnTrapServerRpc(player.playerClientId, ((Object)trap.prefabToSpawn).name, isFake); } } [Rpc(/*Could not decode attribute arguments.*/)] private void spawnTrapServerRpc(ulong playerID, string trapName, bool isFake) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Invalid comparison between Unknown and I4 //IL_0043: 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_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: 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) //IL_0084: 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_00ae: 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_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false, Delivery = (RpcDelivery)0 }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(112801681u, val3, val, (SendTo)2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerID); bool flag = trapName != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(trapName, false); } ((FastBufferWriter)(ref val2)).WriteValueSafe(ref isFake, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 112801681u, val3, val, (SendTo)2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; ulong playerID2 = playerID; string trapName2 = trapName; PlayerControllerB val4 = ((IEnumerable)StartOfRound.Instance.allPlayerScripts).FirstOrDefault((Func)((PlayerControllerB k) => k.playerClientId == playerID2)); if (!Object.op_Implicit((Object)(object)val4)) { ((ManualLogSource)LCSMain.logger).LogWarning((object)("Player " + val4.playerUsername + " left before spawnTrapServerRpc processes them!")); return; } IndoorMapHazardType trap = ((IEnumerable)LCSLogic.globalTraps).FirstOrDefault((Func)((IndoorMapHazardType k) => ((Object)k.prefabToSpawn).name == trapName2)); LCSLogic.spawnTrap(val4, trap, isFake); } [Rpc(/*Could not decode attribute arguments.*/)] public void SetBalanceServerRpc(int val) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Invalid comparison between Unknown and I4 //IL_0043: 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_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: 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) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_009c: 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_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val2 = new RpcAttributeParams { RequireOwnership = false, Delivery = (RpcDelivery)0 }; RpcParams val4 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(1919069433u, val4, val2, (SendTo)2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, val); ((NetworkBehaviour)this).__endSendRpc(ref val3, 1919069433u, val4, val2, (SendTo)2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; LCSLogic.SetBalance(val); } } } public void changeQuota(string type, int val = 0) { if (NetworkManager.Singleton.IsServer) { LCSLogic.changeQuota(type, val); } else { changeQuotaServerRpc(type, val); } } [Rpc(/*Could not decode attribute arguments.*/)] private void changeQuotaServerRpc(string type, int val) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Invalid comparison between Unknown and I4 //IL_0043: 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_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: 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) //IL_009b: 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_010c: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00da: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val2 = new RpcAttributeParams { RequireOwnership = false, Delivery = (RpcDelivery)0 }; RpcParams val4 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(3440560243u, val4, val2, (SendTo)2, (RpcDelivery)0); bool flag = type != null; ((FastBufferWriter)(ref val3)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val3)).WriteValueSafe(type, false); } BytePacker.WriteValueBitPacked(val3, val); ((NetworkBehaviour)this).__endSendRpc(ref val3, 3440560243u, val4, val2, (SendTo)2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; LCSLogic.changeQuota(type, val); } } [Rpc(/*Could not decode attribute arguments.*/)] public void syncQuotaClientRpc(int Fulfilled, int reqQuota, float time) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Invalid comparison between Unknown and I4 //IL_0043: 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_0051: 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_0064: 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_0075: 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_0094: 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_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2531536283u, val3, val, (SendTo)7, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, Fulfilled); BytePacker.WriteValueBitPacked(val2, reqQuota); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref time, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2531536283u, val3, val, (SendTo)7, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; TimeOfDay instance = TimeOfDay.Instance; instance.quotaVariables.deadlineDaysAmount = (int)time; instance.timeUntilDeadline = time; instance.quotaFulfilled = Fulfilled; instance.profitQuota = reqQuota; instance.UpdateProfitQuotaCurrentTime(); } } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(2809671309u, new RpcReceiveHandler(__rpc_handler_2809671309), "cleanFakeObjectsServerRpc"); ((NetworkBehaviour)this).__registerRpc(3809075062u, new RpcReceiveHandler(__rpc_handler_3809075062), "spawnItemServerRpc"); ((NetworkBehaviour)this).__registerRpc(1364047745u, new RpcReceiveHandler(__rpc_handler_1364047745), "spawnEntityServerRpc"); ((NetworkBehaviour)this).__registerRpc(1575146857u, new RpcReceiveHandler(__rpc_handler_1575146857), "syncFakeEntityClientRpc"); ((NetworkBehaviour)this).__registerRpc(112801681u, new RpcReceiveHandler(__rpc_handler_112801681), "spawnTrapServerRpc"); ((NetworkBehaviour)this).__registerRpc(1919069433u, new RpcReceiveHandler(__rpc_handler_1919069433), "SetBalanceServerRpc"); ((NetworkBehaviour)this).__registerRpc(3440560243u, new RpcReceiveHandler(__rpc_handler_3440560243), "changeQuotaServerRpc"); ((NetworkBehaviour)this).__registerRpc(2531536283u, new RpcReceiveHandler(__rpc_handler_2531536283), "syncQuotaClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_2809671309(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((RPCHandle)(object)target).cleanFakeObjectsServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3809075062(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: 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) //IL_007a: 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_0096: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong playerID = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string itemName = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref itemName, false); } bool isFake = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref isFake, default(ForPrimitives)); int price = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref price); target.__rpc_exec_stage = (__RpcExecStage)1; ((RPCHandle)(object)target).spawnItemServerRpc(playerID, itemName, isFake, price); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1364047745(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: 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) //IL_007a: 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_00ab: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong playerID = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string entityName = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref entityName, false); } bool isFake = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref isFake, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((RPCHandle)(object)target).spawnEntityServerRpc(playerID, entityName, isFake); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1575146857(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong netObjId = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref netObjId); target.__rpc_exec_stage = (__RpcExecStage)1; ((RPCHandle)(object)target).syncFakeEntityClientRpc(netObjId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_112801681(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: 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) //IL_007a: 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_00ab: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong playerID = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string trapName = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref trapName, false); } bool isFake = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref isFake, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((RPCHandle)(object)target).spawnTrapServerRpc(playerID, trapName, isFake); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1919069433(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int balanceServerRpc = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref balanceServerRpc); target.__rpc_exec_stage = (__RpcExecStage)1; ((RPCHandle)(object)target).SetBalanceServerRpc(balanceServerRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3440560243(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: 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) //IL_005b: 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_008c: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string type = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref type, false); } int val = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref val); target.__rpc_exec_stage = (__RpcExecStage)1; ((RPCHandle)(object)target).changeQuotaServerRpc(type, val); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2531536283(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: 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_004f: 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_0080: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int fulfilled = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref fulfilled); int reqQuota = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref reqQuota); float time = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref time, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((RPCHandle)(object)target).syncQuotaClientRpc(fulfilled, reqQuota, time); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "RPCHandle"; } } public class PingUtil : NetworkBehaviour { public static PingUtil? Instance { get; private set; } private void Awake() { Instance = this; } [Rpc(/*Could not decode attribute arguments.*/)] public void pingServerRpc(long timestamp, RpcParams rpcParams = default(RpcParams)) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Invalid comparison between Unknown and I4 //IL_0043: 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_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: 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) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_009c: 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_00ce: 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) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false, Delivery = (RpcDelivery)0 }; FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2794012454u, rpcParams, val, (SendTo)2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, timestamp); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2794012454u, rpcParams, val, (SendTo)2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; pongClientRpc(timestamp, RpcParams.op_Implicit(((NetworkBehaviour)this).RpcTarget.Single(rpcParams.Receive.SenderClientId, (RpcTargetUse)0))); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void pongClientRpc(long timestamp, RpcParams rpcParams = default(RpcParams)) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_0043: 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_005a: 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_006d: 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_0076: 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_0092: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { Delivery = (RpcDelivery)0 }; FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3356602659u, rpcParams, val, (SendTo)8, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, timestamp); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3356602659u, rpcParams, val, (SendTo)8, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; TerminalCmd.Print(Object.FindObjectOfType(), $"Done, took: {DateTimeOffset.UtcNow.ToUnixTimeMilliseconds() - timestamp}ms!", cleartext: false); } } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(2794012454u, new RpcReceiveHandler(__rpc_handler_2794012454), "pingServerRpc"); ((NetworkBehaviour)this).__registerRpc(3356602659u, new RpcReceiveHandler(__rpc_handler_3356602659), "pongClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_2794012454(NetworkBehaviour? target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: 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_004f: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { long timestamp = default(long); ByteUnpacker.ReadValueBitPacked(reader, ref timestamp); RpcParams ext = rpcParams.Ext; target.__rpc_exec_stage = (__RpcExecStage)1; ((PingUtil)(object)target).pingServerRpc(timestamp, ext); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3356602659(NetworkBehaviour? target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: 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_004f: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { long timestamp = default(long); ByteUnpacker.ReadValueBitPacked(reader, ref timestamp); RpcParams ext = rpcParams.Ext; target.__rpc_exec_stage = (__RpcExecStage)1; ((PingUtil)(object)target).pongClientRpc(timestamp, ext); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string? __getTypeName() { return "PingUtil"; } } public class TerminalCmd { public static Dictionary lists = new Dictionary { ["help"] = new TerminalCmd { name = "help", description = "Show command description and arg usages", argDesc = new Dictionary { [""] = "Command Name to show help for" }, callfunc = delegate(Terminal t, string[] args) { TerminalCmd value; if (args.Length == 0) { Print(t, "Please specify command name to show help for!"); } else if (!lists.TryGetValue(args[0], out value)) { Print(t, "The command you specified doesnt exist!"); } else { string[] obj = new string[5] { value.name, "\n------------------------------------\n", value.description, "\n\nArgs:\n", null }; Dictionary? dictionary = value.argDesc; obj[4] = ((dictionary != null && dictionary.Count > 0) ? GeneralExtensions.Join>((IEnumerable>)value.argDesc, (Func, string>)((KeyValuePair a) => a.Key + " - " + a.Value), "\n") : "No args available"); string text = string.Concat(obj); Print(t, text); } } }, ["debug"] = new TerminalCmd { name = "debug", description = "Get mod internal state for debug purpose", callfunc = delegate(Terminal t, string[] _) { Print(t, $"Loaded: {ShipLandState.loaded}\nonMoon: {ShipLandState.onMoon}\nManaged Object Count: {LCSLogic.FakeItemsCount}"); } }, ["ping"] = new TerminalCmd { name = "ping", description = "Test Unity RPC Communication!", callfunc = delegate(Terminal t, string[] _) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) Print(t, "Pinging..."); PingUtil.Instance.pingServerRpc(DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()); } }, ["list"] = new TerminalCmd { name = "list", description = "Show a list of actionable entity, item, or player names", argDesc = new Dictionary { [""] = "Whether to show the list for grabbable [item], spawnable [entity], actionable [player], or spawnable [trap]" }, callfunc = delegate(Terminal t, string[] args) { if (args.Length == 0) { Print(t, "Please choose a list you want to see, either item, entity, player, or trap"); } else { switch (args[0]) { case "entity": { string text = "Available Monster to spawn\n-----------------------------------------\nNote that spawning indoor enemy outside of the facility and vice versa may break discovery state\n\nIndoor: " + GeneralExtensions.Join(LCSLogic.globalEnemies.Where((EnemyType c) => !c.isOutsideEnemy), (Func)((EnemyType c) => c.enemyName), ", ") + "\n\nOutdoor: " + GeneralExtensions.Join(LCSLogic.globalEnemies.Where((EnemyType c) => c.isOutsideEnemy), (Func)((EnemyType c) => c.enemyName), ", ") + "\n\n"; Print(t, text); break; } case "item": Print(t, "Available Items to spawn: " + GeneralExtensions.Join((IEnumerable)StartOfRound.Instance.allItemsList.itemsList, (Func)((Item c) => c.itemName), ", ")); break; case "player": { string text2 = GeneralExtensions.Join(StartOfRound.Instance.allPlayerScripts.Where((PlayerControllerB c) => Utils.isPlayerConnected(c)), (Func)delegate(PlayerControllerB c) { List list = new List(); if (c.isPlayerDead) { list.Add("dead"); } if (c.isInsideFactory) { list.Add("indoor"); } return (list.Count != 0) ? (c.playerUsername + " (" + string.Join(",", list) + ")") : c.playerUsername; }, "\n"); Print(t, "Available Players to execute on:\n" + text2); break; } case "trap": Print(t, "Available Traps to spawn: " + GeneralExtensions.Join((IEnumerable)LCSLogic.globalTraps, (Func)((IndoorMapHazardType c) => ((Object)c.prefabToSpawn).name), ", ")); break; default: Print(t, args[0] + " is not a valid list!"); break; } } } }, ["spawnitem"] = new TerminalCmd { name = "spawnitem", description = "Spawn interactable-type item next to a given player", argDesc = new Dictionary { [""] = "Player username to run the command on (can be partially completed and return first one if multiple shares same partial). Input 'me' for self.", [""] = "Item to spawn next to a given player (support partial completion)", ["[value]"] = "Spawn item with specific scrap value (default: 0)", ["[isFake]"] = "Whether to spawn fake item or not (fake items are not interactable by the users). Input 1 for true!" }, callfunc = delegate(Terminal t, string[] args) { if (args.Length < 2) { Print(t, $"Missing args! 2 is required but got {args.Length}"); } else { bool flag = args.Length > 3 && args[3] == "1"; string partialPlayerName = args[0].ToLower(); string partialItemName = new string((from k in args[1].ToLower() select (k == '_') ? ' ' : k).ToArray()); int result = 0; if (args.Length > 2 && !int.TryParse(args[2], out result)) { Print(t, "Invalid Scrap value set!"); } else { PlayerControllerB val = (PlayerControllerB)((partialPlayerName == "me") ? ((object)GameNetworkManager.Instance.localPlayerController) : ((object)((IEnumerable)StartOfRound.Instance.allPlayerScripts).FirstOrDefault((Func)((PlayerControllerB k) => k.playerUsername.ToLower().StartsWith(partialPlayerName))))); if ((Object)(object)val == (Object)null || !Utils.isPlayerConnected(val)) { Print(t, "Target Player Not Found!"); } else if (val.isPlayerDead) { Print(t, "Target Player is already dead!"); } else { Item val2 = StartOfRound.Instance.allItemsList.itemsList.Find((Item k) => k.itemName.ToLower().StartsWith(partialItemName)); if ((Object)(object)val2 == (Object)null) { Print(t, "Item Not Found!"); } else { RPCHandle.Instance.spawnItem(val, val2, flag, result); Print(t, "Spawned " + (flag ? "fake" : "real") + " item (" + val2.itemName + ") near " + val.playerUsername); } } } } } }, ["spawnentity"] = new TerminalCmd { name = "spawnentity", description = "Spawn map entity next to a given player", argDesc = new Dictionary { [""] = "Player username to run the command on (can be partially completed and return first one if multiple shares same partial). Type 'me' for self.", [""] = "Item to spawn next to a given player (support partial completion) OR type 'all' to spawn all possible entity to target", ["[isFake]"] = "Whether to spawn fake entity or not (fake entity will not move/attack players). Input 1 for true!" }, callfunc = delegate(Terminal t, string[] args) { if (!ShipLandState.onMoon) { Print(t, "Entity spawning only works when you landed the ship to allow game to auto-cleanup entity (and prevent potential undefined behavior lol)."); } else if (args.Length < 2) { Print(t, $"Missing args! 2 is required but got {args.Length}"); } else { bool flag = args.Length > 2 && args[2] == "1"; string partialPlayerName = args[0].ToLower(); string partialEntityName = new string((from k in args[1].ToLower() select (k == '_') ? ' ' : k).ToArray()); PlayerControllerB val = (PlayerControllerB)((partialPlayerName == "me") ? ((object)GameNetworkManager.Instance.localPlayerController) : ((object)((IEnumerable)StartOfRound.Instance.allPlayerScripts).FirstOrDefault((Func)((PlayerControllerB k) => k.playerUsername.ToLower().StartsWith(partialPlayerName))))); if ((Object)(object)val == (Object)null || !Utils.isPlayerConnected(val)) { Print(t, "Target Player Not Found!"); } else if (val.isPlayerDead) { Print(t, "Target Player is already dead!"); } else if (partialEntityName == "all") { foreach (EnemyType globalEnemy in LCSLogic.globalEnemies) { RPCHandle.Instance.spawnEntity(val, globalEnemy, flag); } Print(t, "Spawned " + (flag ? "fake" : "real") + " entity (all from the list) near " + val.playerUsername); } else { EnemyType val2 = ((IEnumerable)LCSLogic.globalEnemies).FirstOrDefault((Func)((EnemyType k) => k.enemyName.ToLower().StartsWith(partialEntityName))); if ((Object)(object)val2 == (Object)null) { Print(t, "Entity Not Found!"); } else { RPCHandle.Instance.spawnEntity(val, val2, flag); Print(t, "Spawned " + (flag ? "fake" : "real") + " entity (" + val2.enemyName + ") near " + val.playerUsername); } } } } }, ["spawntrap"] = new TerminalCmd { name = "spawntrap", description = "Spawn indoor trap near the target", argDesc = new Dictionary { [""] = "Player username to run the command on (can be partially completed and return first one if multiple shares same partial). Input 'me' for self.", [""] = "Trap to spawn next to a given player (support partial completion)", ["[isFake]"] = "Whether to spawn fake trap or not (fake traps are real but do zero damage). Input 1 for true!" }, callfunc = delegate(Terminal t, string[] args) { if (args.Length < 2) { Print(t, $"Missing args! 2 is required but got {args.Length}"); } else if (!ShipLandState.onMoon) { Print(t, "Trap spawning only works when you landed the ship to allow game to auto-cleanup entity (and prevent potential undefined behavior lol)."); } else { bool flag = args.Length > 2 && args[2] == "1"; string partialPlayerName = args[0].ToLower(); string partialTrapName = new string((from k in args[1].ToLower() select (k == '_') ? ' ' : k).ToArray()); PlayerControllerB val = (PlayerControllerB)((partialPlayerName == "me") ? ((object)GameNetworkManager.Instance.localPlayerController) : ((object)((IEnumerable)StartOfRound.Instance.allPlayerScripts).FirstOrDefault((Func)((PlayerControllerB k) => k.playerUsername.ToLower().StartsWith(partialPlayerName))))); if ((Object)(object)val == (Object)null || !Utils.isPlayerConnected(val)) { Print(t, "Target Player Not Found!"); } else if (val.isPlayerDead) { Print(t, "Target Player is already dead!"); } else { IndoorMapHazardType val2 = ((IEnumerable)LCSLogic.globalTraps).FirstOrDefault((Func)((IndoorMapHazardType k) => ((Object)k.prefabToSpawn).name.ToLower().StartsWith(partialTrapName))); if ((Object)(object)val2 == (Object)null) { Print(t, "Trap Not Found!"); } else { RPCHandle.Instance.spawnTrap(val, val2, flag); Print(t, "Spawned " + (flag ? "fake" : "real") + " trap (" + ((Object)val2.prefabToSpawn).name + ") near " + val.playerUsername); } } } } }, ["cleanup"] = new TerminalCmd { name = "cleanup", description = "Cleanup LCS managed unity objects (such as fake items/entity)", callfunc = delegate(Terminal t, string[] _) { RPCHandle.Instance.cleanFakeObjects(); Print(t, "Successfully cleaned LCS managed objects!"); } }, ["setbalance"] = new TerminalCmd { name = "setbalance", description = "Set your spendable shop balance", argDesc = new Dictionary { ["[balance]"] = "Set a custom balance instead of fixed large value" }, callfunc = delegate(Terminal t, string[] args) { int result = 999999; if (args.Length != 0 && int.TryParse(args[0], out result)) { LCSMain.logger.LogDebug("User Specified setbalance!"); } if (NetworkManager.Singleton.IsServer) { LCSLogic.SetBalance(result); } else { RPCHandle.Instance.SetBalanceServerRpc(result); } Print(t, $"Successfully changed credit to {result}!"); } }, ["setquota"] = new TerminalCmd { name = "setquota", description = "Change the game quota parameters", argDesc = new Dictionary { [""] = "Choose the type of quota to change: time (days to complete quota), cur (Total fulfilled amount), or due (required quota to complete fulfillment)", ["[amount]"] = "Default value is 9999 for cur and due and 100 for time" }, callfunc = delegate(Terminal t, string[] args) { if (args.Length == 0) { Print(t, "Please choose the type of quota to modify"); } else { int result = 0; if (args.Length > 1) { int.TryParse(args[1], out result); } switch (args[0]) { default: Print(t, "Invalid type of quota, choose: time, cur, or due"); break; case "time": case "cur": case "due": RPCHandle.Instance.changeQuota(args[0], result); Print(t, "Successfully Change the quota"); break; } } } }, ["setplrstat"] = new TerminalCmd { name = "setplrstat", description = "Change player control stats", argDesc = new Dictionary { [""] = "Type of stats to change: health, speed, jmpheight (Jump Power), or reset (reset all stats to default)", [""] = "Player to take action on (support partial completion). Input 'me' for self.", ["[value]"] = "Customize the stat value (default value: 100 for health, 5 for speed, and 13 jumpheight)" }, callfunc = delegate(Terminal t, string[] args) { if (args.Length < 2) { Print(t, $"Require 2 args, received: {args.Length}. Refer to help for usages!"); } else { string text = args[0].ToLower(); string partialPlayerUsername = args[1].ToLower(); int result = 0; if (args.Length > 2 && !int.TryParse(args[2], out result)) { Print(t, "Non-numerical [value] arg provided. Try again!"); } else { switch (text) { case "health": result = ((result > 0) ? result : 100); break; case "speed": result = ((result > 0) ? result : 5); break; case "jmpheight": result = ((result > 0) ? result : 13); break; case "reset": result = 1; break; default: Print(t, "Invalid stat change type, choose: health, speed, or jmpheight"); break; } PlayerControllerB val = (PlayerControllerB)((partialPlayerUsername == "me") ? ((object)GameNetworkManager.Instance.localPlayerController) : ((object)((IEnumerable)StartOfRound.Instance.allPlayerScripts).FirstOrDefault((Func)((PlayerControllerB k) => k.playerUsername.ToLower().StartsWith(partialPlayerUsername))))); if ((Object)(object)val == (Object)null) { Print(t, "Your selected target player is not found!"); } else { PlayerManager.Instance.setPlayerStat(val, text, result); Print(t, $"Set player's ({val.playerUsername}) {text} to {result}!"); } } } } }, ["sendmsg"] = new TerminalCmd { name = "sendmsg", description = "Send Custom message to player!", argDesc = new Dictionary { [""] = "List of players to send the message to. Use commas to include multiple players. Type _ for default (all players)", ["
"] = "Notification Header, type _ for default (Warning)", ["<...message>"] = "The remaining args will be used for message content" }, callfunc = delegate(Terminal t, string[] args) { //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) if (args.Length < 3) { Print(t, $"Required 3 args. Received: {args.Length}. Please refer to help for more information"); } else { string text = args[0]; string header = ((args[1] != "_") ? args[1] : "Warning"); string message = GeneralExtensions.Join(args.Skip(2), (Func)((string c) => c), " "); if (text == "_") { ulong[] playerid = (from k in StartOfRound.Instance.allPlayerScripts where Utils.isPlayerConnected(k) select k.playerClientId).ToArray(); PlayerManager.Instance.requestPlrMessageServerRpc(playerid, header, message); Print(t, "Successfully send all player a message!"); } else { HashSet hashSet = new HashSet(); string[] array = text.Split(","); foreach (string plr in array) { PlayerControllerB val = ((IEnumerable)StartOfRound.Instance.allPlayerScripts).FirstOrDefault((Func)((PlayerControllerB k) => k.playerUsername.ToLower().StartsWith(plr))); if ((Object)(object)val != (Object)null) { hashSet.Add(val); } } PlayerManager.Instance.requestPlrMessageServerRpc(hashSet.Select((PlayerControllerB k) => k.playerClientId).ToArray(), header, message); Print(t, "Successfully send " + GeneralExtensions.Join((IEnumerable)hashSet, (Func)((PlayerControllerB k) => k.playerUsername), ", ") + " messages!"); } } } }, ["tp"] = new TerminalCmd { name = "tp", description = "Teleport players in the same region", argDesc = new Dictionary { [""] = "Player to be teleported (support partial completion and 'me' for self)", [""] = "Player to be teleported to (support partial completion and 'me' for self)" }, callfunc = delegate(Terminal t, string[] args) { if (args.Length < 2) { Print(t, $"Required 2 args got {args.Length}"); } else { string partialPlayerAName = args[0]; string partialPlayerBName = args[1]; PlayerControllerB val = (PlayerControllerB)((partialPlayerAName == "me") ? ((object)GameNetworkManager.Instance.localPlayerController) : ((object)((IEnumerable)StartOfRound.Instance.allPlayerScripts).FirstOrDefault((Func)((PlayerControllerB k) => k.playerUsername.ToLower().StartsWith(partialPlayerAName))))); PlayerControllerB val2 = (PlayerControllerB)((partialPlayerBName == "me") ? ((object)GameNetworkManager.Instance.localPlayerController) : ((object)((IEnumerable)StartOfRound.Instance.allPlayerScripts).FirstOrDefault((Func)((PlayerControllerB k) => k.playerUsername.ToLower().StartsWith(partialPlayerBName))))); if (val.playerClientId == GameNetworkManager.Instance.localPlayerController.playerClientId) { Print(t, "You cant teleport yourself to others because you're on the terminal :("); } else if ((Object)(object)val == (Object)null || (Object)(object)val2 == (Object)null) { Print(t, ""); if ((Object)(object)val == (Object)null) { Print(t, partialPlayerAName + " partial not found", cleartext: false); } if ((Object)(object)val2 == (Object)null) { Print(t, partialPlayerBName + " partial not found", cleartext: false); } } else { string text = PlayerManager.Instance.tpPlayerValidation(val, val2); if (text != null) { Print(t, text); } else { PlayerManager.Instance.teleportPlayer(val, val2); Print(t, "Successfully teleported " + val.playerUsername + " to " + val2.playerUsername + "!"); } } } } }, ["kill"] = new TerminalCmd { name = "kill", description = "kill a target player", argDesc = new Dictionary { [""] = "Target player to kill (support partial completion and type 'me' for self)" }, callfunc = delegate(Terminal t, string[] args) { if (args.Length < 1) { Print(t, "You need to specify the player you want to kill"); } else if (!ShipLandState.onMoon) { Print(t, "Game will only allow you to kill players when you landed the ship!"); } else { string partialPlayerName = args[0]; PlayerControllerB val = (PlayerControllerB)((partialPlayerName == "me") ? ((object)GameNetworkManager.Instance.localPlayerController) : ((object)((IEnumerable)StartOfRound.Instance.allPlayerScripts).FirstOrDefault((Func)((PlayerControllerB k) => k.playerUsername.ToLower().StartsWith(partialPlayerName))))); if ((Object)(object)val == (Object)null) { Print(t, "Player not found!"); } else if (val.isPlayerDead) { Print(t, "Cannot kill a dead player!"); } else { PlayerManager.Instance.killPlayer(val); Print(t, "Player successfully killed!"); } } } } }; public string name; public string description; public Dictionary? argDesc; public Action callfunc; private TerminalCmd() { } public static void Print(Terminal terminal, string text, bool cleartext = true, bool logPrint = true) { TerminalNode val = ScriptableObject.CreateInstance(); val.displayText = text + "\n"; val.clearPreviousText = cleartext; terminal.LoadNewNode(val); if (logPrint) { LCSMain.logger.LogDebug("[Term Out]: " + text); } } } public static class Utils { public static bool isPlayerConnected(PlayerControllerB? player) { if ((Object)(object)player == (Object)null) { return false; } if (NetworkManager.Singleton.IsServer && !NetworkManager.Singleton.ConnectedClients.ContainsKey(((NetworkBehaviour)player).NetworkObject.OwnerClientId)) { return false; } if ((Object)(object)((NetworkBehaviour)player).NetworkObject == (Object)null || !((NetworkBehaviour)player).NetworkObject.IsSpawned) { return false; } if ((Object)(object)player.deadBody == (Object)null && !player.isPlayerControlled) { return false; } if (player.disconnectedMidGame) { return false; } return true; } public static Vector3 SearchBestPosition(PlayerControllerB player, GameObject prefab, float radius = 5f) { //IL_0006: 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_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: 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_006b: 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_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0096: 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_00a3: 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_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: 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_00dd: 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_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_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_010f: 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_012c: Unknown result type (might be due to invalid IL or missing references) //IL_012e: 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_0136: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0140: 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_0150: 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_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Expected O, but got Unknown //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_0171: 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_0189: 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_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: 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_01d6: Unknown result type (might be due to invalid IL or missing references) Vector3 result = ((Component)player).transform.position; float num = float.MaxValue; float num2 = 1f; float num3 = 2f; NavMeshAgent componentInChildren = prefab.GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { num2 = componentInChildren.radius; num3 = componentInChildren.height; } else { Collider componentInChildren2 = prefab.GetComponentInChildren(); if ((Object)(object)componentInChildren2 != (Object)null) { Bounds bounds = componentInChildren2.bounds; num2 = Mathf.Max(((Bounds)(ref bounds)).extents.x, ((Bounds)(ref bounds)).extents.z); num3 = ((Bounds)(ref bounds)).size.y; } } NavMeshHit val2 = default(NavMeshHit); RaycastHit val3 = default(RaycastHit); for (int i = 0; i < 50; i++) { Vector2 val = Random.insideUnitCircle * radius; if (!NavMesh.SamplePosition(new Vector3(((Component)player).transform.position.x + val.x, ((Component)player).transform.position.y, ((Component)player).transform.position.z + val.y), ref val2, 10f, -1) || !Physics.Raycast(((NavMeshHit)(ref val2)).position + Vector3.up * 5f, Vector3.down, ref val3, 20f)) { continue; } Vector3 point = ((RaycastHit)(ref val3)).point; if (Physics.CheckCapsule(point + Vector3.up * num2, point + Vector3.up * Mathf.Max(num2, num3 - num2), num2)) { continue; } NavMeshPath val4 = new NavMeshPath(); if (NavMesh.CalculatePath(point, ((Component)player).transform.position, -1, val4) && (int)val4.status == 0) { float num4 = Mathf.Abs(point.y - ((Component)player).transform.position.y); float num5 = Mathf.Abs(Vector3.Distance(point, ((Component)player).transform.position) - radius); float num6 = num4 * 10f + num5; if (num6 < num) { num = num6; result = point; } } } return result; } } public class LoggerWarpper : ManualLogSource { public LoggerWarpper(string modName) : base(modName) { } public void LogDebug(object data) { ((ManualLogSource)this).LogDebug(data); } public void LogDebug(object data, Dictionary attributes) { ((ManualLogSource)this).LogDebug(data); } public void LogInfo(object data, Dictionary attributes) { ((ManualLogSource)this).LogInfo(data); } public void LogWarning(object data, Dictionary attributes) { ((ManualLogSource)this).LogWarning(data); } public void LogError(object data, Dictionary attributes) { ((ManualLogSource)this).LogError(data); } public void LogFatal(object data, Dictionary attributes) { ((ManualLogSource)this).LogFatal(data); } } } namespace LethalChatSpawner.Properties { [GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "18.0.0.0")] [DebuggerNonUserCode] [CompilerGenerated] internal class Resources { private static ResourceManager resourceMan; private static CultureInfo resourceCulture; [EditorBrowsable(EditorBrowsableState.Advanced)] internal static ResourceManager ResourceManager { get { if (resourceMan == null) { resourceMan = new ResourceManager("LethalChatSpawner.Properties.Resources", typeof(Resources).Assembly); } return resourceMan; } } [EditorBrowsable(EditorBrowsableState.Advanced)] internal static CultureInfo Culture { get { return resourceCulture; } set { resourceCulture = value; } } internal static byte[] netcodemod => (byte[])ResourceManager.GetObject("netcodemod", resourceCulture); internal Resources() { } } } namespace __GEN { internal class NetworkVariableSerializationHelper { [RuntimeInitializeOnLoadMethod] internal static void InitializeSerialization() { NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy(); NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable(); } } } namespace LethalChatSpawner.NetcodePatcher { [AttributeUsage(AttributeTargets.Module)] internal class NetcodePatchedAssemblyAttribute : Attribute { } }