Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of MZCoMagicShipping v1.2.0
BepInEx/plugins/MZCoMagicShipping/com.github.xuuxiaolan.mzcomagicshipping.dll
Decompiled 5 months agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; 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 Dawn.Utils; using Dusk; using GameNetcodeStuff; using Microsoft.CodeAnalysis; using Unity.Netcode; using Unity.Netcode.Components; using UnityEngine; using UnityEngine.Events; using com.github.xuuxiaolan.mzcomagicshipping.NetcodePatcher; [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("com.github.xuuxiaolan.mzcomagicshipping")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.2.0.0")] [assembly: AssemblyInformationalVersion("1.2.0")] [assembly: AssemblyProduct("MZCoMagicShipping")] [assembly: AssemblyTitle("com.github.xuuxiaolan.mzcomagicshipping")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.2.0.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 MZCoMagicShipping { [BepInPlugin("com.github.xuuxiaolan.mzcomagicshipping", "MZCoMagicShipping", "1.2.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class MZCoMagicShipping : BaseUnityPlugin { internal static ManualLogSource Logger { get; private set; } public static DuskMod Mod { get; private set; } private void Awake() { Logger = ((BaseUnityPlugin)this).Logger; AssetBundle val = AssetBundleUtils.LoadBundle(Assembly.GetExecutingAssembly(), "mzcomagicshippingmainasset"); Mod = DuskMod.RegisterMod((BaseUnityPlugin)(object)this, val); Mod.Logger = Logger; Mod.RegisterContentHandlers(); Logger.LogInfo((object)"com.github.xuuxiaolan.mzcomagicshipping v1.2.0 has loaded!"); } } public static class MyPluginInfo { public const string PLUGIN_GUID = "com.github.xuuxiaolan.mzcomagicshipping"; public const string PLUGIN_NAME = "MZCoMagicShipping"; public const string PLUGIN_VERSION = "1.2.0"; } } namespace MZCoMagicShipping.Content { public class MagicShippingCrate : NetworkBehaviour { [CompilerGenerated] private sealed class <DelayEnableOrDisablingEverything>d__17 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public bool enableEverything; public MagicShippingCrate <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <DelayEnableOrDisablingEverything>d__17(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown int num = <>1__state; MagicShippingCrate magicShippingCrate = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; if (!enableEverything) { <>2__current = (object)new WaitForSeconds(2f); <>1__state = 1; return true; } break; case 1: <>1__state = -1; break; } GameObject[] gameObjectsToEnableOrDisable = magicShippingCrate._gameObjectsToEnableOrDisable; foreach (GameObject val in gameObjectsToEnableOrDisable) { val.SetActive(enableEverything); } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <WaitUntilBackInOrbit>d__14 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public MagicShippingCrate <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <WaitUntilBackInOrbit>d__14(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Expected O, but got Unknown //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Expected O, but got Unknown int num = <>1__state; MagicShippingCrate magicShippingCrate = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; magicShippingCrate.PlaySoundClientRpc(0); magicShippingCrate._networkAnimator.SetTrigger("open"); <>2__current = (object)new WaitUntil((Func<bool>)(() => !StartOfRound.Instance.inShipPhase)); <>1__state = 1; return true; case 1: <>1__state = -1; <>2__current = (object)new WaitUntil((Func<bool>)(() => StartOfRound.Instance.inShipPhase)); <>1__state = 2; return true; case 2: <>1__state = -1; magicShippingCrate._networkAnimator.SetTrigger("respawn"); magicShippingCrate.PlaySoundClientRpc(1); magicShippingCrate.waitingRoutine = null; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [SerializeField] private AudioSource _audioSource; [SerializeField] private AudioClip _spawnSound; [SerializeField] private AudioClip _openCrateSound; [SerializeField] private GameObject[] _itemSpotsForSpawning = Array.Empty<GameObject>(); [SerializeField] private List<(Item item, int quantity)> _itemsToSpawnInOrder = new List<(Item, int)>(); [SerializeField] private InteractTrigger _interactTrigger; [SerializeField] private NetworkAnimator _networkAnimator; [SerializeField] private GameObject[] _gameObjectsToEnableOrDisable = Array.Empty<GameObject>(); private Coroutine? waitingRoutine; private int _numberToSpawnOfEachItem = 1; private void Start() { _audioSource.PlayOneShot(_spawnSound); ((UnityEvent<PlayerControllerB>)(object)_interactTrigger.onInteract).AddListener((UnityAction<PlayerControllerB>)OpenCrateInteract); IEnumerable<string> enumerable = from s in ((AssetBundleLoader<DefaultBundle>)(object)ContentHandler<MagicShippingCrateHandler>.Instance.defaultBundle).GetConfig<string>("Magic Shipping Crate | Items to Spawn").Value.Split(',') select s.Trim() into s where !string.IsNullOrEmpty(s) select s; List<(string, int)> list = new List<(string, int)>(); foreach (string item3 in enumerable) { string item = item3.Split(':')[0]; int item2 = int.Parse(item3.Split(':')[1]); list.Add((item, item2)); } foreach (var (itemName, quantity) in list) { AddItemToList(itemName, quantity); } } private void AddItemToList(string itemName, int quantity) { foreach (Item items in StartOfRound.Instance.allItemsList.itemsList) { MZCoMagicShipping.Logger.LogDebug((object)("Seeing if " + itemName + " in config matches " + items.itemName)); if (items.itemName.Equals(itemName, StringComparison.OrdinalIgnoreCase)) { _itemsToSpawnInOrder.Add((items, quantity)); break; } } } public void OpenCrateInteract(PlayerControllerB player) { if (!((Object)(object)player != (Object)(object)GameNetworkManager.Instance.localPlayerController)) { OpenCrateServerRpc(); } } [ServerRpc(RequireOwnership = false)] private void OpenCrateServerRpc() { //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) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3393930415u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3393930415u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (waitingRoutine == null) { waitingRoutine = ((MonoBehaviour)this).StartCoroutine(WaitUntilBackInOrbit()); } } } [IteratorStateMachine(typeof(<WaitUntilBackInOrbit>d__14))] private IEnumerator WaitUntilBackInOrbit() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <WaitUntilBackInOrbit>d__14(0) { <>4__this = this }; } [ClientRpc] private void PlaySoundClientRpc(int soundID) { //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(2428105445u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, soundID); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2428105445u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; switch (soundID) { case 0: _audioSource.PlayOneShot(_openCrateSound); break; case 1: ((Component)_audioSource).gameObject.SetActive(true); _audioSource.PlayOneShot(_spawnSound); break; } } } public void DisableOrEnableEverythingAnimEvent(int enable) { //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) bool flag = enable == 1; ((MonoBehaviour)this).StartCoroutine(DelayEnableOrDisablingEverything(flag)); if (flag || !((NetworkBehaviour)this).IsServer) { return; } int num = 0; foreach (var item3 in _itemsToSpawnInOrder) { Item item = item3.item; int item2 = item3.quantity; for (int i = 0; i < _numberToSpawnOfEachItem; i++) { for (int j = 0; j < item2; j++) { SpawnItem(item, _itemSpotsForSpawning[num].transform.position); } } num++; if (num == _itemSpotsForSpawning.Length) { num = 0; } } } [IteratorStateMachine(typeof(<DelayEnableOrDisablingEverything>d__17))] private IEnumerator DelayEnableOrDisablingEverything(bool enableEverything) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <DelayEnableOrDisablingEverything>d__17(0) { <>4__this = this, enableEverything = enableEverything }; } public NetworkObjectReference SpawnItem(Item? item, Vector3 position) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)StartOfRound.Instance == (Object)null || (Object)(object)item == (Object)null) { return default(NetworkObjectReference); } Transform val = null; if ((Object)(object)val == (Object)null) { val = StartOfRound.Instance.propsContainer; } Vector3 val2 = position + Vector3.up * 0.2f; GameObject val3 = Object.Instantiate<GameObject>(item.spawnPrefab, val2, Quaternion.identity, val); NetworkObject component = val3.GetComponent<NetworkObject>(); GrabbableObject component2 = val3.GetComponent<GrabbableObject>(); component2.fallTime = 0f; component.Spawn(false); UpdateParentServerRpc(new NetworkObjectReference(component)); int num = (int)((float)Random.Range(item.minValue, item.maxValue) * RoundManager.Instance.scrapValueMultiplier); ScanNodeProperties componentInChildren = val3.GetComponentInChildren<ScanNodeProperties>(); if ((Object)(object)componentInChildren != (Object)null) { componentInChildren.scrapValue = num; componentInChildren.subText = $"Value: ${num}"; component2.scrapValue = num; UpdateScanNodeServerRpc(new NetworkObjectReference(component), num); } return new NetworkObjectReference(val3); } [ServerRpc(RequireOwnership = false)] private void UpdateParentServerRpc(NetworkObjectReference netObjRef) { //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_00e2: 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(1527429956u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref netObjRef, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1527429956u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; UpdateParentClientRpc(netObjRef); } } } [ClientRpc] private void UpdateParentClientRpc(NetworkObjectReference netObjRef) { //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) 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(1686132120u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref netObjRef, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1686132120u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = default(NetworkObject); ((NetworkObjectReference)(ref netObjRef)).TryGet(ref val3, (NetworkManager)null); if ((Object)(object)val3 != (Object)null) { ((Component)val3).transform.parent = StartOfRound.Instance.propsContainer; } } } [ServerRpc(RequireOwnership = false)] public void UpdateScanNodeServerRpc(NetworkObjectReference netObjRef, int value) { //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) //IL_00ef: 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(997144913u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref netObjRef, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val2, value); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 997144913u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; UpdateScanNodeClientRpc(netObjRef, value); } } } [ClientRpc] public void UpdateScanNodeClientRpc(NetworkObjectReference netObjRef, int value) { //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.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1566523076u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref netObjRef, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val2, value); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1566523076u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = default(NetworkObject); ((NetworkObjectReference)(ref netObjRef)).TryGet(ref val3, (NetworkManager)null); GrabbableObject val4 = default(GrabbableObject); if ((Object)(object)val3 != (Object)null && ((Component)val3).gameObject.TryGetComponent<GrabbableObject>(ref val4)) { val4.SetScrapValue(value); } } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(3393930415u, new RpcReceiveHandler(__rpc_handler_3393930415), "OpenCrateServerRpc"); ((NetworkBehaviour)this).__registerRpc(2428105445u, new RpcReceiveHandler(__rpc_handler_2428105445), "PlaySoundClientRpc"); ((NetworkBehaviour)this).__registerRpc(1527429956u, new RpcReceiveHandler(__rpc_handler_1527429956), "UpdateParentServerRpc"); ((NetworkBehaviour)this).__registerRpc(1686132120u, new RpcReceiveHandler(__rpc_handler_1686132120), "UpdateParentClientRpc"); ((NetworkBehaviour)this).__registerRpc(997144913u, new RpcReceiveHandler(__rpc_handler_997144913), "UpdateScanNodeServerRpc"); ((NetworkBehaviour)this).__registerRpc(1566523076u, new RpcReceiveHandler(__rpc_handler_1566523076), "UpdateScanNodeClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_3393930415(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; ((MagicShippingCrate)(object)target).OpenCrateServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2428105445(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 soundID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref soundID); target.__rpc_exec_stage = (__RpcExecStage)1; ((MagicShippingCrate)(object)target).PlaySoundClientRpc(soundID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1527429956(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) { NetworkObjectReference netObjRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(ref netObjRef, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((MagicShippingCrate)(object)target).UpdateParentServerRpc(netObjRef); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1686132120(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) { NetworkObjectReference netObjRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(ref netObjRef, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((MagicShippingCrate)(object)target).UpdateParentClientRpc(netObjRef); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_997144913(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)); int value = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref value); target.__rpc_exec_stage = (__RpcExecStage)1; ((MagicShippingCrate)(object)target).UpdateScanNodeServerRpc(netObjRef, value); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1566523076(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)); int value = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref value); target.__rpc_exec_stage = (__RpcExecStage)1; ((MagicShippingCrate)(object)target).UpdateScanNodeClientRpc(netObjRef, value); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "MagicShippingCrate"; } } public class MagicShippingCrateHandler : ContentHandler<MagicShippingCrateHandler> { public DefaultBundle? defaultBundle; public MagicShippingCrateHandler(DuskMod mod) : base(mod) { ((ContentHandler)this).RegisterContent<DefaultBundle>("magicshippingcrateassets", ref defaultBundle, false); } } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { public IgnoresAccessChecksToAttribute(string assemblyName) { } } } namespace __GEN { internal class NetworkVariableSerializationHelper { [RuntimeInitializeOnLoadMethod] internal static void InitializeSerialization() { } } } namespace com.github.xuuxiaolan.mzcomagicshipping.NetcodePatcher { [AttributeUsage(AttributeTargets.Module)] internal class NetcodePatchedAssemblyAttribute : Attribute { } }