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 BrutalCompanyMinusExtraReborn v1.30.6
BrutalCompanyMinus.dll
Decompiled a day 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.Globalization; using System.IO; using System.Linq; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text.RegularExpressions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using BrutalCompanyMinus; using BrutalCompanyMinus.Minus; using BrutalCompanyMinus.Minus.CustomEvents; using BrutalCompanyMinus.Minus.Events; using BrutalCompanyMinus.Minus.Handlers; using BrutalCompanyMinus.Minus.Handlers.CustomEvents; using BrutalCompanyMinus.Minus.Handlers.Modded; using BrutalCompanyMinus.Minus.MonoBehaviours; using BrutalCompanyMinus.NetcodePatcher; using Dawn; using DigitalRuby.ThunderAndLightning; using ElevatorMod.Patches; using FacilityMeltdown.API; using GameNetcodeStuff; using HarmonyLib; using HotbarPlus.Networking; using Microsoft.CodeAnalysis; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; using Scoops.misc; using SelfSortingStorage.Cupboard; using ShipInventoryUpdated.Objects; using ShipInventoryUpdated.Scripts; using TMPro; using Unity.Collections; using Unity.Netcode; using UnityEngine; using UnityEngine.AI; using UnityEngine.Animations.Rigging; using UnityEngine.Events; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Controls; using UnityEngine.Rendering.HighDefinition; using UnityEngine.SceneManagement; using UnityEngine.UI; using WeatherRegistry; using com.github.zehsteam.TakeyGokuBracken; using com.github.zehsteam.ToilHead; [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("SoftDiamond")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+e984d2bbd4d493545c96ef2525be5124ad35a4b0")] [assembly: AssemblyProduct("BrutalCompanyMinusExtraReborn")] [assembly: AssemblyTitle("BrutalCompanyMinus")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.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; } } } public class BloodMoonWeather : MonoBehaviour { private float randomThunderTime; private float timeAtLastStrike; private Vector3 lastRandomStrikePosition; private Random seed; public AudioClip[] strikeSFX; public AudioClip[] distantThunderSFX; public LightningBoltPrefabScript randomThunder; public LightningBoltPrefabScript targetedThunder; public AudioSource randomStrikeAudio; public AudioSource randomStrikeAudioB; private bool lastStrikeAudioUsed; public AudioSource targetedStrikeAudio; private RaycastHit rayHit; private GameObject[] outsideNodes; private NavMeshHit navHit; public ParticleSystem explosionEffectParticle; private List<GrabbableObject> metalObjects = new List<GrabbableObject>(); private GrabbableObject targetingMetalObject; private float getObjectToTargetInterval; private float strikeMetalObjectTimer; private bool hasShownStrikeWarning; public ParticleSystem staticElectricityParticle; private GameObject setStaticToObject; private GrabbableObject setStaticGrabbableObject; public AudioClip staticElectricityAudio; private float lastGlobalTimeUsed; private float globalTimeAtLastStrike; private Random targetedThunderRandom; private void OnEnable() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Expected O, but got Unknown //IL_0084: Unknown result type (might be due to invalid IL or missing references) lastRandomStrikePosition = Vector3.zero; targetedThunderRandom = new Random(StartOfRound.Instance.randomMapSeed); TimeOfDay.Instance.onTimeSync.AddListener(new UnityAction(OnGlobalTimeSync)); globalTimeAtLastStrike = TimeOfDay.Instance.globalTime; lastGlobalTimeUsed = 0f; randomThunderTime = TimeOfDay.Instance.globalTime + 7f; timeAtLastStrike = TimeOfDay.Instance.globalTime; navHit = default(NavMeshHit); outsideNodes = (from x in GameObject.FindGameObjectsWithTag("OutsideAINode") orderby x.transform.position.x + x.transform.position.z select x).ToArray(); if (((Behaviour)StartOfRound.Instance.spectateCamera).enabled) { SwitchCamera(StartOfRound.Instance.spectateCamera); } else { SwitchCamera(GameNetworkManager.Instance.localPlayerController.gameplayCamera); } seed = new Random(StartOfRound.Instance.randomMapSeed); DetermineNextStrikeInterval(); ((MonoBehaviour)this).StartCoroutine(GetMetalObjectsAfterDelay()); } private void OnDisable() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown TimeOfDay.Instance.onTimeSync.RemoveListener(new UnityAction(OnGlobalTimeSync)); } private void OnGlobalTimeSync() { float num = RoundUpToNearestTen(TimeOfDay.Instance.globalTime); if (num != lastGlobalTimeUsed) { lastGlobalTimeUsed = num; seed = new Random((int)num + StartOfRound.Instance.randomMapSeed); timeAtLastStrike = TimeOfDay.Instance.globalTime; } } private IEnumerator GetMetalObjectsAfterDelay() { yield return (object)new WaitForSeconds(15f); GrabbableObject[] array = Object.FindObjectsOfType<GrabbableObject>(); for (int i = 0; i < array.Length; i++) { if (array[i].itemProperties.isConductiveMetal) { metalObjects.Add(array[i]); } } } public void SwitchCamera(Camera newCamera) { ((LightningBoltScript)randomThunder).Camera = newCamera; ((LightningBoltScript)targetedThunder).Camera = newCamera; } private void DetermineNextStrikeInterval() { timeAtLastStrike = randomThunderTime; float num = seed.Next(-5, 110); randomThunderTime += Mathf.Clamp(num * 0.25f, 0.6f, 110f) / Mathf.Clamp(TimeOfDay.Instance.currentWeatherVariable, 1f, 100f); } private int RoundUpToNearestTen(float x) { return (int)(x / 10f) * 10; } private void Update() { //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_02fc: Unknown result type (might be due to invalid IL or missing references) //IL_036c: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) if (!((Component)this).gameObject.activeInHierarchy) { return; } if (TimeOfDay.Instance.globalTime > randomThunderTime) { LightningStrikeRandom(); DetermineNextStrikeInterval(); } if ((Object)(object)setStaticToObject != (Object)null && (Object)(object)setStaticGrabbableObject != (Object)null) { if (setStaticGrabbableObject.isInFactory) { staticElectricityParticle.Stop(); } ((Component)staticElectricityParticle).transform.position = setStaticToObject.transform.position; } if (!((NetworkBehaviour)RoundManager.Instance).IsOwner) { return; } if ((Object)(object)targetingMetalObject == (Object)null) { if (metalObjects.Count <= 0) { return; } if (getObjectToTargetInterval <= 4f) { getObjectToTargetInterval += Time.deltaTime; return; } hasShownStrikeWarning = false; strikeMetalObjectTimer = Mathf.Clamp(Random.Range(1f, 28f), 0f, 20f); getObjectToTargetInterval = 0f; float num = 1000f; for (int i = 0; i < metalObjects.Count; i++) { if (metalObjects[i].isInFactory || metalObjects[i].isInShipRoom) { continue; } for (int j = 0; j < StartOfRound.Instance.allPlayerScripts.Length; j++) { if (StartOfRound.Instance.allPlayerScripts[j].isPlayerControlled) { float num2 = Vector3.Distance(((Component)metalObjects[i]).transform.position, ((Component)StartOfRound.Instance.allPlayerScripts[j]).transform.position); if (num2 < num) { targetingMetalObject = metalObjects[i]; num = num2; break; } } } if (Random.Range(0, 100) < 20) { break; } } if ((Object)(object)targetingMetalObject != (Object)null && targetingMetalObject.isHeld) { strikeMetalObjectTimer = Mathf.Clamp(strikeMetalObjectTimer + Time.deltaTime, 4f, 20f); } return; } strikeMetalObjectTimer -= Time.deltaTime; if (strikeMetalObjectTimer <= 0f) { if (!targetingMetalObject.isInFactory) { RoundManager.Instance.LightningStrikeServerRpc(((Component)targetingMetalObject).transform.position); } getObjectToTargetInterval = 5f; targetingMetalObject = null; } else if (strikeMetalObjectTimer < 10f && !hasShownStrikeWarning) { hasShownStrikeWarning = true; float num3 = Mathf.Abs(strikeMetalObjectTimer - 10f); RoundManager.Instance.ShowStaticElectricityWarningServerRpc(NetworkObjectReference.op_Implicit(((Component)targetingMetalObject).gameObject.GetComponent<NetworkObject>()), num3); } } public void SetStaticElectricityWarning(NetworkObject warningObject, float particleTime) { //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) setStaticToObject = ((Component)warningObject).gameObject; GrabbableObject component = ((Component)warningObject).gameObject.GetComponent<GrabbableObject>(); if ((Object)(object)component != (Object)null) { setStaticGrabbableObject = ((Component)warningObject).gameObject.GetComponent<GrabbableObject>(); for (int i = 0; i < GameNetworkManager.Instance.localPlayerController.ItemSlots.Length; i++) { if ((Object)(object)GameNetworkManager.Instance.localPlayerController.ItemSlots[i] == (Object)(object)component) { HUDManager.Instance.DisplayTip("ALERT!", "Drop your metallic items now! A static charge has been detected. You have seconds left to live.", true, true, "LC_LightningTip"); } } } ShapeModule shape = staticElectricityParticle.shape; ((ShapeModule)(ref shape)).meshRenderer = setStaticToObject.GetComponentInChildren<MeshRenderer>(); staticElectricityParticle.time = particleTime; staticElectricityParticle.Play(); staticElectricityParticle.time = particleTime; ((Component)staticElectricityParticle).gameObject.GetComponent<AudioSource>().clip = staticElectricityAudio; ((Component)staticElectricityParticle).gameObject.GetComponent<AudioSource>().Play(); ((Component)staticElectricityParticle).gameObject.GetComponent<AudioSource>().time = particleTime; } private void LightningStrikeRandom() { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: 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_00fa: 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) Vector3 randomNavMeshPositionInBoxPredictable; if (seed.Next(0, 100) < 60 && (randomThunderTime - timeAtLastStrike) * TimeOfDay.Instance.currentWeatherVariable < 3f) { randomNavMeshPositionInBoxPredictable = lastRandomStrikePosition; } else { int num = seed.Next(0, outsideNodes.Length); if (outsideNodes == null || (Object)(object)outsideNodes[num] == (Object)null) { outsideNodes = (from x in GameObject.FindGameObjectsWithTag("OutsideAINode") orderby x.transform.position.x + x.transform.position.z select x).ToArray(); num = seed.Next(0, outsideNodes.Length); } randomNavMeshPositionInBoxPredictable = outsideNodes[num].transform.position; randomNavMeshPositionInBoxPredictable = RoundManager.Instance.GetRandomNavMeshPositionInBoxPredictable(randomNavMeshPositionInBoxPredictable, 15f, navHit, seed, -1, 1f); } lastRandomStrikePosition = randomNavMeshPositionInBoxPredictable; LightningStrike(randomNavMeshPositionInBoxPredictable, useTargetedObject: false); } public void LightningStrike(Vector3 strikePosition, bool useTargetedObject) { //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: 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_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: 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_00be: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_0254: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) Random random; AudioSource val; LightningBoltPrefabScript val2; if (useTargetedObject) { random = targetedThunderRandom; staticElectricityParticle.Stop(); ((Component)staticElectricityParticle).GetComponent<AudioSource>().Stop(); setStaticToObject = null; val = targetedStrikeAudio; val2 = targetedThunder; } else { random = new Random(seed.Next(0, 10000)); val = ((!lastStrikeAudioUsed) ? randomStrikeAudio : randomStrikeAudioB); lastStrikeAudioUsed = !lastStrikeAudioUsed; val2 = randomThunder; } bool flag = false; Vector3 val3 = Vector3.zero; for (int i = 0; i < 7; i++) { if (i == 6) { val3 = strikePosition + Vector3.up * 80f; } else { float num = random.Next(-32, 32); float num2 = random.Next(-32, 32); val3 = strikePosition + Vector3.up * 80f + new Vector3(num, 0f, num2); } if (!Physics.Linecast(val3, strikePosition + Vector3.up * 0.5f, ref rayHit, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1)) { flag = true; break; } } if (!flag) { if (!Physics.Raycast(val3, strikePosition - val3, ref rayHit, 100f, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1)) { return; } strikePosition = ((RaycastHit)(ref rayHit)).point; } Debug.DrawLine(val3, strikePosition, Color.red, 10f); val2.Source.transform.position = val3; val2.Destination.transform.position = strikePosition; ((LightningBoltPrefabScriptBase)val2).AutomaticModeSeconds = 0.2f; ((Component)val).transform.position = strikePosition + Vector3.up * 0.5f; Landmine.SpawnExplosion(strikePosition + Vector3.up * 0.25f, false, 2.4f, 5f, 50, 0f, (GameObject)null, false); ((Component)explosionEffectParticle).transform.position = strikePosition + Vector3.up * 0.25f; explosionEffectParticle.Play(); PlayThunderEffects(strikePosition, val); } private void PlayThunderEffects(Vector3 strikePosition, AudioSource audio) { //IL_003d: 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_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB val = GameNetworkManager.Instance.localPlayerController; if (val.isPlayerDead && (Object)(object)val.spectatedPlayerScript != (Object)null) { val = val.spectatedPlayerScript; } float num = Vector3.Distance(((Component)val.gameplayCamera).transform.position, strikePosition); bool flag = false; if (num < 40f) { HUDManager.Instance.ShakeCamera((ScreenShakeType)1); } else if (num < 110f) { HUDManager.Instance.ShakeCamera((ScreenShakeType)2); } else { flag = true; } AudioClip[] array = ((!flag) ? strikeSFX : distantThunderSFX); if (!val.isInsideFactory) { RoundManager.PlayRandomClip(audio, array, true, 1f, 0, 1000); } WalkieTalkie.TransmitOneShotAudio(audio, array[Random.Range(0, array.Length)], 1f); Bounds bounds = StartOfRound.Instance.shipBounds.bounds; if (((Bounds)(ref bounds)).Contains(strikePosition)) { ((Component)StartOfRound.Instance.shipAnimatorObject).GetComponent<Animator>().SetTrigger("shipShake"); RoundManager.PlayRandomClip(StartOfRound.Instance.ship3DAudio, StartOfRound.Instance.shipCreakSFX, false, 1f, 0, 1000); StartOfRound.Instance.PowerSurgeShip(); } } } namespace BrutalCompanyMinus { [HarmonyPatch] public class Assets { public enum EnemyName { Bracken, HoardingBug, CoilHead, Thumper, BunkerSpider, Jester, SnareFlea, Hygrodere, GhostGirl, SporeLizard, NutCracker, Masked, EyelessDog, ForestKeeper, EarthLeviathan, BaboonHawk, RoamingLocust, Manticoil, CircuitBee, Lasso, Butler, OldBird, FlowerSnake, Maneater, Barber, GiantKiwi, CadaverGrowths, BushWolf, CadaverBloom, Puma, Stingray } public enum ItemName { LargeAxle, V_TypeEngine, PlasticFish, MetalSheet, LaserPointer, BigBolt, Bottles, Ring, SteeringWheel, CookieMoldPan, EggBeater, JarOfPickles, DustPan, AirHorn, ClownHorn, CashRegister, Candy, GoldBar, YieldSign, HomemadeFlashbang, Gift, Flask, ToyCube, Remote, ToyRobot, MagnifyingGlass, StopSign, TeaKettle, Mug, RedSoda, OldPhone, HairDryer, Brush, Bell, WhoopieCushion, Comedy, Tragedy, RubberDucky, ChemicalJug, FancyLamp, GoldenCup, Painting, Toothpaste, PillBottle, PerfumeBottle, Teeth, Magic7Ball, EasterEgg, ToyTrain, ToiletPaper, SoccerBall, PlasticCup, GarabgeLid, ControlPad, Clock, ZedDog, BabyKiwiEgg, SeveredThigh, SeveredHand, SeveredEar, SeveredBone, SeveredTongue, SeveredHeart, SeveredFoot, SeveredBoneRib } public enum ObjectName { LargeRock1, LargeRock2, LargeRock3, LargeRock4, TreeLeaflessBrown1, GiantPumkin, GreyRockGrouping2, GreyRockGrouping4, Tree, TreeLeafless2, TreeLeafless3, Landmine, Turret, SpikeRoofTrap } public enum AtmosphereName { RollingGroundFog, Rainy, Stormy, Foggy, Flooded, Eclipsed } internal static AssetBundle bundle; internal static AssetBundle customAssetBundle; public static Dictionary<EnemyName, string> EnemyNameList = new Dictionary<EnemyName, string> { { EnemyName.SnareFlea, "Centipede" }, { EnemyName.BunkerSpider, "SandSpider" }, { EnemyName.HoardingBug, "HoarderBug" }, { EnemyName.Bracken, "Flowerman" }, { EnemyName.Thumper, "Crawler" }, { EnemyName.Hygrodere, "Blob" }, { EnemyName.GhostGirl, "DressGirl" }, { EnemyName.SporeLizard, "Puffer" }, { EnemyName.NutCracker, "Nutcracker" }, { EnemyName.EyelessDog, "MouthDog" }, { EnemyName.ForestKeeper, "ForestGiant" }, { EnemyName.EarthLeviathan, "SandWorm" }, { EnemyName.CircuitBee, "RedLocustBees" }, { EnemyName.BaboonHawk, "BaboonHawk" }, { EnemyName.CoilHead, "SpringMan" }, { EnemyName.Jester, "Jester" }, { EnemyName.Lasso, "LassoMan" }, { EnemyName.Masked, "MaskedPlayerEnemy" }, { EnemyName.Manticoil, "Doublewing" }, { EnemyName.RoamingLocust, "DocileLocustBees" }, { EnemyName.Butler, "Butler" }, { EnemyName.OldBird, "RadMech" }, { EnemyName.FlowerSnake, "FlowerSnake" }, { EnemyName.Maneater, "CaveDweller" }, { EnemyName.Barber, "ClaySurgeon" }, { EnemyName.GiantKiwi, "GiantKiwi" }, { EnemyName.CadaverGrowths, "CadaverGrowths" }, { EnemyName.BushWolf, "BushWolf" }, { EnemyName.CadaverBloom, "CadaverBloom" }, { EnemyName.Puma, "Puma" }, { EnemyName.Stingray, "Stingray" } }; public static Dictionary<ItemName, string> ItemNameList = new Dictionary<ItemName, string> { { ItemName.LargeAxle, "Cog1" }, { ItemName.V_TypeEngine, "EnginePart1" }, { ItemName.PlasticFish, "FishTestProp" }, { ItemName.MetalSheet, "MetalSheet" }, { ItemName.LaserPointer, "FlashLaserPointer" }, { ItemName.BigBolt, "BigBolt" }, { ItemName.Bottles, "BottleBin" }, { ItemName.Ring, "Ring" }, { ItemName.SteeringWheel, "SteeringWheel" }, { ItemName.CookieMoldPan, "MoldPan" }, { ItemName.EggBeater, "EggBeater" }, { ItemName.JarOfPickles, "PickleJar" }, { ItemName.DustPan, "DustPan" }, { ItemName.AirHorn, "Airhorn" }, { ItemName.ClownHorn, "ClownHorn" }, { ItemName.CashRegister, "CashRegister" }, { ItemName.Candy, "Candy" }, { ItemName.GoldBar, "GoldBar" }, { ItemName.YieldSign, "YieldSign" }, { ItemName.HomemadeFlashbang, "DiyFlashbang" }, { ItemName.Gift, "GiftBox" }, { ItemName.Flask, "Flask" }, { ItemName.ToyCube, "ToyCube" }, { ItemName.Remote, "Remote" }, { ItemName.ToyRobot, "RobotToy" }, { ItemName.MagnifyingGlass, "MagnifyingGlass" }, { ItemName.StopSign, "StopSign" }, { ItemName.TeaKettle, "TeaKettle" }, { ItemName.Mug, "Mug" }, { ItemName.RedSoda, "SodaCanRed" }, { ItemName.OldPhone, "Phone" }, { ItemName.HairDryer, "Hairdryer" }, { ItemName.Brush, "Brush" }, { ItemName.Bell, "Bell" }, { ItemName.WhoopieCushion, "WhoopieCushion" }, { ItemName.Comedy, "ComedyMask" }, { ItemName.Tragedy, "TragedyMask" }, { ItemName.RubberDucky, "RubberDuck" }, { ItemName.ChemicalJug, "ChemicalJug" }, { ItemName.FancyLamp, "FancyLamp" }, { ItemName.Painting, "FancyPainting" }, { ItemName.GoldenCup, "FancyCup" }, { ItemName.Toothpaste, "Toothpaste" }, { ItemName.PillBottle, "PillBottle" }, { ItemName.PerfumeBottle, "PerfumeBottle" }, { ItemName.Teeth, "Dentures" }, { ItemName.Magic7Ball, "7Ball" }, { ItemName.EasterEgg, "EasterEgg" }, { ItemName.ToyTrain, "ToyTrain" }, { ItemName.ToiletPaper, "ToiletPaperRolls" }, { ItemName.SoccerBall, "SoccerBall" }, { ItemName.PlasticCup, "PlasticCup" }, { ItemName.GarabgeLid, "GarbageLid" }, { ItemName.ControlPad, "ControlPad" }, { ItemName.Clock, "Clock" }, { ItemName.ZedDog, "ZedDog" }, { ItemName.BabyKiwiEgg, "BabyKiwiEgg" }, { ItemName.SeveredThigh, "SeveredThigh" }, { ItemName.SeveredHand, "SeveredHand" }, { ItemName.SeveredEar, "SeveredEar" }, { ItemName.SeveredBone, "SeveredBone" }, { ItemName.SeveredTongue, "SeveredTongue" }, { ItemName.SeveredHeart, "SeveredHeart" }, { ItemName.SeveredFoot, "SeveredFoot" }, { ItemName.SeveredBoneRib, "SeveredBoneRib" } }; public static Dictionary<ObjectName, string> ObjectNameList = new Dictionary<ObjectName, string> { { ObjectName.LargeRock1, "LargeRock1" }, { ObjectName.LargeRock2, "LargeRock2" }, { ObjectName.LargeRock3, "LargeRock3" }, { ObjectName.LargeRock4, "LargeRock4" }, { ObjectName.GreyRockGrouping2, "GreyRockGrouping2" }, { ObjectName.GreyRockGrouping4, "GreyRockGrouping4" }, { ObjectName.GiantPumkin, "GiantPumpkin" }, { ObjectName.Tree, "tree" }, { ObjectName.TreeLeaflessBrown1, "treeLeaflessBrown.001 Variant" }, { ObjectName.TreeLeafless2, "treeLeafless.002_LOD0" }, { ObjectName.TreeLeafless3, "treeLeafless.003_LOD0" }, { ObjectName.Landmine, "Landmine" }, { ObjectName.Turret, "TurretContainer" }, { ObjectName.SpikeRoofTrap, "SpikeRoofTrapHazard" } }; public static Dictionary<AtmosphereName, string> AtmosphereNameList = new Dictionary<AtmosphereName, string> { { AtmosphereName.RollingGroundFog, "rolling ground fog" }, { AtmosphereName.Rainy, "rainy" }, { AtmosphereName.Stormy, "stormy" }, { AtmosphereName.Foggy, "foggy" }, { AtmosphereName.Flooded, "flooded" }, { AtmosphereName.Eclipsed, "eclipsed" } }; public static Dictionary<string, EnemyType> EnemyList = new Dictionary<string, EnemyType>(); public static Dictionary<string, Item> ItemList = new Dictionary<string, Item>(); public static Dictionary<string, GameObject> ObjectList = new Dictionary<string, GameObject>(); internal static List<float> factorySizeMultiplierList = new List<float>(); internal static List<SpawnableMapObject[]> spawnableMapObjects = new List<SpawnableMapObject[]>(); internal static List<float> averageScrapValueList = new List<float>(); internal static List<AnimationCurve> insideSpawnChanceCurves = new List<AnimationCurve>(); internal static List<AnimationCurve> outsideSpawnChanceCurves = new List<AnimationCurve>(); internal static List<AnimationCurve> daytimeSpawnChanceCurves = new List<AnimationCurve>(); internal static List<int> insideMaxPowerCounts = new List<int>(); internal static List<int> outsideMaxPowerCounts = new List<int>(); internal static List<int> daytimeMaxPowerCounts = new List<int>(); internal static StormyWeather stormy; internal static FloodWeather flooded; public static EnemyType antiCoilHead; public static EnemyType nutSlayer; public static EnemyType kamikazieBug; public static Item slayerShotgun; public static Item grabbableTurret; public static Item grabbableLandmine; public static GameObject artilleryShell; public static GameObject artillerySirens; public static GameObject bunkerEntrance; public static GameObject bunkerEscape; public static GameObject teleportAudio; public static GameObject bloodRain; private static bool generatedList = false; private static bool generatedOrignalValuesList = false; internal static GameObject hangarShip => GameObject.Find("/Environment/HangarShip"); internal static GameObject cruiser => GameObject.Find("CompanyCruiser(Clone)"); internal static GameObject Microwave => GameObject.Find("MicrowaveContainer(Clone)"); public static bool ReadSettingEarly(string filePath, string settingName) { try { if (!File.Exists(filePath)) { return false; } string input = File.ReadAllText(filePath); string pattern = Regex.Escape(settingName) + "\\s*=\\s*(true|false)"; Match match = Regex.Match(input, pattern, RegexOptions.IgnoreCase); if (match.Success) { string value = match.Groups[1].Value; return bool.Parse(value); } return false; } catch (Exception) { return false; } } [HarmonyPostfix] [HarmonyPatch(typeof(GameNetworkManager), "Start")] private static void GenerateCustom() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Expected O, but got Unknown //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Expected O, but got Unknown //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Expected O, but got Unknown //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Expected O, but got Unknown //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Expected O, but got Unknown //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Expected O, but got Unknown //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Expected O, but got Unknown //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Expected O, but got Unknown //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Expected O, but got Unknown antiCoilHead = (EnemyType)customAssetBundle.LoadAsset("AntiCoilHead"); nutSlayer = (EnemyType)customAssetBundle.LoadAsset("NutSlayer"); kamikazieBug = (EnemyType)customAssetBundle.LoadAsset("KamikazieBug"); slayerShotgun = (Item)customAssetBundle.LoadAsset("SlayerShotgun"); grabbableTurret = (Item)customAssetBundle.LoadAsset("GrabbableTurret"); grabbableLandmine = (Item)customAssetBundle.LoadAsset("GrabbableLandmine"); artilleryShell = (GameObject)customAssetBundle.LoadAsset("ArtilleryShell"); artillerySirens = (GameObject)customAssetBundle.LoadAsset("DDay"); bunkerEntrance = (GameObject)customAssetBundle.LoadAsset("BunkerEntrance"); bunkerEscape = (GameObject)customAssetBundle.LoadAsset("BunkerEscape"); teleportAudio = (GameObject)customAssetBundle.LoadAsset("TeleportAudioSource"); bloodRain = (GameObject)customAssetBundle.LoadAsset("BloodRainParticleContainer"); RegisterNetworkPrefabs(antiCoilHead.enemyPrefab, nutSlayer.enemyPrefab, kamikazieBug.enemyPrefab, slayerShotgun.spawnPrefab, grabbableTurret.spawnPrefab, grabbableLandmine.spawnPrefab, artillerySirens, bunkerEntrance, bunkerEscape); } private static void RegisterNetworkPrefabs(params GameObject[] objects) { foreach (GameObject val in objects) { NetworkManager.Singleton.AddNetworkPrefab(val); } } [HarmonyPostfix] [HarmonyPatch(typeof(TimeOfDay), "Start")] private static void OnTimeOfODayStart(ref TimeOfDay __instance) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Expected O, but got Unknown GameObject val = Object.Instantiate<GameObject>(bloodRain); LocalVolumetricFog component = ((Component)val.transform.Find("Foggy")).GetComponent<LocalVolumetricFog>(); component.parameters.albedo = new Color(0.25f, 0.35f, 0.55f, 1f); component.parameters.meanFreePath = 80f; component.parameters.size.y = 255f; __instance.effects = __instance.effects.Add(new WeatherEffect { name = "bloodyrain", effectObject = val, effectPermanentObject = null, lerpPosition = false, effectEnabled = false }); } [HarmonyPrefix] [HarmonyPatch(typeof(StartOfRound), "Start")] private static void OnStartOfRoundStart() { StartOfRound.Instance.allItemsList.itemsList.AddRange(new List<Item> { slayerShotgun, grabbableTurret, grabbableLandmine }); } internal static void Load() { bundle = LoadAssetBundle("bcm_assets"); customAssetBundle = LoadAssetBundle("bcm_customassets"); SceneManager.sceneLoaded += OnSceneLoaded; } private static AssetBundle LoadAssetBundle(string fileName) { try { string directoryName = Path.GetDirectoryName(((BaseUnityPlugin)Plugin.Instance).Info.Location); string text = Path.Combine(directoryName, fileName); return AssetBundle.LoadFromFile(text); } catch (Exception arg) { Log.LogError($"Failed to load AssetBundle \"{fileName}\". {arg}"); } return null; } private static void OnSceneLoaded(Scene scene, LoadSceneMode mode) { if ((Object)(object)StartOfRound.Instance == (Object)null) { return; } StormyWeather[] array = Resources.FindObjectsOfTypeAll<StormyWeather>().Concat(Object.FindObjectsByType<StormyWeather>((FindObjectsInactive)1, (FindObjectsSortMode)1)).ToArray(); FloodWeather[] array2 = Resources.FindObjectsOfTypeAll<FloodWeather>().Concat(Object.FindObjectsByType<FloodWeather>((FindObjectsInactive)1, (FindObjectsSortMode)1)).ToArray(); if (array.Length != 0) { stormy = array[0]; } if (array2.Length != 0) { flooded = array2[0]; } if (generatedList) { return; } Log.LogInfo("Generating 'EnemyList'"); EnemyType[] array3 = Resources.FindObjectsOfTypeAll<EnemyType>().Concat(Object.FindObjectsByType<EnemyType>((FindObjectsInactive)1, (FindObjectsSortMode)1)).ToArray(); Array.Reverse(array3); array3 = (from x in array3 group x by ((Object)x).name into x select x.FirstOrDefault()).ToArray(); for (int i = 0; i < array3.Length; i++) { if (!ReadSettingEarly(Paths.ConfigPath + "\\BrutalCompanyMinusExtraReborn\\CoreProperties.cfg", "Silence Prefab Warnings?") && (Object)(object)array3[i].enemyPrefab == (Object)null) { Log.LogWarning($"Enemy:{((Object)array3[i]).name}, prefab is null, this may cause issues..."); } EnemyList.Add(((Object)array3[i]).name, array3[i]); } EnemyList.Remove("RedPillEnemyType"); foreach (KeyValuePair<string, EnemyType> enemy in EnemyList) { bool flag = false; foreach (KeyValuePair<EnemyName, string> enemyName in EnemyNameList) { if (enemy.Key == enemyName.Value) { flag = true; break; } } if (!ReadSettingEarly(Paths.ConfigPath + "\\BrutalCompanyMinusExtraReborn\\CoreProperties.cfg", "Silence Enum Warnings?") && !flag) { Log.LogWarning($"Enemy:'{enemy.Key}', isn't matched with enum, this may cause issues..."); } } Log.LogInfo($"Finished generating 'EnemyList', Count:{EnemyList.Count}"); Log.LogInfo("Generating 'ItemList'"); Item[] array4 = Resources.FindObjectsOfTypeAll<Item>().Concat(Object.FindObjectsByType<Item>((FindObjectsInactive)1, (FindObjectsSortMode)1)).ToArray(); Array.Reverse(array4); array4 = (from x in array4 group x by ((Object)x).name into x select x.FirstOrDefault()).ToArray(); for (int j = 0; j < array4.Length; j++) { if (!ReadSettingEarly(Paths.ConfigPath + "\\BrutalCompanyMinusExtraReborn\\CoreProperties.cfg", "Silence Prefab Warnings?") && (Object)(object)array4[j].spawnPrefab == (Object)null) { Log.LogWarning($"Item:{((Object)array4[j]).name}, prefab is null, this may cause issues..."); } ItemList.Add(((Object)array4[j]).name, array4[j]); } foreach (KeyValuePair<string, Item> item in ItemList) { bool flag2 = false; foreach (KeyValuePair<ItemName, string> itemName in ItemNameList) { if (item.Key == itemName.Value) { flag2 = true; break; } } if (!ReadSettingEarly(Paths.ConfigPath + "\\BrutalCompanyMinusExtraReborn\\CoreProperties.cfg", "Silence Enum Warnings?") && !flag2) { Log.LogWarning($"Item:'{item.Key}', isn't matched with enum, this may cause issues..."); } } Log.LogInfo($"Finished generating 'ItemList', Count:{ItemList.Count}"); Log.LogInfo("Generating 'ObjectList'"); List<SpawnableMapObject> list = new List<SpawnableMapObject>(); List<SpawnableOutsideObjectWithRarity> list2 = new List<SpawnableOutsideObjectWithRarity>(); SelectableLevel[] levels = StartOfRound.Instance.levels; foreach (SelectableLevel val in levels) { if ((Object)(object)val == (Object)null || val.spawnableMapObjects == null) { continue; } SpawnableMapObject[] array5 = val.spawnableMapObjects; foreach (SpawnableMapObject obj2 in array5) { if (obj2 != null && !((Object)(object)obj2.prefabToSpawn == (Object)null) && list.FindIndex((SpawnableMapObject o) => ((Object)o.prefabToSpawn).name == ((Object)obj2.prefabToSpawn).name) < 0) { list.Add(obj2); } } SpawnableOutsideObjectWithRarity[] spawnableOutsideObjects = val.spawnableOutsideObjects; foreach (SpawnableOutsideObjectWithRarity obj in spawnableOutsideObjects) { if (obj != null && !((Object)(object)obj.spawnableObject == (Object)null) && !((Object)(object)obj.spawnableObject.prefabToSpawn == (Object)null) && list2.FindIndex((SpawnableOutsideObjectWithRarity o) => ((Object)o.spawnableObject.prefabToSpawn).name == ((Object)obj.spawnableObject.prefabToSpawn).name) < 0) { list2.Add(obj); } } } foreach (SpawnableMapObject item2 in list) { ObjectList.Add(((Object)item2.prefabToSpawn).name, item2.prefabToSpawn); } foreach (SpawnableOutsideObjectWithRarity item3 in list2) { ObjectList.Add(((Object)item3.spawnableObject.prefabToSpawn).name, item3.spawnableObject.prefabToSpawn); } foreach (KeyValuePair<string, GameObject> @object in ObjectList) { bool flag3 = false; foreach (KeyValuePair<ObjectName, string> objectName in ObjectNameList) { if (@object.Key == objectName.Value) { flag3 = true; break; } } if (!ReadSettingEarly(Paths.ConfigPath + "\\BrutalCompanyMinusExtraReborn\\CoreProperties.cfg", "Silence Enum Warnings?") && !flag3) { Log.LogWarning($"Object:'{@object.Key}', isn't matched with enum, this may cause issues..."); } } Log.LogInfo($"Finished generating 'ObjectList', Count:{ObjectList.Count}"); Log.LogInfo($"Map Count:{factorySizeMultiplierList.Count}"); Log.LogInfo("Generating configuration"); Configuration.CreateConfig(); generatedList = true; } internal static void generateOriginalValuesLists() { //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Expected O, but got Unknown //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Expected O, but got Unknown //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Expected O, but got Unknown //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) if (generatedOrignalValuesList) { return; } SelectableLevel[] levels = StartOfRound.Instance.levels; foreach (SelectableLevel val in levels) { factorySizeMultiplierList.Add(val.factorySizeMultiplier); List<SpawnableItemWithRarity> list = new List<SpawnableItemWithRarity>(); list.AddRange(val.spawnableScrap); float num = 0f; float num2 = 0f; foreach (SpawnableItemWithRarity item in list) { num += (float)((item.spawnableItem.minValue + item.spawnableItem.maxValue) * item.rarity); num2 += (float)item.rarity; } if (num2 != 0f) { averageScrapValueList.Add(num / (num2 * 2f)); } else { averageScrapValueList.Add(80f); } if (!ReadSettingEarly(Paths.ConfigPath + "\\BrutalCompanyMinusExtraReborn\\CoreProperties.cfg", "Experimental Dont Handle Spawn Chance?")) { AnimationCurve val2 = new AnimationCurve(); AnimationCurve val3 = new AnimationCurve(); AnimationCurve val4 = new AnimationCurve(); Keyframe[] keys = val.enemySpawnChanceThroughoutDay.keys; foreach (Keyframe val5 in keys) { val2.AddKey(val5); } Keyframe[] keys2 = val.outsideEnemySpawnChanceThroughDay.keys; foreach (Keyframe val6 in keys2) { val3.AddKey(val6); } Keyframe[] keys3 = val.daytimeEnemySpawnChanceThroughDay.keys; foreach (Keyframe val7 in keys3) { val4.AddKey(val7); } insideSpawnChanceCurves.Add(val2); outsideSpawnChanceCurves.Add(val3); daytimeSpawnChanceCurves.Add(val4); } insideMaxPowerCounts.Add(val.maxEnemyPowerCount); outsideMaxPowerCounts.Add(val.maxOutsideEnemyPowerCount); daytimeMaxPowerCounts.Add(val.maxDaytimeEnemyPowerCount); spawnableMapObjects.Add(val.spawnableMapObjects); } generatedOrignalValuesList = true; } public static EnemyType GetEnemy(EnemyName name) { return GetEnemy(EnemyNameList[name]); } public static EnemyType GetEnemy(string name) { if (EnemyList.TryGetValue(name, out EnemyType value)) { return value; } if (!ReadSettingEarly(Paths.ConfigPath + "\\BrutalCompanyMinusExtraReborn\\CoreProperties.cfg", "Silence Get Method Warnings?")) { Log.LogWarning("GetEnemy(" + name + ") failed, returning an empty enemy type"); } EnemyType val = ScriptableObject.CreateInstance<EnemyType>(); val.enemyName = name; ((Object)val).name = name; return val; } public static EnemyType GetEnemyOrDefault(string name) { if (EnemyList.TryGetValue(name, out EnemyType value)) { return value; } if (!ReadSettingEarly(Paths.ConfigPath + "\\BrutalCompanyMinusExtraReborn\\CoreProperties.cfg", "Silence Get Method Warnings?")) { Log.LogWarning("GetEnemyOrDefault(" + name + ") failed, returning kamikazie bug."); } return kamikazieBug; } public static Item GetItem(ItemName name) { return GetItem(ItemNameList[name]); } public static Item GetItem(string name) { if (ItemList.TryGetValue(name, out Item value)) { return value; } if (!ReadSettingEarly(Paths.ConfigPath + "\\BrutalCompanyMinusExtraReborn\\CoreProperties.cfg", "Silence Get Method Warnings?")) { Log.LogWarning("GetItem(" + name + ") failed, returning an empty item"); } Item val = ScriptableObject.CreateInstance<Item>(); val.itemName = name; ((Object)val).name = name; return val; } [Obsolete("Causes the mod to fail, do not use on modded item events", false)] public static Item GetItemByName(string itemName, bool matchCase = true) { StringComparison comparisonType = ((!matchCase) ? StringComparison.OrdinalIgnoreCase : StringComparison.CurrentCulture); foreach (Item items in StartOfRound.Instance.allItemsList.itemsList) { if (items.itemName.Equals(itemName, comparisonType)) { return items; } } return null; } [Obsolete("Causes the mod to fail, do not use on vanilla item events", true)] public static Item GetItemByNameModded(string itemName, bool isModPresent, bool matchCase = true) { if (isModPresent) { StringComparison comparisonType = ((!matchCase) ? StringComparison.OrdinalIgnoreCase : StringComparison.CurrentCulture); foreach (Item items in StartOfRound.Instance.allItemsList.itemsList) { if (items.itemName.Equals(itemName, comparisonType)) { return items; } } return null; } return null; } public static GameObject GetObject(ObjectName name) { return GetObject(ObjectNameList[name]); } public static GameObject GetObject(string name) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown if (ObjectList.TryGetValue(name, out GameObject value)) { return value; } Log.LogWarning("GetObject(" + name + " failed, returning empty gameObject"); return new GameObject(name); } } [HarmonyPatch] public class Net : NetworkBehaviour { [Serializable] public struct CurrentWeatherEffect : INetworkSerializable, IEquatable<CurrentWeatherEffect> { public FixedString128Bytes name; public bool state; public CurrentWeatherEffect(FixedString128Bytes name, bool state) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) this.name = name; this.state = state; } public void NetworkSerialize<T>(BufferSerializer<T> serializer) where T : IReaderWriter { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_005a: 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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0036: 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) if (serializer.IsReader) { FastBufferReader fastBufferReader = serializer.GetFastBufferReader(); ((FastBufferReader)(ref fastBufferReader)).ReadValueSafe<FixedString128Bytes>(ref name, default(ForFixedStrings)); ((FastBufferReader)(ref fastBufferReader)).ReadValueSafe<bool>(ref state, default(ForPrimitives)); } else { FastBufferWriter fastBufferWriter = serializer.GetFastBufferWriter(); ((FastBufferWriter)(ref fastBufferWriter)).WriteValueSafe<FixedString128Bytes>(ref name, default(ForFixedStrings)); ((FastBufferWriter)(ref fastBufferWriter)).WriteValueSafe<bool>(ref state, default(ForPrimitives)); } } public bool Equals(CurrentWeatherEffect other) { return (ref name) == (ref other.name); } } [Serializable] public struct OutsideObjectsToSpawnMethod : INetworkSerializable, IEquatable<OutsideObjectsToSpawnMethod> { public float density; public int objectEnumID; public OutsideObjectsToSpawnMethod(float density, int objectEnumID) { this.density = density; this.objectEnumID = objectEnumID; } public void NetworkSerialize<T>(BufferSerializer<T> serializer) where T : IReaderWriter { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0070: 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_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0036: 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) if (serializer.IsReader) { FastBufferReader fastBufferReader = serializer.GetFastBufferReader(); ((FastBufferReader)(ref fastBufferReader)).ReadValueSafe<float>(ref density, default(ForPrimitives)); ((FastBufferReader)(ref fastBufferReader)).ReadValueSafe<int>(ref objectEnumID, default(ForPrimitives)); } else { FastBufferWriter fastBufferWriter = serializer.GetFastBufferWriter(); ((FastBufferWriter)(ref fastBufferWriter)).WriteValueSafe<float>(ref density, default(ForPrimitives)); ((FastBufferWriter)(ref fastBufferWriter)).WriteValueSafe<int>(ref objectEnumID, default(ForPrimitives)); } } public bool Equals(OutsideObjectsToSpawnMethod other) { return objectEnumID == other.objectEnumID && density == other.density; } } public NetworkList<Weather> currentWeatherMultipliers = new NetworkList<Weather>(); public NetworkList<OutsideObjectsToSpawnMethod> outsideObjectsToSpawn; public NetworkList<CurrentWeatherEffect> currentWeatherEffects; public NetworkVariable<FixedString4096Bytes> textUI = new NetworkVariable<FixedString4096Bytes>(default(FixedString4096Bytes), (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public bool receivedSyncedValues = false; public List<GameObject> objectsToSpawn = new List<GameObject>(); public List<int> objectsToSpawnAmount = new List<int>(); public List<float> objectsToSpawnRadius = new List<float>(); public List<Vector3> objectsToSpawnOffsets = new List<Vector3>(); private float currentIntervalTime = 0f; public NetworkVariable<bool> LeverUnityNet = new NetworkVariable<bool>(false, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable<bool> WalkiesUnityNet = new NetworkVariable<bool>(false, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable<bool> JetpackUnityNet = new NetworkVariable<bool>(false, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable<bool> TerminalUnityNet = new NetworkVariable<bool>(false, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable<bool> TargetingUnityNet = new NetworkVariable<bool>(false, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable<bool> TeleporterUnityNet = new NetworkVariable<bool>(false, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable<bool> ItemChargerUnityNet = new NetworkVariable<bool>(false, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable<bool> CircuitUnityNet = new NetworkVariable<bool>(false, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable<bool> DoorOvUnityNet = new NetworkVariable<bool>(false, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable<bool> DoorUnityNet = new NetworkVariable<bool>(false, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable<bool> CameraUnityNet = new NetworkVariable<bool>(false, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public int _seed = 49; public static Net Instance { get; private set; } public static GameObject netObject { get; private set; } private void Awake() { currentWeatherMultipliers = new NetworkList<Weather>(); outsideObjectsToSpawn = new NetworkList<OutsideObjectsToSpawnMethod>(); currentWeatherEffects = new NetworkList<CurrentWeatherEffect>(); Log.LogWarning("Net object Awake called"); } private void Update() { //IL_0125: 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_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) if (currentIntervalTime > 0f) { currentIntervalTime -= Time.deltaTime; } else { currentIntervalTime = 0.5f; if (currentWeatherEffects.Count > 0) { foreach (CurrentWeatherEffect currentWeatherEffect in currentWeatherEffects) { PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; if (!((Object)(object)localPlayerController == (Object)null)) { if (localPlayerController.isPlayerDead) { UpdateAtmosphere(currentWeatherEffect.name, state: false); } else if (!localPlayerController.isInsideFactory) { UpdateAtmosphere(currentWeatherEffect.name, currentWeatherEffect.state); } else { UpdateAtmosphere(currentWeatherEffect.name, state: false); } } } } } if (objectsToSpawn.Count > 0) { Manager.Spawn.DoSpawnOutsideObjects(objectsToSpawnAmount[0], objectsToSpawnRadius[0], objectsToSpawnOffsets[0], objectsToSpawn[0]); objectsToSpawn.RemoveAt(0); objectsToSpawnAmount.RemoveAt(0); objectsToSpawnRadius.RemoveAt(0); objectsToSpawnOffsets.RemoveAt(0); } } public override void OnNetworkSpawn() { Instance = this; UI.SpawnObject(); if (((NetworkBehaviour)this).IsServer) { InitalizeCurrentWeatherMultipliersServerRpc(); } ((NetworkBehaviour)this).OnNetworkSpawn(); } public override void OnNetworkDespawn() { UI.Instance.UnsubscribeFromKeyboardEvent(); Object.Destroy((Object)(object)GameObject.Find("EventGUI")); ((NetworkBehaviour)this).OnNetworkDespawn(); } [ServerRpc(RequireOwnership = false)] public void GetSyncedTextServerRpc() { //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_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(1644092438u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1644092438u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; GetSyncedTextClientRpc(textUI.Value); } } } [ClientRpc] public void GetSyncedTextClientRpc(FixedString4096Bytes textUI) { //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_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) 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(1434020377u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<FixedString4096Bytes>(ref textUI, default(ForFixedStrings)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1434020377u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; Manager.textUI = FixedString4096Bytes.op_Implicit(((FixedString4096Bytes)(ref textUI)).Value); } } } [ServerRpc(RequireOwnership = false)] public void GiveSeedServerRpc() { //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(2319565597u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2319565597u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; GiveSeedClientRpc(_seed++); } } } [ClientRpc] public void GiveSeedClientRpc(int seed) { //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.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2006375022u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, seed); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2006375022u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; Manager.seed = seed; } } } [ServerRpc(RequireOwnership = false)] public void ClearGameObjectsServerRpc() { //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(3809690504u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3809690504u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; ClearGameObjectsClientRpc(); } } } [ClientRpc] public void ClearGameObjectsClientRpc() { //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.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(174694319u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 174694319u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; for (int i = 0; i < Manager.objectsToClear.Count; i++) { GameObject val3 = Manager.objectsToClear[i]; if ((Object)(object)val3 == (Object)null) { continue; } NetworkObject component = val3.GetComponent<NetworkObject>(); string name = ((Object)val3).name; try { if ((Object)(object)component != (Object)null) { component.Despawn(true); if (Configuration.ExtraLogging.Value) { Log.LogInfo("Despawned network object: " + name); } } else { Object.Destroy((Object)(object)val3); if (Configuration.ExtraLogging.Value) { Log.LogInfo("Destroyed non-network object: " + name); } } } catch (KeyNotFoundException ex) { Log.LogError("KeyNotFoundException while despawning/destroying '" + name + "': " + ex.Message); } catch (Exception ex2) { Log.LogError("Unexpected exception while despawning/destroying '" + name + "': " + ex2.Message); } } Manager.objectsToClear.Clear(); } [ClientRpc] public void SyncValuesClientRpc(float factorySizeMultiplier, float scrapValueMultiplier, float scrapAmountMultiplier, int bonusMaxHp) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: 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_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: 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_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_011f: 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(2150416984u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref factorySizeMultiplier, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref scrapValueMultiplier, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref scrapAmountMultiplier, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val2, bonusMaxHp); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2150416984u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; RoundManager.Instance.currentLevel.factorySizeMultiplier = factorySizeMultiplier; Manager.bonusEnemyHp = bonusMaxHp; receivedSyncedValues = true; } } } [ServerRpc] public void SyncScrapValueServerRpc(NetworkObjectReference obj, 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_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Invalid comparison between Unknown and I4 //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(875794818u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref obj, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val2, value); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 875794818u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; SyncScrapValueClientRpc(obj, value); } } [ClientRpc] private void SyncScrapValueClientRpc(NetworkObjectReference obj, 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) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(268987115u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref obj, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val2, value); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 268987115u, 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 obj)).TryGet(ref val3, (NetworkManager)null); ((Component)val3).GetComponent<GrabbableObject>().SetScrapValue(value); } } } [ServerRpc(RequireOwnership = false)] public void GenerateAndSyncTerminalCodeServerRpc(NetworkObjectReference netObject, int code) { //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(2205229909u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref netObject, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val2, code); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2205229909u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; GenerateAndSyncTerminalCodeClientRpc(netObject, code); } } } [ClientRpc] public void GenerateAndSyncTerminalCodeClientRpc(NetworkObjectReference netObject, int code) { //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(3849078077u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref netObject, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val2, code); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3849078077u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = null; if (!((NetworkObjectReference)(ref netObject)).TryGet(ref val3, (NetworkManager)null)) { Log.LogError("Network Object is null in GenerateAndSyncTerminalCodeClientRpc()"); return; } TerminalAccessibleObject componentInChildren = ((Component)val3).GetComponentInChildren<TerminalAccessibleObject>(); if ((Object)(object)componentInChildren == (Object)null) { Log.LogError("Terminal Accessible Object is null in GenerateAndSyncTerminalCodeClientRpc()"); return; } componentInChildren.InitializeValues(); componentInChildren.SetCodeTo(code); } [ServerRpc(RequireOwnership = false)] public void MoveTimeServerRpc(float amount, float speedMultiplier = 1f) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: 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_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: 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(2208211795u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref amount, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref speedMultiplier, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2208211795u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; MoveTimeClientRpc(amount, speedMultiplier); } } } [ClientRpc] public void MoveTimeClientRpc(float amount, float speedMultiplier) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: 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_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: 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(3436861046u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref amount, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref speedMultiplier, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3436861046u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; Manager.moveTime = true; Manager.moveTimeAmount += amount; Manager.timeSpeedMultiplier *= speedMultiplier; } } } [ServerRpc(RequireOwnership = false)] public void SetTimeMultiplierServerRpc(float speedMultiplier = 1f) { //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(2853396074u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref speedMultiplier, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2853396074u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; SetTimeMultiplierClientRpc(speedMultiplier); } } } [ClientRpc] public void SetTimeMultiplierClientRpc(float speedMultiplier) { //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.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(512763078u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref speedMultiplier, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 512763078u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; Manager.moveTime = true; Manager.timeSpeedMultiplier = speedMultiplier; } } } private void UpdateAtmosphere(FixedString128Bytes name, bool state) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < TimeOfDay.Instance.effects.Length; i++) { FixedString128Bytes val = FixedString128Bytes.op_Implicit(TimeOfDay.Instance.effects[i].name); if ((ref val) == (ref name)) { TimeOfDay.Instance.effects[i].effectEnabled = state; } } } [ClientRpc] public void ShowCaseEventsClientRpc() { //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(1744607847u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1744607847u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; UI.Instance.curretShowCaseEventTime = UI.Instance.showCaseEventTime; UI.Instance.TogglePanel(state: true); UI.Instance.panelScrollBar.value = 1f; UI.Instance.showCaseEvents = true; } } } [ServerRpc(RequireOwnership = false)] private void InitalizeCurrentWeatherMultipliersServerRpc() { //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(1335262659u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1335262659u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; currentWeatherMultipliers = Weather.InitalizeWeatherMultipliers(ref currentWeatherMultipliers); UpdateCurrentWeatherMultipliersServerRpc(); } } } [ServerRpc(RequireOwnership = false)] public void UpdateCurrentWeatherMultipliersServerRpc() { //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(466041418u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 466041418u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; currentWeatherMultipliers = Weather.RandomizeWeatherMultipliers(currentWeatherMultipliers); } } } [ServerRpc(RequireOwnership = false)] public void SetRecievedServerRpc(bool state) { //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(1853859009u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref state, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1853859009u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; SetRecievedClientRpc(state); } } } [ClientRpc] public void SetRecievedClientRpc(bool state) { //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.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(603622741u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref state, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 603622741u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; receivedSyncedValues = state; } } } [ServerRpc(RequireOwnership = false)] public void SetRealityShiftActiveServerRpc(bool state) { //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(4203994123u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref state, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 4203994123u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; SetRealityShiftActiveClientRpc(state); } } } [ClientRpc] public void SetRealityShiftActiveClientRpc(bool state) { //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.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2568149201u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref state, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2568149201u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient ||