Please disclose if your mod was created primarily using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of TerminalDesktop ss v1.0.1
TerminalDesktop.dll
Decompiled 6 hours ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; 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 JetBrains.Annotations; using Microsoft.CodeAnalysis; using Newtonsoft.Json; using TMPro; using TerminalApi; using TerminalApi.Events; using TerminalDesktop.NetcodePatcher; using TerminalDesktopMod.Extentions; using TerminalDesktopMod.Sync; using Unity.Netcode; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.Experimental.Rendering; using UnityEngine.InputSystem; using UnityEngine.Rendering; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: IgnoresAccessChecksTo("")] [assembly: AssemblyCompany("TerminalDesktop")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.1.0")] [assembly: AssemblyInformationalVersion("1.0.1+3cb8500eda5f92cfca167b515df997a9c9e18a1f")] [assembly: AssemblyProduct("TerminalDesktop")] [assembly: AssemblyTitle("TerminalDesktop")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.1.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] [module: NetcodePatchedAssembly] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace TerminalDesktop { public static class MyPluginInfo { public const string PLUGIN_GUID = "TerminalDesktop"; public const string PLUGIN_NAME = "TerminalDesktop"; public const string PLUGIN_VERSION = "1.0.1"; } } namespace TerminalDesktopMod { public static class DesktopStorage { public delegate void TerminalNodeChangedEventHandler(Terminal sender, TerminalNode newNode); public static TerminalDesktopSaveModel TerminalDesktopSaveModel { get; set; } = new TerminalDesktopSaveModel(); public static GameObject UsbFlashPort { get; set; } public static GameObject DesktopPrefab { get; set; } public static Item FlashDriveItem { get; set; } public static TerminalNode ComputerPowerUpgrade { get; set; } public static List<Item> SpawnableScraps { get; private set; } = new List<Item>(); public static List<DesktopIconBase> IconsPrefabs { get; private set; } = new List<DesktopIconBase>(); public static Dictionary<string, DesktopWindowBase> WindowsPrefabs { get; private set; } = new Dictionary<string, DesktopWindowBase>(); public static event TerminalNodeChangedEventHandler TerminalNodeChangeEvent; public static void AddIcon(DesktopIconBase desktopIconBase) { IconsPrefabs.Add(desktopIconBase); Main.Log.LogInfo((object)("Desktop added icon:" + ((Object)desktopIconBase).name)); } public static void AddWindow(DesktopWindowBase desktopWindowBase) { WindowsPrefabs.Add(((object)desktopWindowBase).GetType().FullName, desktopWindowBase); Main.Log.LogInfo((object)("Desktop added window:" + ((Object)desktopWindowBase).name)); } [CanBeNull] public static DesktopWindowBase GetWindowByType(string desktopWindowType) { if (!WindowsPrefabs.TryGetValue(desktopWindowType, out DesktopWindowBase value)) { return null; } return value; } public static void InvokeChangeTerminalNode(Terminal terminal, TerminalNode node) { DesktopStorage.TerminalNodeChangeEvent?.Invoke(terminal, node); } public static void ClearTerminalNodeEvent() { DesktopStorage.TerminalNodeChangeEvent = null; } } [Serializable] public class FlashDriveSaveModel { public int DecodeLevel { get; set; } } public class FlashDriveProp : PhysicsProp { public static UnityEvent<FlashDriveProp> FlashLoadedEvent = new UnityEvent<FlashDriveProp>(); private int _flashIndex; public UsbPort UsbPort { get; set; } public int FlashIndex { get { if (_flashIndex == 0) { _flashIndex = Random.Range(-2147483647, int.MaxValue); } return _flashIndex; } private set { _flashIndex = value; } } public NetworkVariable<int> DecodeLevel { get; set; } = new NetworkVariable<int>(0, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public override int GetItemDataToSave() { Dictionary<int, string> flashSaves = DesktopStorage.TerminalDesktopSaveModel.FlashSaves; if (flashSaves.TryGetValue(FlashIndex, out var _)) { flashSaves[FlashIndex] = GetSaveData(); } else { DesktopStorage.TerminalDesktopSaveModel.FlashSaves.Add(FlashIndex, GetSaveData()); } return FlashIndex; } public override void LoadItemSaveData(int saveData) { FlashIndex = saveData; ((GrabbableObject)this).isInFactory = false; FlashLoadedEvent.Invoke(this); if (DesktopStorage.TerminalDesktopSaveModel.FlashSaves.TryGetValue(FlashIndex, out string value)) { LoadData(value); Main.Log.LogInfo((object)$"load flash {saveData}"); } } public override void GrabItem() { if (UsbPort != null) { UsbPort.PulledFlash(); UsbPort = null; } } public virtual string GetSaveData() { FlashDriveSaveModel flashDriveSaveModel = new FlashDriveSaveModel { DecodeLevel = DecodeLevel.Value }; return JsonConvert.SerializeObject((object)flashDriveSaveModel); } public virtual void LoadData(string data) { FlashDriveSaveModel flashDriveSaveModel = JsonConvert.DeserializeObject<FlashDriveSaveModel>(data); DecodeLevel.Value = flashDriveSaveModel.DecodeLevel; } public virtual void UpdateDecodeLevel(int value) { if (((NetworkBehaviour)this).IsServer) { DecodeLevel.Value = value; } } public override void OnDestroy() { ((NetworkBehaviour)this).OnDestroy(); if (UsbPort != null) { UsbPort.PulledFlash(); UsbPort = null; } } public override void OnPlaceObject() { ((GrabbableObject)this).OnPlaceObject(); NetworkObject val = default(NetworkObject); if ((Object)(object)((Component)this).transform.parent == (Object)null || !((Component)((Component)this).transform.parent).TryGetComponent<NetworkObject>(ref val)) { Main.Log.LogInfo((object)"Flash drive placed, but not in a USB port. Ignoring."); return; } UsbPort component = ((Component)val).GetComponent<UsbPort>(); if ((Object)(object)component != (Object)null) { Main.Log.LogInfo((object)"Flash drive placed in USB port, setting parent object to USB port transform."); ((GrabbableObject)this).parentObject = ((Component)val).transform; ((GrabbableObject)this).PlayDropSFX(); } } protected override void __initializeVariables() { if (DecodeLevel == null) { throw new Exception("FlashDriveProp.<DecodeLevel>k__BackingField cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)DecodeLevel).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)DecodeLevel, "DecodeLevel"); ((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)DecodeLevel); ((PhysicsProp)this).__initializeVariables(); } protected override void __initializeRpcs() { ((PhysicsProp)this).__initializeRpcs(); } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "FlashDriveProp"; } } public class CameraIcon : DesktopIconBase { public DesktopWindowBase WindowPrefab; public override void Click() { base.Click(); if (TerminalDesktopManager.Instance.GetFreeEnergy() <= 0) { TerminalDesktopManager.Instance.AddNotificationWindow("not enough energy to open the window"); } else { TerminalDesktopManager.Instance.AddWindow(WindowPrefab); } } } public class DecodeIcon : DesktopIconBase { public DesktopWindowBase WindowPrefab; public override void Click() { if (!TerminalDesktopManager.Instance.DesktopWindows.Any((DesktopWindowBase win) => win is DecodeWindow)) { base.Click(); TerminalDesktopManager.Instance.AddWindow(WindowPrefab); } } } public class DesktopIconBase : MonoBehaviour { public Vector2 DesktopNormalizedPosition; public UnityEvent ClickEvent { get; set; } = new UnityEvent(); private RectTransform CanvasRectTransform { get; set; } private Image Image { get; set; } protected virtual void Awake() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown CanvasRectTransform = (RectTransform)((Component)((Component)this).GetComponentInParent<Canvas>()).transform; Image = ((Component)this).GetComponentInParent<Image>(); } protected virtual void Start() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) ChangePosition(DesktopNormalizedPosition); } public virtual void Click() { ClickEvent.Invoke(); } public virtual void ChangePosition(float xNormalized, float yNormalized) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) ChangePosition(new Vector2(xNormalized, yNormalized)); } public virtual void ChangePosition(Vector2 newNormalizedPos) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) Transform transform = ((Component)this).transform; RectTransform val = (RectTransform)(object)((transform is RectTransform) ? transform : null); Vector2 anchoredPosition = CanvasRectTransform.sizeDelta * newNormalizedPos; anchoredPosition.y *= -1f; val.anchoredPosition = anchoredPosition; } public virtual void ChangeIconSprite(Sprite iconSprite) { Image.sprite = iconSprite; } } public class MineIcon : DesktopIconBase { public DesktopWindowBase WindowPrefab; public override void Click() { if (!TerminalDesktopManager.Instance.DesktopWindows.Any((DesktopWindowBase win) => win is MineWindow)) { base.Click(); TerminalDesktopManager.Instance.AddWindow(WindowPrefab); } } } public class SettingsIcon : DesktopIconBase { private bool UseStaticCamera { get; set; } = true; public Camera DynamicEventUICamera { get; private set; } public Camera StaticEventUICamera { get; private set; } public Transform StaticCameraPos { get; private set; } public Camera StaticCamera { get; private set; } private bool PreviousLocalVisorStatus { get; set; } protected override void Start() { //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Expected O, but got Unknown base.Start(); Transform val = ((Component)TerminalDesktopManager.Instance).transform.Find("CameraContainer"); StaticCameraPos = val.Find("TerminalStaticCamera"); StaticEventUICamera = ((Component)val.Find("TerminalStaticCameraEvent")).GetComponent<Camera>(); StaticEventUICamera.targetTexture = null; StaticEventUICamera.depth = 10f; StaticEventUICamera.clearFlags = (CameraClearFlags)3; ((Component)StaticEventUICamera).gameObject.SetActive(false); Events.TerminalBeganUsing += new TerminalEventHandler(OnTerminalBeganUsing); TerminalDesktopManager.Instance.TerminalExitEvent.AddListener(new UnityAction(OnTerminalExitedUsing)); } private void FixedUpdate() { if (!UseStaticCamera) { PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; DynamicEventUICamera.fieldOfView = localPlayerController.gameplayCamera.fieldOfView; } } public override void Click() { base.Click(); UseStaticCamera = !UseStaticCamera; SwitchCamera(); } private void OnTerminalBeganUsing(object sender, TerminalEventArgs e) { SwitchCamera(); } private void SwitchCamera() { PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; if (UseStaticCamera) { if (StaticCamera == null) { CreateStaticCamera(); } ((Component)StaticCamera).gameObject.SetActive(true); TerminalDesktopManager.Instance.CanvasDesktop.worldCamera = StaticEventUICamera; StaticCamera.depth = 50f; PreviousLocalVisorStatus = ((Component)localPlayerController.localVisor.GetChild(0)).gameObject.activeSelf; ((Component)localPlayerController.localVisor.GetChild(0)).gameObject.SetActive(false); localPlayerController.isClimbingLadder = false; localPlayerController.ladderCameraHorizontal = 0f; } else { StaticCamera.depth = -20f; if (DynamicEventUICamera == null) { CreateDynamicEventCamera(); } ((Component)StaticCamera).gameObject.SetActive(false); TerminalDesktopManager.Instance.CanvasDesktop.worldCamera = DynamicEventUICamera; ((Component)localPlayerController.localVisor.GetChild(0)).gameObject.SetActive(PreviousLocalVisorStatus); localPlayerController.isClimbingLadder = true; } } private void OnTerminalExitedUsing() { //IL_008c: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; TerminalDesktopManager.Instance.CanvasDesktop.worldCamera = null; if (UseStaticCamera) { StaticCamera.depth = -20f; ((Component)localPlayerController.localVisor.GetChild(0)).gameObject.SetActive(PreviousLocalVisorStatus); ((Component)StaticCamera).gameObject.SetActive(false); } localPlayerController.isClimbingLadder = false; localPlayerController.ladderCameraHorizontal = 0f; ((Component)localPlayerController.gameplayCamera).transform.localRotation = Quaternion.Euler(0f, 0f, 0f); } private void CreateDynamicEventCamera() { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; GameObject val = Object.Instantiate<GameObject>(((Component)localPlayerController.gameplayCamera).gameObject, ((Component)localPlayerController.gameplayCamera).transform); val.transform.localPosition = Vector3.zero; val.transform.localRotation = Quaternion.Euler(0f, 0f, 0f); Object.Destroy((Object)(object)val.GetComponent<AudioListener>()); DynamicEventUICamera = val.GetComponent<Camera>(); DynamicEventUICamera.targetTexture = null; DynamicEventUICamera.depth = 10f; DynamicEventUICamera.clearFlags = (CameraClearFlags)3; val.SetActive(false); ((Texture)ReferencesStorage.Terminal.playerScreenTexHighRes).width = DynamicEventUICamera.pixelWidth; ((Texture)ReferencesStorage.Terminal.playerScreenTexHighRes).height = DynamicEventUICamera.pixelHeight; } private void CreateStaticCamera() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; GameObject val = Object.Instantiate<GameObject>(((Component)localPlayerController.gameplayCamera).gameObject, StaticCameraPos); val.transform.localPosition = Vector3.zero; val.transform.localRotation = Quaternion.Euler(0f, 0f, 0f); Object.Destroy((Object)(object)val.GetComponent<AudioListener>()); StaticCamera = val.GetComponent<Camera>(); StaticCamera.targetTexture = ReferencesStorage.Terminal.playerScreenTexHighRes; StaticCamera.depth = -5f; StaticCamera.clearFlags = (CameraClearFlags)3; StaticCamera.fieldOfView = 58f; StaticEventUICamera.fieldOfView = StaticCamera.fieldOfView - 2f; val.SetActive(false); ((Texture)ReferencesStorage.Terminal.playerScreenTexHighRes).width = StaticCamera.pixelWidth; ((Texture)ReferencesStorage.Terminal.playerScreenTexHighRes).height = StaticCamera.pixelHeight; ((Component)GameNetworkManager.Instance.localPlayerController.playerBodyAnimator).gameObject.SetActive(false); ((Component)GameNetworkManager.Instance.localPlayerController.playerBodyAnimator).gameObject.SetActive(true); } private void OnDestroy() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown Events.TerminalBeganUsing -= new TerminalEventHandler(OnTerminalBeganUsing); } } public class TerminalIcon : DesktopIconBase { public DesktopWindowBase WindowPrefab; public override void Click() { if (!TerminalDesktopManager.Instance.DesktopWindows.Any((DesktopWindowBase win) => win is TerminalWindow)) { base.Click(); TerminalDesktopManager.Instance.AddWindow(WindowPrefab); } } } public class TestIcon : DesktopIconBase { public DesktopWindowBase WindowBase; public override void Click() { } private void Call(DesktopWindowBase win) { if (win is HackAttackWindow hackAttackWindow) { hackAttackWindow.Init(Random.Range(2, 5)); TerminalDesktopManager.Instance.WindowAddedEvent.RemoveListener((UnityAction<DesktopWindowBase>)Call); } } } public class WalkieIcon : DesktopIconBase { public DesktopWindowBase WindowPrefab; public override void Click() { if (!TerminalDesktopManager.Instance.DesktopWindows.Any((DesktopWindowBase win) => win is WalkieWindow)) { base.Click(); TerminalDesktopManager.Instance.AddWindow(WindowPrefab); } } } [BepInPlugin("ss.desktop.terminal", "Terminal Desktop", "1.0.1")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Main : BaseUnityPlugin { public const string ModGUID = "ss.desktop.terminal"; public const string ModName = "Terminal Desktop"; public const string ModVersion = "1.0.1"; internal static ManualLogSource Log; private readonly Harmony harmony = new Harmony("ss.desktop.terminal"); private AssetBundle bundle; private void Awake() { Log = ((BaseUnityPlugin)this).Logger; ((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin Terminal Desktop is loading! v 1.0.1"); LoadAssetBundle(); LoadFlashItem(); GameObject val = LoadAsset<GameObject>("desktop.prefab"); GenerateRpc(val); DesktopStorage.DesktopPrefab = val; LoadUsbPortObject(); LoadDesktopIcons(); LoadDesktopWindows(); harmony.PatchAll(); GenerateTerminalCommand(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin Terminal Desktop is loaded! v 1.0.1"); } private void LoadAssetBundle() { string directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); string text = Path.Combine(directoryName, "terminaldesktop"); if (!File.Exists(text)) { throw new FileNotFoundException("Asset bundle not found at path: " + text); } bundle = AssetBundle.LoadFromFile(text); if (!Object.op_Implicit((Object)(object)bundle)) { throw new Exception("Failed to load AssetBundle from path: " + text); } } private T LoadAsset<T>(string assetPath) where T : Object { if (bundle == null) { throw new Exception("AssetBundle is not loaded. Cannot load asset."); } string text = "assets/terminaldesktop/"; return bundle.LoadAsset<T>(text + assetPath); } private void LoadFlashItem() { Item item = (DesktopStorage.FlashDriveItem = LoadAsset<Item>("items/flashdrive.asset")); DesktopStorage.SpawnableScraps.Add(item); } private void LoadUsbPortObject() { GameObject gameObject = (DesktopStorage.UsbFlashPort = LoadAsset<GameObject>("usbport.prefab")); GenerateRpc(gameObject); } private void LoadDesktopIcons() { IEnumerable<GameObject> enumerable = from x in bundle.LoadAllAssets<GameObject>() where Object.op_Implicit((Object)(object)x.GetComponent<DesktopIconBase>()) select x; foreach (GameObject item in enumerable) { DesktopIconBase component = item.GetComponent<DesktopIconBase>(); if (component != null && ((Object)component).name != "DesktopIcon") { DesktopStorage.AddIcon(component); } } } private void LoadDesktopWindows() { IEnumerable<GameObject> enumerable = from x in bundle.LoadAllAssets<GameObject>() where Object.op_Implicit((Object)(object)x.GetComponent<DesktopWindowBase>()) select x; foreach (GameObject item in enumerable) { DesktopWindowBase component = item.GetComponent<DesktopWindowBase>(); if (component != null) { DesktopStorage.AddWindow(component); } } } private void GenerateTerminalCommand() { TerminalNode val = TerminalApi.CreateTerminalNode("Computer improved! \n Your new balance is [playerCredits].\n", true, ""); val.creatureName = "upgrade computer"; TerminalKeyword val2 = TerminalApi.CreateTerminalKeyword("upgrade", true, (TerminalNode)null); TerminalKeyword val3 = TerminalApi.CreateTerminalKeyword("computer", false, (TerminalNode)null); TerminalApi.AddTerminalKeyword(val3.defaultVerb = TerminalExtenstionMethods.AddCompatibleNoun(val2, val3, val)); TerminalApi.AddTerminalKeyword(val3); DesktopStorage.ComputerPowerUpgrade = val; } private void GenerateRpc(GameObject gameObject) { NetworkBehaviour[] componentsInChildren = gameObject.GetComponentsInChildren<NetworkBehaviour>(); if (componentsInChildren == null) { return; } NetworkBehaviour[] array = componentsInChildren; foreach (NetworkBehaviour val in array) { MethodInfo[] methods = ((object)val).GetType().GetMethods(BindingFlags.Static | BindingFlags.NonPublic); MethodInfo[] array2 = methods; foreach (MethodInfo methodInfo in array2) { if ((object)methodInfo.DeclaringType != null && methodInfo.DeclaringType.Namespace != null && methodInfo.DeclaringType.Namespace.Contains("TerminalDesktopMod") && methodInfo.GetParameters().Length == 0) { methodInfo.Invoke(null, null); } } } } } [HarmonyPatch(typeof(DeleteFileButton))] public static class DeleteButtonPatch { [HarmonyPostfix] [HarmonyPatch("DeleteFile")] private static void DeleteFile(DeleteFileButton __instance) { string path = Path.Combine(Application.persistentDataPath, $"TD_{__instance.fileToDelete}.json"); if (File.Exists(path)) { File.Delete(path); } } } [HarmonyPatch(typeof(GameNetworkManager))] public static class GameNetworkManagerPatch { [HarmonyPatch("Start")] [HarmonyPostfix] private static void StartPatch() { NetworkManager.Singleton.AddNetworkPrefab(DesktopStorage.DesktopPrefab); NetworkManager.Singleton.AddNetworkPrefab(DesktopStorage.UsbFlashPort); foreach (Item spawnableScrap in DesktopStorage.SpawnableScraps) { NetworkManager.Singleton.AddNetworkPrefab(spawnableScrap.spawnPrefab); } } [HarmonyPatch("SaveGame")] [HarmonyPrefix] private static void PrefixSaveGame(GameNetworkManager __instance) { if (__instance.isHostingGame) { DesktopStorage.TerminalDesktopSaveModel = new TerminalDesktopSaveModel(); if (WalkieWindow.TerminalWalkieTalkie != null && !((object)WalkieWindow.TerminalWalkieTalkie).Equals((object?)null)) { ((Component)WalkieWindow.TerminalWalkieTalkie).gameObject.SetActive(false); } } } [HarmonyPatch("SaveGame")] [HarmonyPostfix] private static void PostfixSaveGame(GameNetworkManager __instance) { if (__instance.isHostingGame) { TerminalDesktopManager.Instance.SaveDesktop(); if (WalkieWindow.TerminalWalkieTalkie != null && !((object)WalkieWindow.TerminalWalkieTalkie).Equals((object?)null)) { ((Component)WalkieWindow.TerminalWalkieTalkie).gameObject.SetActive(true); } } } [HarmonyPatch("ResetSavedGameValues")] [HarmonyPrefix] private static void ResetSavedGameValues(GameNetworkManager __instance) { TerminalDesktopManager.Instance.StartReset(); } } [HarmonyPatch(typeof(HUDManager))] public static class HUDManagerPatch { [HarmonyPatch("SetClock")] [HarmonyPostfix] private static void StartPatch(ref string __result) { ReferencesStorage.DayTime = __result; } } [HarmonyPatch(typeof(ManualCameraRenderer))] public static class ManualCameraRendererPatch { [HarmonyPatch("Awake")] [HarmonyPostfix] public static void Start(ref ManualCameraRenderer __instance) { if (((Object)((Component)__instance).gameObject).name == "CameraMonitorScript") { ReferencesStorage.ManualCameraRenderer = __instance; } } } [HarmonyPatch(typeof(RoundManager))] public static class RoundManagerPatch { [HarmonyPatch("SpawnScrapInLevel")] [HarmonyPrefix] public static void SpawnScrapInLevel(ref RoundManager __instance) { //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: 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_0065: Expected O, but got Unknown SelectableLevel currentLevel = __instance.currentLevel; foreach (Item scrap in DesktopStorage.SpawnableScraps) { if (currentLevel.spawnableScrap.Count((SpawnableItemWithRarity x) => (Object)(object)x.spawnableItem == (Object)(object)scrap) == 0) { currentLevel.spawnableScrap.Add(new SpawnableItemWithRarity { spawnableItem = scrap, rarity = 70 }); } } } } [HarmonyPatch(typeof(StartOfRound))] public static class StartOfRoundPatch { [HarmonyPatch("Awake")] [HarmonyPrefix] public static void Awake(ref StartOfRound __instance) { //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Expected O, but got Unknown foreach (Item scrap in DesktopStorage.SpawnableScraps) { SelectableLevel[] levels = __instance.levels; foreach (SelectableLevel val in levels) { if (val.spawnableScrap.Count((SpawnableItemWithRarity x) => (Object)(object)x.spawnableItem == (Object)(object)scrap) == 0) { val.spawnableScrap.Add(new SpawnableItemWithRarity { spawnableItem = scrap, rarity = 70 }); } } if (!__instance.allItemsList.itemsList.Contains(scrap)) { __instance.allItemsList.itemsList.Add(scrap); } } } [HarmonyPatch("Start")] [HarmonyPrefix] public static void Start(ref StartOfRound __instance) { WalkieTalkie.allWalkieTalkies.Clear(); DesktopStorage.ClearTerminalNodeEvent(); if (((NetworkBehaviour)__instance).IsServer) { string text = GameNetworkManager.Instance.saveFileNum.ToString(); string path = Path.Combine(Application.persistentDataPath, "TD_" + text + ".json"); DesktopStorage.TerminalDesktopSaveModel = new TerminalDesktopSaveModel(); if (File.Exists(path)) { string text2 = File.ReadAllText(path); TerminalDesktopSaveModel terminalDesktopSaveModel = JsonConvert.DeserializeObject<TerminalDesktopSaveModel>(text2); DesktopStorage.TerminalDesktopSaveModel = terminalDesktopSaveModel; } GameObject val = Object.Instantiate<GameObject>(DesktopStorage.DesktopPrefab); NetworkObject component = val.GetComponent<NetworkObject>(); component.Spawn(false); GameObject val2 = Object.Instantiate<GameObject>(DesktopStorage.UsbFlashPort); NetworkObject component2 = val2.GetComponent<NetworkObject>(); component2.Spawn(false); ((Component)component2).GetComponent<UsbPort>().LoadPortById(1); } } } [HarmonyPatch(typeof(Terminal))] public static class TerminalPatch { [HarmonyPatch("Awake")] [HarmonyPrefix] public static void Awake(ref Terminal __instance) { ReferencesStorage.Terminal = __instance; } [HarmonyPatch("LoadNewNode")] [HarmonyPrefix] public static void LoadNewNode(ref Terminal __instance, ref TerminalNode node) { DesktopStorage.InvokeChangeTerminalNode(__instance, node); } [HarmonyPatch("RotateShipDecorSelection")] [HarmonyPostfix] public static void RotateShipDecorSelection(ref Terminal __instance) { __instance.ShipDecorSelection.Add(DesktopStorage.ComputerPowerUpgrade); } } [HarmonyPatch(typeof(WalkieTalkie))] public static class WalkiePatch { [HarmonyPatch("OnDisable")] [HarmonyPrefix] public static bool OnDisable(ref WalkieTalkie __instance) { if (WalkieWindow.TerminalWalkieTalkie == null || ((object)WalkieWindow.TerminalWalkieTalkie).Equals((object?)null)) { return true; } if ((Object)(object)WalkieWindow.TerminalWalkieTalkie == (Object)(object)__instance) { return false; } return true; } } public static class ReferencesStorage { public static string DayTime { get; set; } public static ManualCameraRenderer ManualCameraRenderer { get; set; } public static Terminal Terminal { get; set; } } public class TerminalDesktopManager : NetworkBehaviour { [CompilerGenerated] private sealed class <WaitInitPlayer>d__64 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public TerminalDesktopManager <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <WaitInitPlayer>d__64(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_007a: 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_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Expected O, but got Unknown //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Expected O, but got Unknown int num = <>1__state; TerminalDesktopManager terminalDesktopManager = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; goto IL_004b; case 1: <>1__state = -1; goto IL_004b; case 2: { <>1__state = -1; terminalDesktopManager.GetSyncWindowsServerRpc(); return false; } IL_004b: if (GameNetworkManager.Instance.localPlayerController == null) { <>2__current = (object)new WaitForSeconds(1f); <>1__state = 1; return true; } <>2__current = (object)new WaitForSeconds(1f); <>1__state = 2; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public List<UsbPort> UsbPorts = new List<UsbPort>(); [SerializeField] private Camera StaticCamera; [SerializeField] private Transform IconsParent; [SerializeField] private Transform WindowsParent; [SerializeField] private Transform CollapsedWindowParent; [SerializeField] private GameObject CollapsedWindowPrefab; [SerializeField] private TextMeshProUGUI TimeText; [SerializeField] private TextMeshProUGUI PowerText; public static TerminalDesktopManager Instance { get; set; } public List<DesktopIconBase> DesktopIcons { get; set; } = new List<DesktopIconBase>(); public List<DesktopWindowBase> DesktopWindows { get; set; } = new List<DesktopWindowBase>(); public Dictionary<GameObject, DesktopWindowBase> CollapsedWindows { get; set; } = new Dictionary<GameObject, DesktopWindowBase>(); public UnityEvent<DesktopWindowBase> WindowAddedEvent { get; set; } = new UnityEvent<DesktopWindowBase>(); public UnityEvent TerminalExitEvent { get; set; } = new UnityEvent(); public Canvas CanvasDesktop { get; private set; } public bool IsUsingTerminal { get; private set; } private Terminal Terminal { get; set; } private NetworkVariable<int> UseEnergy { get; set; } = new NetworkVariable<int>(0, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); private NetworkVariable<int> MaxEnergy { get; set; } = new NetworkVariable<int>(0, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); private int BaseUpgradeCost { get; set; } = 75; private int WindowCounter { get; set; } private void Awake() { Instance = this; } private void Start() { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_006c: 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_0087: Expected O, but got Unknown //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Expected O, but got Unknown Terminal = ReferencesStorage.Terminal; ((Component)this).transform.parent = ((Component)Terminal.terminalUIScreen).transform.parent; CanvasDesktop = ((Component)this).GetComponentInChildren<Canvas>(); ((Component)this).transform.localScale = Vector3.one; ((Component)this).transform.localRotation = Quaternion.Euler(0f, 0f, 0f); ((Component)this).transform.localPosition = Vector3.zero; Events.TerminalBeganUsing += new TerminalEventHandler(OnBeganUsing); TerminalExitEvent.AddListener(new UnityAction(OnExitedUsing)); NetworkVariable<int> maxEnergy = MaxEnergy; maxEnergy.OnValueChanged = (OnValueChangedDelegate<int>)(object)Delegate.Combine((Delegate?)(object)maxEnergy.OnValueChanged, (Delegate?)(object)new OnValueChangedDelegate<int>(OnMaxEnergyValueChanged)); DesktopStorage.TerminalNodeChangeEvent += DesktopStorageOnTerminalNodeChangeEvent; DesktopStorage.ComputerPowerUpgrade.itemCost = BaseUpgradeCost * MaxEnergy.Value; foreach (DesktopIconBase iconsPrefab in DesktopStorage.IconsPrefabs) { AddIcon(iconsPrefab); } if (((NetworkBehaviour)this).IsServer) { this.LoadDesktop(); } if (((NetworkBehaviour)this).IsClient && !((NetworkBehaviour)this).IsHost) { ((MonoBehaviour)this).StartCoroutine(WaitInitPlayer()); } } private void OnMaxEnergyValueChanged(int previousValue, int newValue) { DesktopStorage.ComputerPowerUpgrade.itemCost = BaseUpgradeCost * newValue; } private void DesktopStorageOnTerminalNodeChangeEvent(Terminal sender, TerminalNode newNode) { if (!((Object)(object)newNode != (Object)(object)DesktopStorage.ComputerPowerUpgrade)) { if (ReferencesStorage.Terminal.groupCredits < newNode.itemCost) { newNode.displayText = "you could not afford these item"; return; } newNode.displayText = "Computer improved! \n Your new balance is [playerCredits].\n"; ReferencesStorage.Terminal.ChangeCredits(-newNode.itemCost); SetMaxEnergy(MaxEnergy.Value + 1); } } [IteratorStateMachine(typeof(<WaitInitPlayer>d__64))] private IEnumerator WaitInitPlayer() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <WaitInitPlayer>d__64(0) { <>4__this = this }; } private void FixedUpdate() { if (!((NetworkBehaviour)this).IsSpawned) { return; } ((TMP_Text)TimeText).text = ((ReferencesStorage.DayTime == null) ? "??:??" : ReferencesStorage.DayTime); ((TMP_Text)PowerText).text = $"{UseEnergy.Value} / {MaxEnergy.Value}"; if (IsUsingTerminal) { PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; localPlayerController.isClimbingLadder = true; if (!localPlayerController.inTerminalMenu) { TerminalExitEvent.Invoke(); } } } public void AddIcon(DesktopIconBase iconBasePrefab) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) GameObject val = Object.Instantiate<GameObject>(((Component)iconBasePrefab).gameObject, IconsParent); DesktopIconBase component = val.GetComponent<DesktopIconBase>(); component.ChangePosition(component.DesktopNormalizedPosition); DesktopIcons.Add(component); } public int GetUseEnergy() { return UseEnergy.Value; } public int GetMaxEnergy() { return MaxEnergy.Value; } public int GetFreeEnergy() { return MaxEnergy.Value - UseEnergy.Value; } public void ChangeUseEnergy(int count) { if (((NetworkBehaviour)this).IsServer) { NetworkVariable<int> useEnergy = UseEnergy; useEnergy.Value += count; } } public void SetUseEnergy(int count) { if (((NetworkBehaviour)this).IsServer) { UseEnergy.Value = count; } } public void SetMaxEnergy(int count) { SetMaxEnergyServerRpc(count); } [ServerRpc(RequireOwnership = false)] private void SetMaxEnergyServerRpc(int count) { //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_005f: 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_0071: 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_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 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(482236400u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, count); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 482236400u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; MaxEnergy.Value = count; } } } private void OnBeganUsing(object sender, TerminalEventArgs e) { Cursor.visible = true; Cursor.lockState = (CursorLockMode)0; IsUsingTerminal = true; InputAction obj = IngamePlayerSettings.Instance.playerInput.actions.FindAction("Move", false); if (obj != null) { obj.Disable(); } } private void OnExitedUsing() { IsUsingTerminal = false; Cursor.visible = false; Cursor.lockState = (CursorLockMode)1; InputAction obj = IngamePlayerSettings.Instance.playerInput.actions.FindAction("Move", false); if (obj != null) { obj.Enable(); } } private void ForceExitedTerminal() { InputAction obj = IngamePlayerSettings.Instance.playerInput.actions.FindAction("Move", false); if (obj != null) { obj.Enable(); } } public void CollapseWindow(DesktopWindowBase windowBase) { GameObject val = Object.Instantiate<GameObject>(CollapsedWindowPrefab, CollapsedWindowParent); val.GetComponent<Image>().sprite = windowBase.CollapseSprite; CollapsedWindows.Add(val, windowBase); val.SetActive(true); } public void ExpandWindow(GameObject collapsedIcon) { if (CollapsedWindows.TryGetValue(collapsedIcon, out DesktopWindowBase value)) { UpdateWindow(value, new WindowSync { ChangeCollapsed = true, IsCollapsed = false }); } } public void ExpandWindow(DesktopWindowBase window) { DesktopWindowBase window2 = window; GameObject key = CollapsedWindows.FirstOrDefault<KeyValuePair<GameObject, DesktopWindowBase>>((KeyValuePair<GameObject, DesktopWindowBase> x) => (Object)(object)x.Value == (Object)(object)window2).Key; if (key != null) { CollapsedWindows.Remove(key); Object.Destroy((Object)(object)key); } } public DesktopWindowBase GetWindowByIndex(int windowIndex) { return DesktopWindows.FirstOrDefault((DesktopWindowBase x) => x.WindowIndex == windowIndex); } public void AddNotificationWindow(string notification) { DesktopWindowBase windowByType = DesktopStorage.GetWindowByType(typeof(NotificationWindow).FullName); if (windowByType == null) { Main.Log.LogError((object)"Not found notification window"); return; } GameObject val = Object.Instantiate<GameObject>(((Component)windowByType).gameObject, WindowsParent); NotificationWindow component = val.GetComponent<NotificationWindow>(); component.WindowIndex = -1; component.SetText(notification); } public void AddWindow(DesktopWindowBase windowBasePrefab) { AddWindowServerRpc(((object)windowBasePrefab).GetType().FullName); } [ServerRpc(RequireOwnership = false)] private void AddWindowServerRpc(string windowType) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Invalid comparison between Unknown and I4 //IL_005f: 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_0088: 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_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: 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 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3506602511u, val, (RpcDelivery)0); bool flag = windowType != null; ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(windowType, false); } ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3506602511u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; WindowCounter++; AddWindowClientRpc(WindowCounter, windowType); } } [ClientRpc] private void AddWindowClientRpc(int winIndex, string windowType, ClientRpcParams clientRpcParams = default(ClientRpcParams)) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Invalid comparison between Unknown and I4 //IL_005f: 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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0095: 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_010c: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: 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 && (networkManager.IsServer || networkManager.IsHost)) { FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1529086400u, clientRpcParams, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, winIndex); bool flag = windowType != null; ((FastBufferWriter)(ref val)).WriteValueSafe<bool>(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val)).WriteValueSafe(windowType, false); } ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1529086400u, clientRpcParams, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; DesktopWindowBase windowByType = DesktopStorage.GetWindowByType(windowType); if (windowByType == null) { Main.Log.LogError((object)("Not found " + windowType + " window")); return; } GameObject val2 = Object.Instantiate<GameObject>(((Component)windowByType).gameObject, WindowsParent); DesktopWindowBase component = val2.GetComponent<DesktopWindowBase>(); component.WindowIndex = winIndex; DesktopWindows.Add(component); WindowAddedEvent.Invoke(component); } } public void CloseWindow(DesktopWindowBase windowBase) { CloseWindowServerRpc(windowBase.WindowIndex); } [ServerRpc(RequireOwnership = false)] private void CloseWindowServerRpc(int winIndex) { //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_005f: 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_0071: 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_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 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(547301171u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, winIndex); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 547301171u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; CloseWindowClientRpc(winIndex); } } } [ClientRpc] private void CloseWindowClientRpc(int windowIndex) { //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_005f: 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_0071: 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_00ce: 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 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(510893985u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, windowIndex); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 510893985u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; DesktopWindowBase window = GetWindowByIndex(windowIndex); if (window == null) { Main.Log.LogError((object)$"Not found {windowIndex} window"); return; } DesktopWindows.Remove(window); GameObject key = CollapsedWindows.FirstOrDefault<KeyValuePair<GameObject, DesktopWindowBase>>((KeyValuePair<GameObject, DesktopWindowBase> x) => (Object)(object)x.Value == (Object)(object)window).Key; if (key != null) { CollapsedWindows.Remove(key); Object.Destroy((Object)(object)key); } window.CloseWindow(); Object.Destroy((Object)(object)((Component)window).gameObject); } public void UpdateWindow(DesktopWindowBase window, WindowSync windowSync) { UpdateWindowServerRpc(window.WindowIndex, windowSync); } [ServerRpc(RequireOwnership = false)] private void UpdateWindowServerRpc(int indexWindow, WindowSync windowSync) { //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_005f: 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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0095: 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_0119: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: 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_0149: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1363074004u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, indexWindow); bool flag = windowSync != null; ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe<WindowSync>(ref windowSync, default(ForNetworkSerializable)); } ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1363074004u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; DesktopWindowBase windowByIndex = GetWindowByIndex(indexWindow); if (windowByIndex == null) { Main.Log.LogError((object)$"Not found {indexWindow} window"); } else { UpdateWindowClientRpc(indexWindow, windowSync); } } } [ClientRpc] private void UpdateWindowClientRpc(int indexWindow, WindowSync windowSync, ClientRpcParams clientRpcParams = default(ClientRpcParams)) { //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_005f: 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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0095: 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_0119: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(434189457u, clientRpcParams, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, indexWindow); bool flag = windowSync != null; ((FastBufferWriter)(ref val)).WriteValueSafe<bool>(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val)).WriteValueSafe<WindowSync>(ref windowSync, default(ForNetworkSerializable)); } ((NetworkBehaviour)this).__endSendClientRpc(ref val, 434189457u, clientRpcParams, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; DesktopWindowBase windowByIndex = GetWindowByIndex(indexWindow); if (windowByIndex == null) { Main.Log.LogError((object)$"Not found {indexWindow} window"); } else { windowByIndex.WindowSync(windowSync); } } } [ServerRpc(RequireOwnership = false)] private void GetSyncWindowsServerRpc(ServerRpcParams serverRpcParams = default(ServerRpcParams)) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: 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_007c: 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_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00de: 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_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_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_016f: 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 && (networkManager.IsClient || networkManager.IsHost)) { FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(4271948650u, serverRpcParams, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 4271948650u, serverRpcParams, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; ulong senderClientId = serverRpcParams.Receive.SenderClientId; ClientRpcParams val2 = default(ClientRpcParams); val2.Send = new ClientRpcSendParams { TargetClientIds = new ulong[1] { senderClientId } }; ClientRpcParams clientRpcParams = val2; foreach (DesktopWindowBase desktopWindow in DesktopWindows) { AddWindowClientRpc(desktopWindow.WindowIndex, ((object)desktopWindow).GetType().FullName, clientRpcParams); } foreach (DesktopWindowBase desktopWindow2 in DesktopWindows) { UpdateWindowClientRpc(desktopWindow2.WindowIndex, desktopWindow2.GetFullWindowSync(), clientRpcParams); } } public override void OnDestroy() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown Events.TerminalBeganUsing -= new TerminalEventHandler(OnBeganUsing); DesktopStorage.TerminalNodeChangeEvent -= DesktopStorageOnTerminalNodeChangeEvent; WalkieWindow.ManagerDestroyed(); TerminalWindow.ManagerDestroyed(); ForceExitedTerminal(); } [ServerRpc(RequireOwnership = false)] public void ChangeObjectOwnerServerRpc(NetworkObjectReference netObjRef, ulong clientId) { //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_005f: 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_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: 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 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(403763237u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref netObjRef, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val2, clientId); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 403763237u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = default(NetworkObject); if (((NetworkObjectReference)(ref netObjRef)).TryGet(ref val3, (NetworkManager)null)) { val3.RemoveOwnership(); val3.ChangeOwnership(clientId); } } } public void StartReset() { ResetServerRpc(); } [ServerRpc(RequireOwnership = false)] private void ResetServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: 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_007c: 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 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1554722835u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1554722835u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; ResetClientRpc(); } } } [ClientRpc] private void ResetClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: 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_007c: 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 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1478555575u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1478555575u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; this.ResetDesktop(); } } } protected override void __initializeVariables() { if (UseEnergy == null) { throw new Exception("TerminalDesktopManager.<UseEnergy>k__BackingField cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)UseEnergy).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)UseEnergy, "UseEnergy"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)UseEnergy); if (MaxEnergy == null) { throw new Exception("TerminalDesktopManager.<MaxEnergy>k__BackingField cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)MaxEnergy).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)MaxEnergy, "MaxEnergy"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)MaxEnergy); ((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 //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Expected O, but got Unknown //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Expected O, but got Unknown //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(482236400u, new RpcReceiveHandler(__rpc_handler_482236400), "SetMaxEnergyServerRpc"); ((NetworkBehaviour)this).__registerRpc(3506602511u, new RpcReceiveHandler(__rpc_handler_3506602511), "AddWindowServerRpc"); ((NetworkBehaviour)this).__registerRpc(1529086400u, new RpcReceiveHandler(__rpc_handler_1529086400), "AddWindowClientRpc"); ((NetworkBehaviour)this).__registerRpc(547301171u, new RpcReceiveHandler(__rpc_handler_547301171), "CloseWindowServerRpc"); ((NetworkBehaviour)this).__registerRpc(510893985u, new RpcReceiveHandler(__rpc_handler_510893985), "CloseWindowClientRpc"); ((NetworkBehaviour)this).__registerRpc(1363074004u, new RpcReceiveHandler(__rpc_handler_1363074004), "UpdateWindowServerRpc"); ((NetworkBehaviour)this).__registerRpc(434189457u, new RpcReceiveHandler(__rpc_handler_434189457), "UpdateWindowClientRpc"); ((NetworkBehaviour)this).__registerRpc(4271948650u, new RpcReceiveHandler(__rpc_handler_4271948650), "GetSyncWindowsServerRpc"); ((NetworkBehaviour)this).__registerRpc(403763237u, new RpcReceiveHandler(__rpc_handler_403763237), "ChangeObjectOwnerServerRpc"); ((NetworkBehaviour)this).__registerRpc(1554722835u, new RpcReceiveHandler(__rpc_handler_1554722835), "ResetServerRpc"); ((NetworkBehaviour)this).__registerRpc(1478555575u, new RpcReceiveHandler(__rpc_handler_1478555575), "ResetClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_482236400(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 maxEnergyServerRpc = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref maxEnergyServerRpc); target.__rpc_exec_stage = (__RpcExecStage)1; ((TerminalDesktopManager)(object)target).SetMaxEnergyServerRpc(maxEnergyServerRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3506602511(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_0061: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives)); string windowType = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref windowType, false); } target.__rpc_exec_stage = (__RpcExecStage)1; ((TerminalDesktopManager)(object)target).AddWindowServerRpc(windowType); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1529086400(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_0069: 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_0078: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int winIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref winIndex); bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives)); string windowType = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref windowType, false); } ClientRpcParams client = rpcParams.Client; target.__rpc_exec_stage = (__RpcExecStage)1; ((TerminalDesktopManager)(object)target).AddWindowClientRpc(winIndex, windowType, client); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_547301171(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 winIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref winIndex); target.__rpc_exec_stage = (__RpcExecStage)1; ((TerminalDesktopManager)(object)target).CloseWindowServerRpc(winIndex); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_510893985(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 windowIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref windowIndex); target.__rpc_exec_stage = (__RpcExecStage)1; ((TerminalDesktopManager)(object)target).CloseWindowClientRpc(windowIndex); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1363074004(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_007b: 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_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int indexWindow = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref indexWindow); bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives)); WindowSync windowSync = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe<WindowSync>(ref windowSync, default(ForNetworkSerializable)); } target.__rpc_exec_stage = (__RpcExecStage)1; ((TerminalDesktopManager)(object)target).UpdateWindowServerRpc(indexWindow, windowSync); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_434189457(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_0075: 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_007b: 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_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int indexWindow = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref indexWindow); bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives)); WindowSync windowSync = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe<WindowSync>(ref windowSync, default(ForNetworkSerializable)); } ClientRpcParams client = rpcParams.Client; target.__rpc_exec_stage = (__RpcExecStage)1; ((TerminalDesktopManager)(object)target).UpdateWindowClientRpc(indexWindow, windowSync, client); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4271948650(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: 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_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ServerRpcParams server = rpcParams.Server; target.__rpc_exec_stage = (__RpcExecStage)1; ((TerminalDesktopManager)(object)target).GetSyncWindowsServerRpc(server); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_403763237(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_003e: 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_005c: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference netObjRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(ref netObjRef, default(ForNetworkSerializable)); ulong clientId = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref clientId); target.__rpc_exec_stage = (__RpcExecStage)1; ((TerminalDesktopManager)(object)target).ChangeObjectOwnerServerRpc(netObjRef, clientId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1554722835(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; ((TerminalDesktopManager)(object)target).ResetServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1478555575(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; ((TerminalDesktopManager)(object)target).ResetClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "TerminalDesktopManager"; } } public class UsbPortSaveModel { public int FlashInUsbIndex { get; set; } } public class UsbPort : NetworkBehaviour { public static UnityEvent<UsbPort> UsbPortChangeEvent = new UnityEvent<UsbPort>(); public InteractTrigger triggerScript; public NetworkVariable<int> FlashInUsbIndex { get; set; } = new NetworkVariable<int>(0, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable<int> PortId { get; set; } = new NetworkVariable<int>(0, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public FlashDriveProp FlashInUsb { get; set; } private void Awake() { FlashDriveProp.FlashLoadedEvent.AddListener((UnityAction<FlashDriveProp>)LoadFlash); } public override void OnDestroy() { ((NetworkBehaviour)this).OnDestroy(); FlashDriveProp.FlashLoadedEvent.RemoveListener((UnityAction<FlashDriveProp>)LoadFlash); } private void Start() { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) TerminalDesktopManager.Instance.UsbPorts.Add(this); Terminal terminal = ReferencesStorage.Terminal; ((Component)this).transform.SetParent(FindTerminalTransform(((Component)terminal).transform), false); ((Component)this).transform.localRotation = Quaternion.Euler(180f, 0f, 180f); ((Component)this).transform.localPosition = new Vector3(-0.413f, -0.0728f, 0.7024f); } private Transform FindTerminalTransform(Transform trans) { NetworkObject val = default(NetworkObject); while (!((Component)trans).gameObject.TryGetComponent<NetworkObject>(ref val) && (Object)(object)trans != (Object)null) { trans = trans.parent; } return trans; } protected virtual void FixedUpdate() { if (GameNetworkManager.Instance != null && GameNetworkManager.Instance.localPlayerController != null) { triggerScript.interactable = IsHoldFlash(); } } protected virtual bool IsHoldFlash() { PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; if (!localPlayerController.isHoldingObject) { return false; } if ((Object)(object)localPlayerController.currentlyHeldObjectServer.itemProperties != (Object)(object)DesktopStorage.FlashDriveItem) { return false; } if (FlashInUsb != null) { return false; } return true; } public virtual void InsertIntoUsb(PlayerControllerB playerWhoTriggered) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0028: 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) if (playerWhoTriggered.isHoldingObject && playerWhoTriggered.currentlyHeldObjectServer != null) { GrabbableObject currentlyHeldObjectServer = playerWhoTriggered.currentlyHeldObjectServer; playerWhoTriggered.DiscardHeldObject(true, ((Component)this).GetComponent<NetworkObject>(), default(Vector3), true); InsertIntoUsbServerRpc(NetworkBehaviourReference.op_Implicit((NetworkBehaviour)(object)currentlyHeldObjectServer)); } } [ServerRpc(RequireOwnership = false)] private void InsertIntoUsbServerRpc(NetworkBehaviourReference flashRef) { //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_005f: 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_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: 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_0101: 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 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(988634225u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkBehaviourReference>(ref flashRef, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 988634225u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; FlashDriveProp flashDriveProp = default(FlashDriveProp); if (((NetworkBehaviourReference)(ref flashRef)).TryGet<FlashDriveProp>(ref flashDriveProp, (NetworkManager)null)) { FlashInUsbIndex.Value = flashDriveProp.FlashIndex; InsertIntoUsbClientRpc(NetworkBehaviourReference.op_Implicit((NetworkBehaviour)(object)flashDriveProp)); } } } [ClientRpc] private void InsertIntoUsbClientRpc(NetworkBehaviourReference flashRef) { //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_005f: 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_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: 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_0111: 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 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1882689273u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkBehaviourReference>(ref flashRef, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1882689273u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; FlashDriveProp flashDriveProp = default(FlashDriveProp); if (((NetworkBehaviourReference)(ref flashRef)).TryGet<FlashDriveProp>(ref flashDriveProp, (NetworkManager)null)) { FlashInUsb = flashDriveProp; flashDriveProp.UsbPort = this; ((Component)flashDriveProp).transform.localRotation = Quaternion.Euler(0f, 0f, 180f); UsbPortChangeEvent.Invoke(this); } } } public virtual void PulledFlash() { PulledFlashServerRpc(); } [ServerRpc(RequireOwnership = false)] private void PulledFlashServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: 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_007c: 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 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2760545246u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2760545246u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; FlashInUsbIndex.Value = 0; PulledFlashClientRpc(); } } } [ClientRpc] private void PulledFlashClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: 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_007c: 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 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(419952685u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 419952685u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; FlashInUsb = null; UsbPortChangeEvent.Invoke(this); } } } public virtual void LoadFlash(FlashDriveProp flashDriveProp) { if (flashDriveProp.FlashIndex == FlashInUsbIndex.Value) { FlashDriveProp.FlashLoadedEvent.RemoveListener((UnityAction<FlashDriveProp>)LoadFlash); Main.Log.LogInfo((object)$"Init flash in usb with index {flashDriveProp.FlashIndex}"); InitLoadedFlash(flashDriveProp); } } private void InitLoadedFlash(FlashDriveProp flashDriveProp) { //IL_002a: 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) ((GrabbableObject)flashDriveProp).reachedFloorTarget = true; ((GrabbableObject)flashDriveProp).fallTime = 1f; ((Component)flashDriveProp).transform.SetParent(((Component)this).transform, true); ((Component)flashDriveProp).transform.localPosition = Vector3.zero; ((Component)flashDriveProp).transform.localRotation = Quaternion.Euler(0f, 0f, 180f); ((GrabbableObject)flashDriveProp).hasHitGround = true; ((GrabbableObject)flashDriveProp).parentObject = ((Component)this).transform; FlashInUsb = flashDriveProp; flashDriveProp.UsbPort = this; UsbPortChangeEvent.Invoke(this); } public virtual string GetSaveString() { UsbPortSaveModel usbPortSaveModel = new UsbPortSaveModel { FlashInUsbIndex = FlashInUsbIndex.Value }; return JsonConvert.SerializeObject((object)usbPortSaveModel); } public virtual void LoadPortById(int id) { LoadPortByIdServerRpc(id); } [ServerRpc(RequireOwnership = false)] private void LoadPortByIdServerRpc(int id) { //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_005f: 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_0071: 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_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 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3163062493u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, id); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3163062493u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; PortId.Value = id; LoadPort(); } } } protected virtual void LoadPort() { if (((NetworkBehaviour)this).IsServer && DesktopStorage.TerminalDesktopSaveModel.UsbPortsSaves.TryGetValue(PortId.Value, out string value)) { UsbPortSaveModel usbPortSaveModel = JsonConvert.DeserializeObject<UsbPortSaveModel>(value); FlashInUsbIndex.Value = usbPortSaveModel.FlashInUsbIndex; Main.Log.LogInfo((object)"load usb port"); } } protected override void __initializeVariables() { if (FlashInUsbIndex == null) { throw new Exception("UsbPort.<FlashInUsbIndex>k__BackingField cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)FlashInUsbIndex).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)FlashInUsbIndex, "FlashInUsbIndex"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)FlashInUsbIndex); if (PortId == null) { throw new Exception("UsbPort.<PortId>k__BackingField cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)PortId).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)PortId, "PortId"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)PortId); ((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 ((NetworkBehaviour)this).__registerRpc(988634225u, new RpcReceiveHandler(__rpc_handler_988634225), "InsertIntoUsbServerRpc"); ((NetworkBehaviour)this).__registerRpc(1882689273u, new RpcReceiveHandler(__rpc_handler_1882689273), "InsertIntoUsbClientRpc"); ((NetworkBehaviour)this).__registerRpc(2760545246u, new RpcReceiveHandler(__rpc_handler_2760545246), "PulledFlashServerRpc"); ((NetworkBehaviour)this).__registerRpc(419952685u, new RpcReceiveHandler(__rpc_handler_419952685), "PulledFlashClientRpc"); ((NetworkBehaviour)this).__registerRpc(3163062493u, new RpcReceiveHandler(__rpc_handler_3163062493), "LoadPortByIdServerRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_988634225(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_0044: 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) { NetworkBehaviourReference flashRef = default(NetworkBehaviourReference); ((FastBufferReader)(ref reader)).ReadValueSafe<NetworkBehaviourReference>(ref flashRef, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((UsbPort)(object)target).InsertIntoUsbServerRpc(flashRef); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1882689273(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_0044: 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) { NetworkBehaviourReference flashRef = default(NetworkBehaviourReference); ((FastBufferReader)(ref reader)).ReadValueSafe<NetworkBehaviourReference>(ref flashRef, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((UsbPort)(object)target).InsertIntoUsbClientRpc(flashRef); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2760545246(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; ((UsbPort)(object)target).PulledFlashServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_419952685(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; ((UsbPort)(object)target).PulledFlashClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3163062493(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 id = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref id); target.__rpc_exec_stage = (__RpcExecStage)1; ((UsbPort)(object)target).LoadPortByIdServerRpc(id);