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.Configuration; using CleaningCompany.Misc; using CleaningCompany.Monos; using CleaningCompany.NetcodePatcher; using GameNetcodeStuff; using HarmonyLib; using LethalLib.Extras; using LethalLib.Modules; using Microsoft.CodeAnalysis; using Unity.Netcode; using UnityEngine; using UnityEngine.Audio; using UnityEngine.Events; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("CleaningCompany")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyDescription("Viscera Cleanup meets Lethal Company")] [assembly: AssemblyFileVersion("0.0.1.0")] [assembly: AssemblyInformationalVersion("0.0.1")] [assembly: AssemblyProduct("CleaningCompany")] [assembly: AssemblyTitle("CleaningCompany")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.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 CleaningCompany { [BepInPlugin("malco.cleaning_company", "Cleaning Company", "1.0.0")] [BepInDependency("evaisa.lethallib", "0.6.0")] public class Plugin : BaseUnityPlugin { private readonly Harmony harmony = new Harmony("malco.cleaning_company"); private const string GUID = "malco.cleaning_company"; private const string NAME = "Cleaning Company"; private const string VERSION = "1.0.0"; private static string root = "Assets/CleaningAssets/"; private Dictionary minBodyValues; private Dictionary maxBodyValues; private Dictionary bodyWeights; private Dictionary bodyPaths; private Dictionary pathToName = new Dictionary { { root + "ScavItem.asset", "IgnoreThis" }, { root + "HoarderItem.asset", "Hoarding bug" }, { root + "SpiderItem.asset", "Bunker Spider" }, { root + "ThumperItem.asset", "Crawler" }, { root + "CentipedeItem.asset", "Centipede" }, { root + "BrackenDustItem.asset", "Flowerman" } }; private Dictionary messPaths = new Dictionary { { root + "ThumperDroolItem.asset", "mop" }, { root + "SporePileItem.asset", "vacuum" }, { root + "EtherealItem.asset", "vacuum" }, { root + "ScavGoopItem.asset", "mop" }, { root + "BrackenDustItem.asset", "broom" }, { root + "NailPileItem.asset", "broom" }, { root + "HoardingEggItem.asset", "garbage" }, { root + "BonesItem.asset", "garbage" } }; public Dictionary BodySpawns = new Dictionary(); public List tools = new List(); private AssetBundle bundle; public Texture2D janitorMat; public static Plugin instance; public AudioClip open; public AudioClip close; public AudioClip zeroDays; public AudioClip firedSFX; public AudioClip introSFX; public static PluginConfig cfg { get; private set; } private void Awake() { cfg = new PluginConfig(((BaseUnityPlugin)this).Config); cfg.InitBindings(); Type[] types = Assembly.GetExecutingAssembly().GetTypes(); Type[] array = types; foreach (Type type in array) { MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic); MethodInfo[] array2 = methods; foreach (MethodInfo methodInfo in array2) { object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false); if (customAttributes.Length != 0) { methodInfo.Invoke(null, null); } } } instance = this; string text = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "cleaningassets"); bundle = AssetBundle.LoadFromFile(text); janitorMat = bundle.LoadAsset("Assets/CleaningAssets/JanitorOutfit.png"); open = bundle.LoadAsset("Assets/CleaningAssets/open.ogg"); close = bundle.LoadAsset("Assets/CleaningAssets/close.ogg"); zeroDays = bundle.LoadAsset("Assets/CleaningAssets/VA/zeroDays.mp3"); firedSFX = bundle.LoadAsset("Assets/CleaningAssets/VA/fired.mp3"); introSFX = bundle.LoadAsset("Assets/CleaningAssets/VA/intro.mp3"); ApplyConfig(); SetupItems(); SetupScrap(); harmony.PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Cleaning Company is patched!"); ((BaseUnityPlugin)this).Logger.LogInfo((object)string.Join(", ", BodySpawns.Keys)); } private void ApplyConfig() { //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_0246: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_0267: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Unknown result type (might be due to invalid IL or missing references) //IL_0276: Expected O, but got Unknown //IL_0299: Unknown result type (might be due to invalid IL or missing references) //IL_029e: Unknown result type (might be due to invalid IL or missing references) //IL_02b4: Unknown result type (might be due to invalid IL or missing references) //IL_02b9: Unknown result type (might be due to invalid IL or missing references) //IL_02d0: Unknown result type (might be due to invalid IL or missing references) //IL_02d5: Unknown result type (might be due to invalid IL or missing references) //IL_02da: Unknown result type (might be due to invalid IL or missing references) //IL_02e4: Expected O, but got Unknown //IL_0307: Unknown result type (might be due to invalid IL or missing references) //IL_030c: Unknown result type (might be due to invalid IL or missing references) //IL_0322: Unknown result type (might be due to invalid IL or missing references) //IL_0327: Unknown result type (might be due to invalid IL or missing references) //IL_033e: Unknown result type (might be due to invalid IL or missing references) //IL_0343: Unknown result type (might be due to invalid IL or missing references) //IL_0348: Unknown result type (might be due to invalid IL or missing references) //IL_0352: Expected O, but got Unknown //IL_0375: Unknown result type (might be due to invalid IL or missing references) //IL_037a: Unknown result type (might be due to invalid IL or missing references) //IL_0390: Unknown result type (might be due to invalid IL or missing references) //IL_0395: Unknown result type (might be due to invalid IL or missing references) //IL_03ac: Unknown result type (might be due to invalid IL or missing references) //IL_03b1: Unknown result type (might be due to invalid IL or missing references) //IL_03b6: Unknown result type (might be due to invalid IL or missing references) //IL_03c0: Expected O, but got Unknown //IL_03e3: Unknown result type (might be due to invalid IL or missing references) //IL_03e8: Unknown result type (might be due to invalid IL or missing references) //IL_03fe: Unknown result type (might be due to invalid IL or missing references) //IL_0403: Unknown result type (might be due to invalid IL or missing references) //IL_041a: Unknown result type (might be due to invalid IL or missing references) //IL_041f: Unknown result type (might be due to invalid IL or missing references) //IL_0424: Unknown result type (might be due to invalid IL or missing references) //IL_042e: Expected O, but got Unknown bodyWeights = new Dictionary { { root + "ScavItem.asset", cfg.SCAV_WEIGHT }, { root + "HoarderItem.asset", cfg.HOARDER_WEIGHT }, { root + "SpiderItem.asset", cfg.SPIDER_WEIGHT }, { root + "ThumperItem.asset", cfg.THUMPER_WEIGHT }, { root + "CentipedeItem.asset", cfg.CENTIPEDE_WEIGHT } }; maxBodyValues = new Dictionary { { root + "ScavItem.asset", cfg.SCAV_MAX }, { root + "HoarderItem.asset", cfg.HOARDER_MAX }, { root + "SpiderItem.asset", cfg.SPIDER_MAX }, { root + "ThumperItem.asset", cfg.THUMPER_MAX }, { root + "CentipedeItem.asset", cfg.CENTIPEDE_MAX } }; minBodyValues = new Dictionary { { root + "ScavItem.asset", cfg.SCAV_MIN }, { root + "HoarderItem.asset", cfg.HOARDER_MIN }, { root + "SpiderItem.asset", cfg.SPIDER_MIN }, { root + "ThumperItem.asset", cfg.THUMPER_MIN }, { root + "CentipedeItem.asset", cfg.CENTIPEDE_MIN } }; bodyPaths = new Dictionary { { root + "ScavItem.asset", new AnimationCurve((Keyframe[])(object)new Keyframe[3] { new Keyframe(0f, 1f), new Keyframe(cfg.SCAV_CURVE, 0f), new Keyframe(1f, (float)cfg.MAX_SCAVS) }) }, { root + "HoarderItem.asset", new AnimationCurve((Keyframe[])(object)new Keyframe[3] { new Keyframe(0f, 0f), new Keyframe(cfg.HOARDER_CURVE, 0f), new Keyframe(1f, (float)cfg.MAX_HOARDERS) }) }, { root + "SpiderItem.asset", new AnimationCurve((Keyframe[])(object)new Keyframe[3] { new Keyframe(0f, 0f), new Keyframe(cfg.SPIDER_CURVE, 0f), new Keyframe(1f, (float)cfg.MAX_SPIDERS) }) }, { root + "ThumperItem.asset", new AnimationCurve((Keyframe[])(object)new Keyframe[3] { new Keyframe(0f, 0f), new Keyframe(cfg.THUMPER_CURVE, 0f), new Keyframe(1f, (float)cfg.MAX_THUMPERS) }) }, { root + "CentipedeItem.asset", new AnimationCurve((Keyframe[])(object)new Keyframe[3] { new Keyframe(0f, 0f), new Keyframe(cfg.CENTIPEDE_CURVE, 0f), new Keyframe(1f, (float)cfg.MAX_CENTIPEDES) }) } }; } private void SetupItems() { Item val = bundle.LoadAsset("Assets/CleaningAssets/MopItem.asset"); ToolItem toolItem = val.spawnPrefab.AddComponent(); val.spawnPrefab.AddComponent(); val.itemSpawnsOnGround = true; val.canBeGrabbedBeforeGameStart = true; toolItem.toolType = "mop"; ((GrabbableObject)toolItem).grabbable = true; ((GrabbableObject)toolItem).grabbableToEnemies = true; ((GrabbableObject)toolItem).itemProperties = val; Items.RegisterItem(val); NetworkPrefabs.RegisterNetworkPrefab(val.spawnPrefab); tools.Add(val.spawnPrefab); Item val2 = bundle.LoadAsset("Assets/CleaningAssets/BroomItem.asset"); ToolItem toolItem2 = val2.spawnPrefab.AddComponent(); val2.spawnPrefab.AddComponent(); val2.itemSpawnsOnGround = true; val2.canBeGrabbedBeforeGameStart = true; toolItem2.toolType = "broom"; ((GrabbableObject)toolItem2).grabbable = true; ((GrabbableObject)toolItem2).grabbableToEnemies = true; ((GrabbableObject)toolItem2).itemProperties = val2; Items.RegisterItem(val2); NetworkPrefabs.RegisterNetworkPrefab(val2.spawnPrefab); tools.Add(val2.spawnPrefab); Item val3 = bundle.LoadAsset("Assets/CleaningAssets/GarbageBox.asset"); ToolItem toolItem3 = val3.spawnPrefab.AddComponent(); val3.spawnPrefab.AddComponent(); val3.itemSpawnsOnGround = true; val3.canBeGrabbedBeforeGameStart = true; toolItem3.toolType = "garbage"; ((GrabbableObject)toolItem3).grabbable = true; ((GrabbableObject)toolItem3).grabbableToEnemies = true; ((GrabbableObject)toolItem3).itemProperties = val3; Items.RegisterItem(val3); NetworkPrefabs.RegisterNetworkPrefab(val3.spawnPrefab); tools.Add(val3.spawnPrefab); Item val4 = bundle.LoadAsset("Assets/CleaningAssets/DusterItem.asset"); ToolItem toolItem4 = val4.spawnPrefab.AddComponent(); val4.spawnPrefab.AddComponent(); val4.canBeGrabbedBeforeGameStart = true; val4.itemSpawnsOnGround = true; toolItem4.toolType = "vacuum"; ((GrabbableObject)toolItem4).grabbable = true; ((GrabbableObject)toolItem4).grabbableToEnemies = true; ((GrabbableObject)toolItem4).itemProperties = val4; Items.RegisterItem(val4); NetworkPrefabs.RegisterNetworkPrefab(val4.spawnPrefab); tools.Add(val4.spawnPrefab); UnlockablesList val5 = bundle.LoadAsset("Assets/CleaningAssets/TestUnlocks.asset"); val5.unlockables[0].prefabObject.AddComponent(); val5.unlockables[0].prefabObject.AddComponent(); NetworkPrefabs.RegisterNetworkPrefab(val5.unlockables[0].prefabObject); Unlockables.RegisterUnlockable(val5.unlockables[0], 0, (StoreType)0); } private void SetupScrap() { //IL_02fc: Unknown result type (might be due to invalid IL or missing references) //IL_0306: Expected O, but got Unknown Dictionary dictionary = new Dictionary(); AudioClip value = bundle.LoadAsset("Assets/CleaningAssets/mop.mp3"); AudioClip value2 = bundle.LoadAsset("Assets/CleaningAssets/vac.mp3"); AudioClip value3 = bundle.LoadAsset("Assets/CleaningAssets/sweep.mp3"); AudioClip value4 = bundle.LoadAsset("Assets/CleaningAssets/garb.mp3"); dictionary.Add("mop", value); dictionary.Add("vacuum", value2); dictionary.Add("broom", value3); dictionary.Add("garbage", value4); Dictionary dictionary2 = new Dictionary(); Item val = bundle.LoadAsset("Assets/CleaningAssets/GarbageBagItem.asset"); val.spawnPrefab.AddComponent(); Item val2 = bundle.LoadAsset("Assets/CleaningAssets/BucketItem.asset"); val2.spawnPrefab.AddComponent(); NetworkPrefabs.RegisterNetworkPrefab(val.spawnPrefab); NetworkPrefabs.RegisterNetworkPrefab(val2.spawnPrefab); dictionary2.Add("mop", val2); dictionary2.Add("vacuum", val); dictionary2.Add("broom", val); dictionary2.Add("garbage", val); foreach (KeyValuePair messPath in messPaths) { Item val3 = bundle.LoadAsset(messPath.Key); val3.spawnPrefab.AddComponent(); MessItem messItem = val3.spawnPrefab.AddComponent(); messItem.loot = dictionary2[messPath.Value].spawnPrefab; messItem.toolType = messPath.Value; messItem.cleanNoise = dictionary[messPath.Value]; val3.maxValue = cfg.TRASH_MAX; val3.minValue = cfg.TRASH_MIN; NetworkPrefabs.RegisterNetworkPrefab(val3.spawnPrefab); Items.RegisterScrap(val3, cfg.MESS_RARITY, (LevelTypes)(-1)); if (messPath.Key.Contains("Bracken")) { BodySpawns.Add("Flowerman", val3); } } foreach (KeyValuePair pair in bodyPaths) { Item val4 = bundle.LoadAsset(pair.Key); val4.spawnPrefab.AddComponent(); val4.spawnPrefab.AddComponent(); val4.maxValue = maxBodyValues[pair.Key]; val4.minValue = minBodyValues[pair.Key]; val4.weight = bodyWeights[pair.Key]; NetworkPrefabs.RegisterNetworkPrefab(val4.spawnPrefab); SpawnableMapObjectDef val5 = ScriptableObject.CreateInstance(); val5.spawnableMapObject = new SpawnableMapObject(); val5.spawnableMapObject.prefabToSpawn = val4.spawnPrefab; MapObjects.RegisterMapObject(val5, (LevelTypes)(-1), (Func)((SelectableLevel level) => pair.Value)); Items.RegisterItem(val4); BodySpawns.Add(pathToName[pair.Key], val4); } } } } namespace CleaningCompany.Patches { [HarmonyPatch(typeof(EnemyAI))] internal class EnemyAIPatcher { private static ulong currentEnemy = 9999999uL; [HarmonyPrefix] [HarmonyPatch("KillEnemyServerRpc")] private static void SpawnScrapBody(EnemyAI __instance) { //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_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) if (currentEnemy != ((NetworkBehaviour)__instance).NetworkObject.NetworkObjectId) { currentEnemy = ((NetworkBehaviour)__instance).NetworkObject.NetworkObjectId; string enemyName = __instance.enemyType.enemyName; if (Plugin.instance.BodySpawns.ContainsKey(enemyName)) { GameObject val = Object.Instantiate(Plugin.instance.BodySpawns[enemyName].spawnPrefab, ((Component)__instance).transform.position + Vector3.up, Quaternion.identity); val.GetComponent().Spawn(false); ((Component)__instance).gameObject.SetActive(false); } } } } [HarmonyPatch(typeof(GrabbableObject))] internal class GrabbableObjectPatcher { [HarmonyPrefix] [HarmonyPatch("SetScrapValue")] private static bool ReturnFalseGaming(GrabbableObject __instance) { if ((Object)(object)((Component)__instance).GetComponent() != (Object)null) { return false; } return true; } } [HarmonyPatch(typeof(StartOfRound))] internal class StartOfRoundPatcher { [CompilerGenerated] private sealed class d__1 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public StartOfRound __instance; private GameObject 5__1; private GameObject 5__2; private GameObject 5__3; private List.Enumerator <>s__4; private UnlockableItem 5__5; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__1(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; 5__2 = null; 5__3 = null; <>s__4 = default(List.Enumerator); 5__5 = null; <>1__state = -2; } private bool MoveNext() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.5f); <>1__state = 1; return true; case 1: <>1__state = -1; if ((Object)(object)GameObject.Find("TestCabinet(Clone)") == (Object)null) { 5__1 = null; <>s__4 = __instance.unlockablesList.unlockables.GetEnumerator(); try { while (<>s__4.MoveNext()) { 5__5 = <>s__4.Current; if (5__5.unlockableName == "Cleaning Cabinet") { 5__1 = 5__5.prefabObject; break; } 5__5 = null; } } finally { ((IDisposable)<>s__4).Dispose(); } <>s__4 = default(List.Enumerator); 5__2 = GameObject.Find("Terminal"); 5__3 = Object.Instantiate(5__1, 5__2.transform.parent); 5__3.GetComponent().Spawn(false); 5__1 = null; 5__2 = null; 5__3 = 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(); } } [HarmonyPostfix] [HarmonyPatch("Awake")] private static void RemoveScrap(StartOfRound __instance) { //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) if (!Plugin.cfg.SCRAP_SPAWN) { SelectableLevel[] levels = __instance.levels; foreach (SelectableLevel val in levels) { string name = ((Object)val).name; if (!Enum.IsDefined(typeof(LevelTypes), name)) { continue; } LevelTypes val2 = (LevelTypes)Enum.Parse(typeof(LevelTypes), name); foreach (SpawnableItemWithRarity item in val.spawnableScrap) { if (item.spawnableItem.isScrap) { item.rarity = 0; } } } } if (Plugin.cfg.JANITOR_SUIT) { foreach (UnlockableItem unlockable in __instance.unlockablesList.unlockables) { if ((Object)(object)unlockable.suitMaterial != (Object)null && unlockable.alreadyUnlocked) { unlockable.suitMaterial.mainTexture = (Texture)(object)Plugin.instance.janitorMat; break; } } PlayerControllerB[] array = Object.FindObjectsOfType(); foreach (PlayerControllerB val3 in array) { ((Renderer)val3.thisPlayerModel).material.mainTexture = (Texture)(object)Plugin.instance.janitorMat; ((Renderer)val3.thisPlayerModelLOD1).material.mainTexture = (Texture)(object)Plugin.instance.janitorMat; ((Renderer)val3.thisPlayerModelLOD2).material.mainTexture = (Texture)(object)Plugin.instance.janitorMat; ((Renderer)val3.thisPlayerModelArms).material.mainTexture = (Texture)(object)Plugin.instance.janitorMat; } } if (Plugin.cfg.JANITOR_VA) { __instance.zeroDaysLeftAlertSFX = Plugin.instance.zeroDays; __instance.firedVoiceSFX = Plugin.instance.firedSFX; __instance.shipIntroSpeechSFX = Plugin.instance.introSFX; } ((MonoBehaviour)__instance).StartCoroutine(SpawnCabinet(__instance)); } [IteratorStateMachine(typeof(d__1))] private static IEnumerator SpawnCabinet(StartOfRound __instance) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__1(0) { __instance = __instance }; } } } namespace CleaningCompany.Monos { internal class BodySyncer : NetworkBehaviour { public override void OnNetworkSpawn() { //IL_0053: Unknown result type (might be due to invalid IL or missing references) ((NetworkBehaviour)this).OnNetworkSpawn(); if (((NetworkBehaviour)this).IsHost || ((NetworkBehaviour)this).IsServer) { PhysicsProp component = ((Component)this).GetComponent(); if (((GrabbableObject)component).scrapValue == 0) { int price = Random.Range(((GrabbableObject)component).itemProperties.minValue, ((GrabbableObject)component).itemProperties.maxValue); SyncDetailsClientRpc(price, new NetworkBehaviourReference((NetworkBehaviour)(object)component)); } } } [ClientRpc] private void SyncDetailsClientRpc(int price, NetworkBehaviourReference netRef) { //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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: 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(3571516743u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, price); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref netRef, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3571516743u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; PhysicsProp val3 = default(PhysicsProp); ((NetworkBehaviourReference)(ref netRef)).TryGet(ref val3, (NetworkManager)null); if ((Object)(object)val3 != (Object)null) { ((GrabbableObject)val3).scrapValue = price; ((GrabbableObject)val3).itemProperties.creditsWorth = price; ((Component)val3).GetComponentInChildren().subText = $"Value: ${price}"; Debug.Log((object)"Successfully synced body values"); } else { Debug.LogError((object)"Failed to resolve network reference!"); } } } 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 ((NetworkBehaviour)this).__registerRpc(3571516743u, new RpcReceiveHandler(__rpc_handler_3571516743), "SyncDetailsClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_3571516743(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_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0060: 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) { int price = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref price); NetworkBehaviourReference netRef = default(NetworkBehaviourReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref netRef, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((BodySyncer)(object)target).SyncDetailsClientRpc(price, netRef); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "BodySyncer"; } } [RequireComponent(typeof(AudioSource))] internal class CabinetScript : NetworkBehaviour { [CompilerGenerated] private sealed class d__20 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public NetworkObject netObj; public CabinetScript <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__20(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.5f); <>1__state = 1; return true; case 1: <>1__state = -1; netObj.TrySetParent(((Component)<>4__this).transform.parent, true); 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(); } } private Animator leftDoor; private Animator rightDoor; private AudioSource audio; private AudioClip open; private AudioClip close; private InteractTrigger leftTrig; private InteractTrigger rightTrig; private InteractTrigger broomTrig; private InteractTrigger vacTrig; private InteractTrigger mopTrig; private InteractTrigger garbTrig; private bool leftClosed; private bool rightClosed; private Dictionary doorTip = new Dictionary { { true, "Open : [E]" }, { false, "Close : [E]" } }; private void Start() { audio = ((Component)this).GetComponent(); open = Plugin.instance.open; close = Plugin.instance.close; leftDoor = ((Component)((Component)this).transform.GetChild(0).GetChild(1)).GetComponent(); rightDoor = ((Component)((Component)this).transform.GetChild(0).GetChild(0)).GetComponent(); leftTrig = ((Component)leftDoor).GetComponent(); ((UnityEvent)(object)leftTrig.onInteract).AddListener((UnityAction)ChangeLeftDoorState); rightTrig = ((Component)rightDoor).GetComponent(); ((UnityEvent)(object)rightTrig.onInteract).AddListener((UnityAction)ChangeRightDoorState); broomTrig = ((Component)((Component)this).transform.GetChild(0).GetChild(2)).GetComponent(); ((UnityEvent)(object)broomTrig.onInteract).AddListener((UnityAction)GrabBroom); mopTrig = ((Component)((Component)this).transform.GetChild(0).GetChild(3)).GetComponent(); ((UnityEvent)(object)mopTrig.onInteract).AddListener((UnityAction)GrabMop); garbTrig = ((Component)((Component)this).transform.GetChild(0).GetChild(4)).GetComponent(); ((UnityEvent)(object)garbTrig.onInteract).AddListener((UnityAction)GrabGarb); vacTrig = ((Component)((Component)this).transform.GetChild(0).GetChild(5)).GetComponent(); ((UnityEvent)(object)vacTrig.onInteract).AddListener((UnityAction)GrabVac); } private void GrabBroom(PlayerControllerB player) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) SpawnToolServerRpc(1, ((Component)player).transform.position); } private void GrabVac(PlayerControllerB player) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) SpawnToolServerRpc(3, ((Component)player).transform.position); } private void GrabMop(PlayerControllerB player) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) SpawnToolServerRpc(0, ((Component)player).transform.position); } private void GrabGarb(PlayerControllerB player) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) SpawnToolServerRpc(2, ((Component)player).transform.position); } [ServerRpc(RequireOwnership = false)] private void SpawnToolServerRpc(int toolID, Vector3 pos) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_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_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: 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(495819505u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, toolID); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref pos); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 495819505u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; GameObject val3 = Object.Instantiate(Plugin.instance.tools[toolID], pos, Quaternion.identity); NetworkObject component = val3.GetComponent(); component.Spawn(false); ((MonoBehaviour)this).StartCoroutine(setParentToShip(component)); } } } [IteratorStateMachine(typeof(d__20))] private IEnumerator setParentToShip(NetworkObject netObj) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__20(0) { <>4__this = this, netObj = netObj }; } private void ChangeLeftDoorState(PlayerControllerB player) { if (leftClosed) { audio.PlayOneShot(open); } else { audio.PlayOneShot(close); } if (((NetworkBehaviour)this).IsHost || ((NetworkBehaviour)this).IsServer) { TriggerDoorClientRpc(left: true); } else { TriggerDoorServerRpc(left: true); } } private void ChangeRightDoorState(PlayerControllerB player) { if (rightClosed) { audio.PlayOneShot(open); } else { audio.PlayOneShot(close); } if (((NetworkBehaviour)this).IsHost || ((NetworkBehaviour)this).IsServer) { TriggerDoorClientRpc(left: false); } else { TriggerDoorServerRpc(left: false); } } [ServerRpc(RequireOwnership = false)] private void TriggerDoorServerRpc(bool left) { //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) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2501078389u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref left, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2501078389u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; TriggerDoorClientRpc(left); } } } [ClientRpc] private void TriggerDoorClientRpc(bool left) { //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(3535707651u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref left, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3535707651u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (left) { leftDoor.SetTrigger("Play"); leftClosed = !leftClosed; leftTrig.hoverTip = doorTip[leftClosed]; } else { rightDoor.SetTrigger("Play"); rightClosed = !rightClosed; rightTrig.hoverTip = doorTip[rightClosed]; } } } 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 ((NetworkBehaviour)this).__registerRpc(495819505u, new RpcReceiveHandler(__rpc_handler_495819505), "SpawnToolServerRpc"); ((NetworkBehaviour)this).__registerRpc(2501078389u, new RpcReceiveHandler(__rpc_handler_2501078389), "TriggerDoorServerRpc"); ((NetworkBehaviour)this).__registerRpc(3535707651u, new RpcReceiveHandler(__rpc_handler_3535707651), "TriggerDoorClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_495819505(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int toolID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref toolID); Vector3 pos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pos); target.__rpc_exec_stage = (__RpcExecStage)1; ((CabinetScript)(object)target).SpawnToolServerRpc(toolID, pos); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2501078389(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_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool left = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref left, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CabinetScript)(object)target).TriggerDoorServerRpc(left); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3535707651(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_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool left = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref left, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CabinetScript)(object)target).TriggerDoorClientRpc(left); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "CabinetScript"; } } internal class MessItem : NetworkBehaviour { private Animator anim; public GameObject loot; public string toolType; private InteractTrigger trig; private AudioSource audio; public AudioClip cleanNoise; private int cleaning = 0; private void Awake() { trig = ((Component)this).GetComponent(); ((UnityEvent)(object)trig.onInteract).AddListener((UnityAction)CleanMess); ((UnityEvent)(object)trig.onStopInteract).AddListener((UnityAction)StopMess); ((UnityEvent)(object)trig.onInteractEarly).AddListener((UnityAction)PlayMess); anim = ((Component)this).GetComponentInChildren(); audio = ((Component)this).GetComponent(); audio.clip = cleanNoise; } private void Update() { PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; if ((Object)(object)localPlayerController == (Object)null) { trig.interactable = false; return; } if ((Object)(object)localPlayerController.currentlyHeldObjectServer == (Object)null) { trig.interactable = false; return; } ToolItem component = ((Component)localPlayerController.currentlyHeldObjectServer).GetComponent(); if ((Object)(object)component == (Object)null) { trig.interactable = false; return; } if (component.toolType == toolType) { trig.interactable = true; } else { trig.interactable = false; } anim.SetInteger("CleanStatus", cleaning); if (cleaning == 1) { if (!audio.isPlaying) { audio.Play(); } } else if (audio.isPlaying) { audio.Stop(); } } private void CleanMess(PlayerControllerB player) { SpawnLootServerRpc(); audio.Stop(); audio.volume = 0f; } private void StopMess(PlayerControllerB player) { cleaning = 0; } private void PlayMess(PlayerControllerB player) { cleaning = 1; } [ServerRpc(RequireOwnership = false)] private void SpawnLootServerRpc() { //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_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: 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) //IL_0120: 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(969310882u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 969310882u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; GameObject val3 = Object.Instantiate(loot, ((Component)this).transform.position + Vector3.up, Quaternion.identity); val3.GetComponent().Spawn(false); PhysicsProp component = val3.GetComponent(); int price = Random.Range(((GrabbableObject)component).itemProperties.minValue, ((GrabbableObject)component).itemProperties.maxValue); SyncDetailsClientRpc(price, new NetworkBehaviourReference((NetworkBehaviour)(object)component)); } } } [ClientRpc] private void SyncDetailsClientRpc(int price, NetworkBehaviourReference netRef) { //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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: 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(1088653732u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, price); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref netRef, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1088653732u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; PhysicsProp val3 = default(PhysicsProp); ((NetworkBehaviourReference)(ref netRef)).TryGet(ref val3, (NetworkManager)null); if ((Object)(object)val3 != (Object)null) { ((GrabbableObject)val3).scrapValue = price; ((GrabbableObject)val3).itemProperties.creditsWorth = price; ((Component)val3).GetComponentInChildren().subText = $"Value: ${price}"; Debug.Log((object)"Successfully synced trash values"); } else { Debug.LogError((object)"Failed to resolve network reference!"); } ((Component)this).gameObject.SetActive(false); } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(969310882u, new RpcReceiveHandler(__rpc_handler_969310882), "SpawnLootServerRpc"); ((NetworkBehaviour)this).__registerRpc(1088653732u, new RpcReceiveHandler(__rpc_handler_1088653732), "SyncDetailsClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_969310882(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; ((MessItem)(object)target).SpawnLootServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1088653732(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_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0060: 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) { int price = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref price); NetworkBehaviourReference netRef = default(NetworkBehaviourReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref netRef, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((MessItem)(object)target).SyncDetailsClientRpc(price, netRef); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "MessItem"; } } internal class ToolItem : PhysicsProp { public string toolType; protected override void __initializeVariables() { ((PhysicsProp)this).__initializeVariables(); } protected override void __initializeRpcs() { ((PhysicsProp)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "ToolItem"; } } } namespace CleaningCompany.Misc { public class AudioMixerFixer : MonoBehaviour { private static AudioMixerGroup _masterDiageticMixer; [SerializeField] private List sourcesToFix; public static AudioMixerGroup MasterDiageticMixer { get { if ((Object)(object)_masterDiageticMixer == (Object)null) { AudioSource val = (from p in ((Component)GameNetworkManager.Instance).GetComponent().NetworkConfig.Prefabs.Prefabs select p.Prefab.GetComponentInChildren() into p where (Object)(object)p != (Object)null select ((Component)p).GetComponentInChildren() into p where (Object)(object)p != (Object)null select p).FirstOrDefault(); if ((Object)(object)val == (Object)null) { throw new Exception("Failed to locate a suitable AudioSource output mixer to reference! Could you be calling this method before the GameNetworkManager is initialized?"); } _masterDiageticMixer = val.outputAudioMixerGroup; } return _masterDiageticMixer; } } private void Start() { AudioSource[] componentsInChildren = ((Component)this).GetComponentsInChildren(); foreach (AudioSource item in componentsInChildren) { if (!sourcesToFix.Contains(item)) { sourcesToFix.Add(item); } } foreach (AudioSource item2 in sourcesToFix) { item2.outputAudioMixerGroup = MasterDiageticMixer; } } } public class PluginConfig { private readonly ConfigFile configFile; public bool JANITOR_SUIT { get; set; } public bool JANITOR_VA { get; set; } public int MAX_SCAVS { get; set; } public int MAX_SPIDERS { get; set; } public int MAX_HOARDERS { get; set; } public int MAX_THUMPERS { get; set; } public int MAX_CENTIPEDES { get; set; } public float SCAV_CURVE { get; set; } public float SPIDER_CURVE { get; set; } public float THUMPER_CURVE { get; set; } public float CENTIPEDE_CURVE { get; set; } public float HOARDER_CURVE { get; set; } public int SCAV_MIN { get; set; } public int SPIDER_MIN { get; set; } public int THUMPER_MIN { get; set; } public int CENTIPEDE_MIN { get; set; } public int HOARDER_MIN { get; set; } public int SCAV_MAX { get; set; } public int SPIDER_MAX { get; set; } public int THUMPER_MAX { get; set; } public int CENTIPEDE_MAX { get; set; } public int HOARDER_MAX { get; set; } public float SCAV_WEIGHT { get; set; } public float SPIDER_WEIGHT { get; set; } public float THUMPER_WEIGHT { get; set; } public float CENTIPEDE_WEIGHT { get; set; } public float HOARDER_WEIGHT { get; set; } public int TRASH_MIN { get; set; } public int TRASH_MAX { get; set; } public bool SCRAP_SPAWN { get; set; } public int MESS_RARITY { get; set; } public PluginConfig(ConfigFile cfg) { configFile = cfg; } private T ConfigEntry(string section, string key, T defaultVal, string description) { return configFile.Bind(section, key, defaultVal, description).Value; } public void InitBindings() { JANITOR_SUIT = ConfigEntry("Janitor Theme", "Janitor Suits", defaultVal: true, "If true the default suit will be replaced with a janitor suit."); JANITOR_VA = ConfigEntry("Janitor Theme", "Janitor Voice Acting", defaultVal: true, "If true the default loud speaker voicelines will be replaced with Rufus'."); MAX_CENTIPEDES = ConfigEntry("Max Body Spawns", "Max number of Centipede Bodies", 2, ""); MAX_HOARDERS = ConfigEntry("Max Body Spawns", "Max number of Hoarding Bug Bodies", 1, ""); MAX_SCAVS = ConfigEntry("Max Body Spawns", "Max number of Scavenger Bodies", 3, ""); MAX_SPIDERS = ConfigEntry("Max Body Spawns", "Max number of Spider Bodies", 1, ""); MAX_THUMPERS = ConfigEntry("Max Body Spawns", "Max number of Thumper Bodies", 1, ""); CENTIPEDE_CURVE = ConfigEntry("Body Spawn Chance", "Max number of Centipede Bodies", 0.25f, "Lower this number to increase spawn chance."); HOARDER_CURVE = ConfigEntry("Body Spawn Chance", "Max number of Hoarding Bug Bodies", 0.35f, "Lower this number to increase spawn chance."); SCAV_CURVE = ConfigEntry("Body Spawn Chance", "Max number of Scavenger Bodies", 0.35f, "Lower this number to increase spawn chance."); SPIDER_CURVE = ConfigEntry("Body Spawn Chance", "Max number of Spider Bodies", 0.5f, "Lower this number to increase spawn chance."); THUMPER_CURVE = ConfigEntry("Body Spawn Chance", "Max number of Thumper Bodies", 0.75f, "Lower this number to increase spawn chance."); CENTIPEDE_MIN = ConfigEntry("Body Values", "Min price of Centipede Bodies", 45, ""); CENTIPEDE_MAX = ConfigEntry("Body Values", "Max price of Centipede Bodies", 70, ""); HOARDER_MIN = ConfigEntry("Body Values", "Min price of Hoarding Bug Bodies", 55, ""); HOARDER_MAX = ConfigEntry("Body Values", "Max price of Hoarding Bug Bodies", 88, ""); SCAV_MIN = ConfigEntry("Body Values", "Min price of Scavenger Bodies", 100, ""); SCAV_MAX = ConfigEntry("Body Values", "Max price of Scavenger Bodies", 170, ""); SPIDER_MIN = ConfigEntry("Body Values", "Min price of Spider Bodies", 70, ""); SPIDER_MAX = ConfigEntry("Body Values", "Max price of Spider Bodies", 110, ""); THUMPER_MIN = ConfigEntry("Body Values", "Min price of Thumper Bodies", 120, ""); THUMPER_MAX = ConfigEntry("Body Values", "Max price of Thumper Bodies", 160, ""); CENTIPEDE_WEIGHT = ConfigEntry("Body Weights", "Weight of Centipede Bodies", 1.65f, ""); HOARDER_WEIGHT = ConfigEntry("Body Weights", "Weight of Hoarding Bug Bodies", 1.6f, ""); SCAV_WEIGHT = ConfigEntry("Body Weights", "Weight of Scavenger Bodies", 2.5f, ""); SPIDER_WEIGHT = ConfigEntry("Body Weights", "Weight of Spider Bodies", 2.3f, ""); THUMPER_WEIGHT = ConfigEntry("Body Weights", "Weight of Thumper Bodies", 2.9f, ""); TRASH_MIN = ConfigEntry("Trash Value", "Min price of trash", 20, ""); TRASH_MAX = ConfigEntry("Trash Value", "Max price of trash", 70, ""); SCRAP_SPAWN = ConfigEntry("Scrap", "Spawn regular scrap", defaultVal: false, ""); MESS_RARITY = ConfigEntry("Scrap", "Mess rarity", 50, "Higher means it has a higher chance of spawning. if the above option is false this doesn't matter."); } } } namespace __GEN { internal class NetworkVariableSerializationHelper { [RuntimeInitializeOnLoadMethod] internal static void InitializeSerialization() { } } } namespace CleaningCompany.NetcodePatcher { [AttributeUsage(AttributeTargets.Module)] internal class NetcodePatchedAssemblyAttribute : Attribute { } }