using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using GameNetcodeStuff;
using HarmonyLib;
using LethalLevelLoader;
using LobbyCompatibility.Enums;
using LobbyCompatibility.Features;
using Microsoft.CodeAnalysis;
using RebalancedMoons.NetcodePatcher;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.HighDefinition;
using UnityEngine.SceneManagement;
using WeatherRegistry;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: IgnoresAccessChecksTo("LethalLevelLoader")]
[assembly: IgnoresAccessChecksTo("Unity.Netcode.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.HighDefinition.Runtime")]
[assembly: AssemblyCompany("RebalancedMoons")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("Rebalances/reworks some of the vanilla moons.")]
[assembly: AssemblyFileVersion("1.15.6.0")]
[assembly: AssemblyInformationalVersion("1.15.6+745050359ef1cfe5d80cf222bf153cddee998c88")]
[assembly: AssemblyProduct("RebalancedMoons")]
[assembly: AssemblyTitle("RebalancedMoons")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.15.6.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
[module: NetcodePatchedAssembly]
internal class <Module>
{
static <Module>()
{
}
}
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
internal sealed class RefSafetyRulesAttribute : Attribute
{
public readonly int Version;
public RefSafetyRulesAttribute(int P_0)
{
Version = P_0;
}
}
}
namespace RebalancedMoons
{
[CreateAssetMenu(menuName = "ScriptableObjects/BundledCurve", order = 2)]
public class BundledCurve : ScriptableObject
{
public AnimationCurve curve;
}
internal static class LobbyCompatibility
{
internal static void Init()
{
PluginHelper.RegisterPlugin("dopadream.lethalcompany.rebalancedmoons", Version.Parse("1.15.6"), (CompatibilityLevel)2, (VersionStrictness)2);
}
}
public class ModConfig
{
internal static ConfigEntry<bool> configTitanLighting;
internal static ConfigEntry<bool> configIncreasedFog;
internal static ConfigEntry<bool> configExperimentationScene;
internal static ConfigEntry<bool> configVowScene;
internal static ConfigEntry<bool> configAssuranceScene;
internal static ConfigEntry<bool> configOffenseScene;
internal static ConfigEntry<bool> configAdamanceScene;
internal static ConfigEntry<bool> configMarchScene;
internal static ConfigEntry<bool> configRendScene;
internal static ConfigEntry<bool> configDineScene;
internal static ConfigEntry<bool> configTitanScene;
internal static ConfigEntry<bool> configEmbrionScene;
internal static ConfigEntry<bool> configArtificeScene;
internal static ConfigEntry<bool> configMarchBridge;
internal static ConfigEntry<bool> configTitanThirdFireExit;
internal static ConfigEntry<bool> configOffenseFirePath;
internal static ConfigEntry<bool> configVowLadder;
internal static ConfigEntry<bool> configShipShrouds;
internal static ConfigEntry<bool> configMarchDungeons;
internal static ConfigEntry<bool> configDineDungeons;
internal static ConfigEntry<bool> configTitanDungeons;
internal static ConfigEntry<bool> configWeatherOverrides;
internal static ConfigEntry<bool> configMoonPriceOverrides;
internal static ConfigEntry<bool> configEmbrionBoulders;
internal static ConfigEntry<bool> configEmbrionGambling;
internal static void Init(ConfigFile cfg)
{
//IL_0017: Unknown result type (might be due to invalid IL or missing references)
//IL_0021: Expected O, but got Unknown
//IL_003d: Unknown result type (might be due to invalid IL or missing references)
//IL_0047: Expected O, but got Unknown
//IL_0063: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: Expected O, but got Unknown
//IL_0089: Unknown result type (might be due to invalid IL or missing references)
//IL_0093: Expected O, but got Unknown
//IL_00af: Unknown result type (might be due to invalid IL or missing references)
//IL_00b9: Expected O, but got Unknown
//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
//IL_00df: Expected O, but got Unknown
//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
//IL_0105: Expected O, but got Unknown
//IL_0121: Unknown result type (might be due to invalid IL or missing references)
//IL_012b: Expected O, but got Unknown
//IL_0147: Unknown result type (might be due to invalid IL or missing references)
//IL_0151: Expected O, but got Unknown
//IL_016d: Unknown result type (might be due to invalid IL or missing references)
//IL_0177: Expected O, but got Unknown
//IL_0193: Unknown result type (might be due to invalid IL or missing references)
//IL_019d: Expected O, but got Unknown
//IL_01b9: Unknown result type (might be due to invalid IL or missing references)
//IL_01c3: Expected O, but got Unknown
//IL_01df: Unknown result type (might be due to invalid IL or missing references)
//IL_01e9: Expected O, but got Unknown
//IL_0205: Unknown result type (might be due to invalid IL or missing references)
//IL_020f: Expected O, but got Unknown
//IL_022b: Unknown result type (might be due to invalid IL or missing references)
//IL_0235: Expected O, but got Unknown
//IL_0251: Unknown result type (might be due to invalid IL or missing references)
//IL_025b: Expected O, but got Unknown
//IL_0277: Unknown result type (might be due to invalid IL or missing references)
//IL_0281: Expected O, but got Unknown
//IL_029d: Unknown result type (might be due to invalid IL or missing references)
//IL_02a7: Expected O, but got Unknown
//IL_02c3: Unknown result type (might be due to invalid IL or missing references)
//IL_02cd: Expected O, but got Unknown
//IL_02e9: Unknown result type (might be due to invalid IL or missing references)
//IL_02f3: Expected O, but got Unknown
//IL_030f: Unknown result type (might be due to invalid IL or missing references)
//IL_0319: Expected O, but got Unknown
//IL_0335: Unknown result type (might be due to invalid IL or missing references)
//IL_033f: Expected O, but got Unknown
//IL_035b: Unknown result type (might be due to invalid IL or missing references)
//IL_0365: Expected O, but got Unknown
//IL_0381: Unknown result type (might be due to invalid IL or missing references)
//IL_038b: Expected O, but got Unknown
//IL_03a7: Unknown result type (might be due to invalid IL or missing references)
//IL_03b1: Expected O, but got Unknown
configTitanLighting = cfg.Bind<bool>("Client", "Titan Lighting", true, new ConfigDescription("Adds colder interior lighting to Titan.", (AcceptableValueBase)null, Array.Empty<object>()));
configIncreasedFog = cfg.Bind<bool>("Client", "Increased Volumetric Fog Distance", true, new ConfigDescription("Increases the distance volumetric fog can be seen globally from 64 to 256. May impact performance on low end hardware.", (AcceptableValueBase)null, Array.Empty<object>()));
configShipShrouds = cfg.Bind<bool>("Server", "Sober ship", true, new ConfigDescription("Blocks Vain Shrouds near the ship on all moons.", (AcceptableValueBase)null, Array.Empty<object>()));
configVowLadder = cfg.Bind<bool>("Server", "Vow Rope Ladder", true, new ConfigDescription("Adds a rope ladder to the dam on Vow. Must be activated from the top of the dam every round.", (AcceptableValueBase)null, Array.Empty<object>()));
configMarchBridge = cfg.Bind<bool>("Server", "March Rickety Bridge", true, new ConfigDescription("Adds a rickety bridge to March. Stats are inbetween Adamance and Vow.", (AcceptableValueBase)null, Array.Empty<object>()));
configOffenseFirePath = cfg.Bind<bool>("Server", "Offense Fire Exit Path", true, new ConfigDescription("Adds a lengthy route to the fire exit on Offense via new climbable rocks. Marked by a tall silo.", (AcceptableValueBase)null, Array.Empty<object>()));
configTitanThirdFireExit = cfg.Bind<bool>("Server", "Titan Third Fire Exit", true, new ConfigDescription("Adds a 3rd fire exit to Titan in the vacant snowy area of the map. Marked by a guide light pole.", (AcceptableValueBase)null, Array.Empty<object>()));
configExperimentationScene = cfg.Bind<bool>("Server", "Experimentation Scene Overrides", true, new ConfigDescription("Replaces Experimentation's scene with a new one using LLL.", (AcceptableValueBase)null, Array.Empty<object>()));
configAssuranceScene = cfg.Bind<bool>("Server", "Assurance Scene Overrides", true, new ConfigDescription("Replaces Assurance's scene with a new one using LLL.", (AcceptableValueBase)null, Array.Empty<object>()));
configOffenseScene = cfg.Bind<bool>("Server", "Offense Scene Overrides", true, new ConfigDescription("Replaces Offense's scene with a new one using LLL.", (AcceptableValueBase)null, Array.Empty<object>()));
configVowScene = cfg.Bind<bool>("Server", "Vow Scene Overrides", true, new ConfigDescription("Replaces Vow's scene with a new one using LLL.", (AcceptableValueBase)null, Array.Empty<object>()));
configMarchScene = cfg.Bind<bool>("Server", "March Scene Overrides", true, new ConfigDescription("Replaces March's scene with a new one using LLL.", (AcceptableValueBase)null, Array.Empty<object>()));
configAdamanceScene = cfg.Bind<bool>("Server", "Adamance Scene Overrides", true, new ConfigDescription("Replaces Adamance's scene with a new one using LLL.", (AcceptableValueBase)null, Array.Empty<object>()));
configRendScene = cfg.Bind<bool>("Server", "Rend Scene Overrides", true, new ConfigDescription("Replaces Rend's scene with a new one using LLL.", (AcceptableValueBase)null, Array.Empty<object>()));
configDineScene = cfg.Bind<bool>("Server", "Dine Scene Overrides", true, new ConfigDescription("Replaces Dine's scene with a new one using LLL.", (AcceptableValueBase)null, Array.Empty<object>()));
configTitanScene = cfg.Bind<bool>("Server", "Titan Scene Overrides", true, new ConfigDescription("Replaces Titan's scene with a new one using LLL.", (AcceptableValueBase)null, Array.Empty<object>()));
configEmbrionScene = cfg.Bind<bool>("Server", "Embrion Scene Overrides", true, new ConfigDescription("Replaces Embrion's scene with a new one using LLL.", (AcceptableValueBase)null, Array.Empty<object>()));
configArtificeScene = cfg.Bind<bool>("Server", "Artifice Scene Overrides", true, new ConfigDescription("Replaces Artifice's scene with a new one using LLL.", (AcceptableValueBase)null, Array.Empty<object>()));
configEmbrionBoulders = cfg.Bind<bool>("Server", "Embrion Boulders", true, new ConfigDescription("Adds randomly spawning boulders to Embrion.", (AcceptableValueBase)null, Array.Empty<object>()));
configEmbrionGambling = cfg.Bind<bool>("Server", "Embrion Gambling", true, new ConfigDescription("Randomizes Embrion's scrap pool equally with every one handed item in the game.", (AcceptableValueBase)null, Array.Empty<object>()));
configMarchDungeons = cfg.Bind<bool>("Server", "March Interior Overrides", true, new ConfigDescription("REQUIRES RESTART WHEN DISABLING INGAME - Overrides the interior selections on March to include all vanilla interiors.", (AcceptableValueBase)null, Array.Empty<object>()));
configDineDungeons = cfg.Bind<bool>("Server", "Dine Interior Overrides", true, new ConfigDescription("REQUIRES RESTART WHEN DISABLING INGAME - Overrides the interior selections on Dine to make Mineshaft less common.", (AcceptableValueBase)null, Array.Empty<object>()));
configTitanDungeons = cfg.Bind<bool>("Server", "Titan Interior Overrides", true, new ConfigDescription("REQUIRES RESTART WHEN DISABLING INGAME - Overrides the interior selections on Titan to make Mineshaft significantly more common.", (AcceptableValueBase)null, Array.Empty<object>()));
configWeatherOverrides = cfg.Bind<bool>("Server", "Weather Overrides", true, new ConfigDescription("Enables weather overrides on rebalanced moons (Replaces Rainy w/ Foggy on Dine)", (AcceptableValueBase)null, Array.Empty<object>()));
configMoonPriceOverrides = cfg.Bind<bool>("Server", "Price Overrides", true, new ConfigDescription("Enables price overrides on rebalanced moons", (AcceptableValueBase)null, Array.Empty<object>()));
}
}
internal class ModUtil
{
public static List<T> SearchInLatestScene<T>() where T : Object
{
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
List<T> list = new List<T>();
Scene sceneAt = SceneManager.GetSceneAt(SceneManager.sceneCount - 1);
GameObject[] rootGameObjects = ((Scene)(ref sceneAt)).GetRootGameObjects();
for (int i = 0; i < rootGameObjects.Length; i++)
{
T[] componentsInChildren = rootGameObjects[i].GetComponentsInChildren<T>();
foreach (T item in componentsInChildren)
{
list.Add(item);
}
}
return list;
}
}
internal class MoldBlockerLogic
{
public class SpatialGrid
{
private float cellSize;
private Dictionary<Vector2Int, List<GameObject>> grid = new Dictionary<Vector2Int, List<GameObject>>();
public SpatialGrid(float cellSize)
{
this.cellSize = cellSize;
Plugin.Logger.LogDebug((object)$"[SpatialGrid] Initialized with cell size {cellSize}");
}
private Vector2Int GetCell(Vector3 position)
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
return new Vector2Int(Mathf.FloorToInt(position.x / cellSize), Mathf.FloorToInt(position.z / cellSize));
}
public void AddObject(GameObject obj)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
//IL_0051: 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_0026: Unknown result type (might be due to invalid IL or missing references)
//IL_003b: Unknown result type (might be due to invalid IL or missing references)
Vector2Int cell = GetCell(obj.transform.position);
if (!grid.ContainsKey(cell))
{
grid[cell] = new List<GameObject>();
Plugin.Logger.LogDebug((object)$"[SpatialGrid] Created new cell {cell}");
}
grid[cell].Add(obj);
Plugin.Logger.LogDebug((object)$"[SpatialGrid] Added object {((Object)obj).name} to cell {cell}");
}
public List<GameObject> GetNearbyObjects(Vector3 position)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//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_0018: Unknown result type (might be due to invalid IL or missing references)
//IL_004f: Unknown result type (might be due to invalid IL or missing references)
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_007b: Unknown result type (might be due to invalid IL or missing references)
//IL_008c: Unknown result type (might be due to invalid IL or missing references)
Vector2Int cell = GetCell(position);
List<GameObject> list = new List<GameObject>();
Plugin.Logger.LogDebug((object)$"[SpatialGrid] Looking for nearby objects at cell {cell}");
Vector2Int val = default(Vector2Int);
for (int i = -1; i <= 1; i++)
{
for (int j = -1; j <= 1; j++)
{
((Vector2Int)(ref val))..ctor(((Vector2Int)(ref cell)).x + i, ((Vector2Int)(ref cell)).y + j);
if (grid.ContainsKey(val))
{
list.AddRange(grid[val]);
Plugin.Logger.LogDebug((object)$"[SpatialGrid] Found {grid[val].Count} objects in cell {val}");
}
}
}
return list;
}
}
[HarmonyPatch(typeof(MoldSpreadManager), "GenerateMold")]
[HarmonyPostfix]
private static void PostSpreadMold()
{
//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
//IL_00f8: 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_0132: Unknown result type (might be due to invalid IL or missing references)
//IL_016a: Unknown result type (might be due to invalid IL or missing references)
//IL_0176: Unknown result type (might be due to invalid IL or missing references)
//IL_017b: Unknown result type (might be due to invalid IL or missing references)
//IL_0180: Unknown result type (might be due to invalid IL or missing references)
//IL_019c: Unknown result type (might be due to invalid IL or missing references)
//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
//IL_0203: Unknown result type (might be due to invalid IL or missing references)
//IL_0208: 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_020f: Unknown result type (might be due to invalid IL or missing references)
//IL_022d: 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)
Plugin.Logger.LogDebug((object)"[MoldBlocker] Starting mold spread check...");
MoldSpreadManager obj = Object.FindAnyObjectByType<MoldSpreadManager>();
Transform[] array = ((obj != null) ? ((Component)obj.moldContainer).GetComponentsInChildren<Transform>() : null);
MoldDenialPoint[] array2 = Object.FindObjectsByType<MoldDenialPoint>((FindObjectsSortMode)0);
if (array == null)
{
Plugin.Logger.LogWarning((object)"[MoldBlocker] moldContainer is null!");
return;
}
Plugin.Logger.LogDebug((object)$"[MoldBlocker] Found {array.Length} mold objects.");
Plugin.Logger.LogDebug((object)$"[MoldBlocker] Found {array2.Length} mold denial points.");
SpatialGrid spatialGrid = new SpatialGrid(10f);
MoldDenialPoint[] array3 = array2;
foreach (MoldDenialPoint moldDenialPoint in array3)
{
spatialGrid.AddObject(((Component)moldDenialPoint).gameObject);
Plugin.Logger.LogDebug((object)$"[MoldBlocker] Added denial point at {((Component)moldDenialPoint).transform.position}");
}
Transform[] array4 = array;
foreach (Transform val in array4)
{
if ((Object)(object)val == (Object)null)
{
continue;
}
Vector3 position = val.position;
List<GameObject> nearbyObjects = spatialGrid.GetNearbyObjects(position);
Plugin.Logger.LogDebug((object)$"[MoldBlocker] Checking weed at {position}. Found {nearbyObjects.Count} nearby denial points.");
Collider[] array5 = Physics.OverlapSphere(StartOfRound.Instance.elevatorTransform.position, 20f, 65536);
Vector3 val3;
if (array5.Length != 0)
{
Collider[] array6 = array5;
int num = 0;
if (num < array6.Length)
{
Collider val2 = array6[num];
val3 = StartOfRound.Instance.elevatorTransform.position - ((Component)val2).transform.position;
float sqrMagnitude = ((Vector3)(ref val3)).sqrMagnitude;
Plugin.Logger.LogDebug((object)$"[MoldBlocker] Killing weed near ship at {((Component)val2).transform.position} (Distance: {Mathf.Sqrt(sqrMagnitude)})");
RBMNetworker.Instance.KillShipWeedServerRpc(((Component)val2).transform.position);
}
}
if ((Object)(object)val == (Object)null)
{
continue;
}
foreach (GameObject item in nearbyObjects)
{
val3 = item.transform.position - position;
float sqrMagnitude2 = ((Vector3)(ref val3)).sqrMagnitude;
if (sqrMagnitude2 < 100f)
{
Plugin.Logger.LogDebug((object)$"[MoldBlocker] Killing weed at {position} (Distance: {Mathf.Sqrt(sqrMagnitude2)})");
RBMNetworker.Instance.KillWeedServerRpc(position);
break;
}
}
}
}
}
public class MoldDenialPoint : MonoBehaviour
{
}
[BepInPlugin("dopadream.lethalcompany.rebalancedmoons", "RebalancedMoons", "1.15.6")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
public class Plugin : BaseUnityPlugin
{
internal class RebalancedMoonsPatches
{
private static void InitMoons()
{
if (!Plugin.IsSetupComplete)
{
return;
}
foreach (ExtendedLevel vanillaExtendedLevel in PatchedContent.VanillaExtendedLevels)
{
SwapScene(vanillaExtendedLevel);
}
}
private static void SwapScene(ExtendedLevel extendedLevel)
{
if (new Dictionary<string, Action<ExtendedLevel>>
{
{
"Experimentation",
delegate(ExtendedLevel level)
{
SetScene(level, "ReExperimentationScene");
}
},
{
"Assurance",
delegate(ExtendedLevel level)
{
SetScene(level, "ReAssuranceScene");
}
},
{
"Offense",
delegate(ExtendedLevel level)
{
SetScene(level, "ReOffenseScene");
}
},
{
"Vow",
delegate(ExtendedLevel level)
{
SetScene(level, "ReVowScene");
}
},
{
"March",
delegate(ExtendedLevel level)
{
SetScene(level, "ReMarchScene");
}
},
{
"Adamance",
delegate(ExtendedLevel level)
{
SetScene(level, "ReAdamanceScene");
}
},
{
"Rend",
delegate(ExtendedLevel level)
{
SetScene(level, "ReRendScene");
}
},
{
"Dine",
delegate(ExtendedLevel level)
{
SetScene(level, "ReDineScene");
}
},
{
"Titan",
delegate(ExtendedLevel level)
{
SetScene(level, "ReTitanScene");
}
},
{
"Artifice",
delegate(ExtendedLevel level)
{
SetScene(level, "ReArtificeScene");
}
},
{
"Embrion",
delegate(ExtendedLevel level)
{
SetScene(level, "ReEmbrionScene");
}
}
}.TryGetValue(extendedLevel.NumberlessPlanetName, out var value))
{
value(extendedLevel);
}
}
private static void SetScene(ExtendedLevel extendedLevel, string sceneName)
{
if ((NetworkManager.Singleton.IsHost || NetworkManager.Singleton.IsServer) && new Dictionary<string, bool>
{
{
"Experimentation",
ModConfig.configExperimentationScene.Value
},
{
"Assurance",
ModConfig.configAssuranceScene.Value
},
{
"Offense",
ModConfig.configOffenseScene.Value
},
{
"Vow",
ModConfig.configVowScene.Value
},
{
"March",
ModConfig.configMarchScene.Value
},
{
"Adamance",
ModConfig.configAdamanceScene.Value
},
{
"Rend",
ModConfig.configRendScene.Value
},
{
"Dine",
ModConfig.configDineScene.Value
},
{
"Titan",
ModConfig.configTitanScene.Value
},
{
"Embrion",
ModConfig.configEmbrionScene.Value
},
{
"Artifice",
ModConfig.configArtificeScene.Value
}
}.TryGetValue(extendedLevel.NumberlessPlanetName, out var value) && value)
{
SendLevelToClients(extendedLevel.SelectableLevel.levelID, "RBMSceneEvent", sceneName);
}
}
[HarmonyPatch(typeof(QuickMenuManager), "Start")]
[HarmonyPostfix]
private static void SubscribeToHandler()
{
RBMNetworker.SendLevelEvent += ReceivedLevelFromServer;
SetupLobby(StartOfRound.Instance);
}
[HarmonyPatch(typeof(QuickMenuManager), "LeaveGameConfirm")]
[HarmonyPostfix]
private static void UnsubscribeFromHandler()
{
RBMNetworker.SendLevelEvent -= ReceivedLevelFromServer;
}
[HarmonyPatch(typeof(StartOfRound), "OnClientConnect")]
[HarmonyPostfix]
private static void ClientConnectPostFix(StartOfRound __instance)
{
SetupLobby(__instance);
}
private static void SetupLobby(StartOfRound __instance)
{
InitMoons();
RBMNetworker.Instance.InteriorServerRpc();
RBMNetworker.Instance.MoonPriceServerRpc();
RBMNetworker.Instance.WeatherServerRpc();
RBMNetworker.Instance.MoonPropertiesServerRpc();
}
public static void SendLevelToClients(int extendedLevel, string eventName, string sceneName)
{
if (NetworkManager.Singleton.IsHost || NetworkManager.Singleton.IsServer)
{
RBMNetworker.Instance.LevelClientRpc(extendedLevel, eventName, sceneName);
}
}
public static void ReceivedLevelFromServer(int extendedLevel, string eventName, string sceneName)
{
//IL_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_0077: Expected O, but got Unknown
//IL_0155: Unknown result type (might be due to invalid IL or missing references)
//IL_015f: Expected O, but got Unknown
foreach (ExtendedLevel vanillaExtendedLevel in PatchedContent.VanillaExtendedLevels)
{
if (!vanillaExtendedLevel.SelectableLevel.levelID.Equals(extendedLevel))
{
continue;
}
if (!(eventName == "RBMSceneEvent"))
{
if (eventName == "VanillaSceneEvent" && new Dictionary<string, string>
{
{ "ReExperimentationScene", "Level1Experimentation" },
{ "ReAssuranceScene", "Level2Assurance" },
{ "ReVowScene", "Level3Vow" },
{ "ReMarchScene", "Level4March" },
{ "ReRendScene", "Level5Rend" },
{ "ReDineScene", "Level6Dine" },
{ "ReOffenseScene", "Level7Offense" },
{ "ReTitanScene", "Level8Titan" },
{ "ReArtificeScene", "Level9Artifice" },
{ "ReAdamanceScene", "Level10Adamance" }
}.TryGetValue(vanillaExtendedLevel.SelectableLevel.sceneName, out var value))
{
vanillaExtendedLevel.SelectableLevel.sceneName = sceneName;
vanillaExtendedLevel.SceneSelections.Clear();
vanillaExtendedLevel.SceneSelections.Add(new StringWithRarity(value, 100));
}
}
else
{
vanillaExtendedLevel.SelectableLevel.sceneName = sceneName;
vanillaExtendedLevel.SceneSelections.Clear();
vanillaExtendedLevel.SceneSelections.Add(new StringWithRarity(sceneName, 100));
}
}
}
[HarmonyPatch(typeof(RoundManager), "SetChallengeFileRandomModifiers")]
[HarmonyPriority(800)]
[HarmonyPrefix]
private static void OnGenerateNewFloorPrefix(RoundManager __instance)
{
if ((NetworkManager.Singleton.IsHost || NetworkManager.Singleton.IsServer) && (Object)(object)StartOfRound.Instance.currentLevel != (Object)null)
{
if (!ModConfig.configTitanThirdFireExit.Value && ((Object)StartOfRound.Instance.currentLevel).name.Equals("TitanLevel") && ModConfig.configTitanScene.Value)
{
Logger.LogDebug((object)"Rebalanced Titan loaded, deactivating 3rd fire exit...");
RBMNetworker.Instance.DeactivateObjectClientRpc("Environment/Teleports/ExtraFire");
}
if (!ModConfig.configMarchBridge.Value && ((Object)StartOfRound.Instance.currentLevel).name.Equals("MarchLevel") && ModConfig.configMarchScene.Value)
{
Logger.LogDebug((object)"Rebalanced March loaded, deactivating rickety bridge...");
RBMNetworker.Instance.DeactivateObjectClientRpc("Environment/DangerousBridge");
}
if (!ModConfig.configOffenseFirePath.Value && ((Object)StartOfRound.Instance.currentLevel).name.Equals("OffenseLevel") && ModConfig.configOffenseScene.Value)
{
Logger.LogDebug((object)"Rebalanced Offense loaded, deactivating new fire exit path...");
RBMNetworker.Instance.DeactivateObjectClientRpc("Environment/Map/ExtraFirePath");
}
if (!ModConfig.configVowLadder.Value && ((Object)StartOfRound.Instance.currentLevel).name.Equals("VowLevel") && ModConfig.configVowScene.Value)
{
Logger.LogDebug((object)"Rebalanced Vow loaded, deactivating ladder...");
RBMNetworker.Instance.DeactivateObjectClientRpc("Environment/Map/WaterDam/LadderObject");
}
}
}
[HarmonyPatch(typeof(RoundManager), "RefreshLightsList")]
[HarmonyPostfix]
private static void RefreshLightsPostFix(ref List<Light> ___allPoweredLights)
{
//IL_0061: Unknown result type (might be due to invalid IL or missing references)
//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
if (ModConfig.configTitanLighting.Value && ((Object)StartOfRound.Instance.currentLevel).name.Equals("TitanLevel"))
{
foreach (Light ___allPoweredLight in ___allPoweredLights)
{
if ((Object)(object)___allPoweredLight != (Object)null)
{
___allPoweredLight.useColorTemperature = true;
___allPoweredLight.color = new Color(0.7f, 0.735f, 0.76f, 1f);
___allPoweredLight.colorTemperature = 6500f;
}
}
}
if (!ModConfig.configIncreasedFog.Value)
{
return;
}
VolumeProfile sharedProfile = GameObject.Find("/Systems/Rendering/VolumeMain").GetComponent<Volume>().sharedProfile;
if ((Object)(object)sharedProfile != (Object)null)
{
foreach (VolumeComponent component in sharedProfile.components)
{
if (((object)component).GetType() == typeof(Fog))
{
Fog val = (Fog)component;
((VolumeParameter)val.depthExtent).overrideState = true;
((VolumeParameter<float>)(object)val.depthExtent).value = 256f;
Logger.LogDebug((object)"Global volumetric fog distance increased");
break;
}
}
return;
}
Logger.LogDebug((object)"Global volume is null for some reason");
}
}
public const string PLUGIN_GUID = "dopadream.lethalcompany.rebalancedmoons";
public const string PLUGIN_NAME = "RebalancedMoons";
public const string PLUGIN_VERSION = "1.15.6";
public const string WEATHER_REGISTRY = "mrov.WeatherRegistry";
public const string LOBBY_COMPATIBILITY = "BMX.LobbyCompatibility";
internal static ManualLogSource Logger;
internal static ExtendedMod rebalancedMoonsMod;
internal static SpawnableOutsideObject embrionBoulder1;
internal static SpawnableOutsideObject embrionBoulder2;
internal static SpawnableOutsideObject embrionBoulder3;
internal static SpawnableOutsideObject embrionBoulder4;
internal static BundledCurve embyBoulderCurve;
public AssetBundle EmbrionBundle;
private static MoldSpreadManager _moldSpreadManager;
public static Plugin Instance { get; set; }
internal static MoldSpreadManager MoldSpreadManager
{
get
{
if ((Object)(object)_moldSpreadManager == (Object)null)
{
_moldSpreadManager = Object.FindAnyObjectByType<MoldSpreadManager>();
}
return _moldSpreadManager;
}
}
public Plugin()
{
Instance = this;
}
private void Awake()
{
//IL_0096: Unknown result type (might be due to invalid IL or missing references)
//IL_009c: Expected O, but got Unknown
Logger = ((BaseUnityPlugin)this).Logger;
if (Chainloader.PluginInfos.ContainsKey("BMX.LobbyCompatibility"))
{
Logger.LogInfo((object)"CROSS-COMPATIBILITY - Lobby Compatibility detected");
LobbyCompatibility.Init();
}
ModConfig.Init(((BaseUnityPlugin)this).Config);
string text = Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), "embrionboulders");
EmbrionBundle = AssetBundle.LoadFromFile(text);
NetcodePatcher();
AssetBundleLoader.AddOnExtendedModLoadedListener((Action<ExtendedMod>)OnExtendedModRegistered, "dopadream", "RebalancedMoons");
Harmony val = new Harmony("dopadream.lethalcompany.rebalancedmoons");
val.PatchAll(typeof(RBMNetworker));
val.PatchAll(typeof(RebalancedMoonsPatches));
val.PatchAll(typeof(MoldBlockerLogic));
if (Chainloader.PluginInfos.ContainsKey("mrov.WeatherRegistry"))
{
Logger.LogInfo((object)"CROSS-COMPATIBILITY - Weather Registry detected");
val.PatchAll(typeof(WeatherRegistryCompat));
}
Logger.LogInfo((object)"RebalancedMoons v1.15.6 loaded");
}
private static void NetcodePatcher()
{
Type[] types = Assembly.GetExecutingAssembly().GetTypes();
for (int i = 0; i < types.Length; i++)
{
MethodInfo[] methods = types[i].GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic);
foreach (MethodInfo methodInfo in methods)
{
if (methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false).Length != 0)
{
methodInfo.Invoke(null, null);
}
}
}
}
internal static void OnExtendedModRegistered(ExtendedMod extendedMod)
{
if (!((Object)(object)extendedMod == (Object)null))
{
rebalancedMoonsMod = extendedMod;
}
}
}
internal class RBMNetworker : NetworkBehaviour
{
internal static GameObject networkPrefab;
internal static RBMNetworker Instance { get; private set; }
public static event Action<int, string, string> SendLevelEvent;
[HarmonyPatch(typeof(GameNetworkManager), "Start")]
[HarmonyPostfix]
public static void Init()
{
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_0028: Unknown result type (might be due to invalid IL or missing references)
//IL_0035: Expected O, but got Unknown
if ((Object)(object)networkPrefab != (Object)null)
{
Plugin.Logger.LogDebug((object)"Skipped network handler registration, because it has already been initialized");
return;
}
try
{
networkPrefab = new GameObject("RBMNetworker")
{
hideFlags = (HideFlags)61
};
networkPrefab.AddComponent<NetworkObject>().GlobalObjectIdHash = XXHash.Hash32("dopadream.lethalcompany.rebalancedmoons" + ((Object)networkPrefab).name);
networkPrefab.AddComponent<RBMNetworker>();
NetworkManager.Singleton.AddNetworkPrefab(networkPrefab);
Plugin.Logger.LogDebug((object)"Successfully registered network handler. This is good news!");
}
catch (Exception arg)
{
Plugin.Logger.LogError((object)$"Encountered some fatal error while registering network handler. The mod will not function like this!\n{arg}");
}
}
internal static void Create()
{
try
{
if (NetworkManager.Singleton.IsServer && (Object)(object)networkPrefab != (Object)null)
{
Object.Instantiate<GameObject>(networkPrefab).GetComponent<NetworkObject>().Spawn(false);
}
}
catch
{
Plugin.Logger.LogError((object)"Encountered some fatal error while spawning network handler. It is likely that registration failed earlier on start-up, please consult your logs.");
}
}
private void Awake()
{
Instance = this;
}
public override void OnNetworkSpawn()
{
RBMNetworker.SendLevelEvent = null;
((NetworkBehaviour)this).OnNetworkSpawn();
if ((Object)(object)Instance != (Object)(object)this)
{
NetworkObject val = default(NetworkObject);
if (((Component)Instance).TryGetComponent<NetworkObject>(ref val) && !val.IsSpawned && (Object)(object)Instance != (Object)(object)networkPrefab)
{
Object.Destroy((Object)(object)Instance);
}
Plugin.Logger.LogWarning((object)"There are 2 RBMNetworkers instantiated, and the wrong one was assigned as Instance. This shouldn't happen, but is recoverable");
Instance = this;
}
Plugin.Logger.LogDebug((object)"Successfully spawned network handler.");
}
[HarmonyPatch(typeof(StartOfRound), "Awake")]
[HarmonyPostfix]
public static void StartOfRoundWake()
{
Create();
}
private void Start()
{
if (!((Object)(object)this != (Object)(object)Instance))
{
_ = ((NetworkBehaviour)this).IsSpawned;
}
}
[ServerRpc(RequireOwnership = false)]
public void InteriorServerRpc()
{
//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)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager == null || !networkManager.IsListening)
{
return;
}
if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
{
ServerRpcParams val = default(ServerRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3111670011u, val, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3111670011u, val, (RpcDelivery)0);
}
if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
{
if (ModConfig.configMarchDungeons.Value)
{
InteriorClientRpc("March");
}
if (ModConfig.configDineDungeons.Value)
{
InteriorClientRpc("Dine");
}
if (ModConfig.configTitanDungeons.Value)
{
InteriorClientRpc("Titan");
}
}
}
[ServerRpc(RequireOwnership = false)]
public void WeatherServerRpc()
{
//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)
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(880982333u, val, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendServerRpc(ref val2, 880982333u, val, (RpcDelivery)0);
}
if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost) && ModConfig.configWeatherOverrides.Value)
{
WeatherClientRpc();
}
}
}
[ServerRpc(RequireOwnership = false)]
public void MoonPriceServerRpc()
{
//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)
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(2387898704u, val, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2387898704u, val, (RpcDelivery)0);
}
if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost) && ModConfig.configMoonPriceOverrides.Value)
{
MoonPriceClientRpc();
}
}
}
[ServerRpc(RequireOwnership = false)]
public void MoonPropertiesServerRpc()
{
//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)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager == null || !networkManager.IsListening)
{
return;
}
if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
{
ServerRpcParams val = default(ServerRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(4189456627u, val, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendServerRpc(ref val2, 4189456627u, val, (RpcDelivery)0);
}
if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
{
if (ModConfig.configEmbrionBoulders.Value)
{
MoonPropertiesClientRpc("EmbrionBoulders");
}
if (ModConfig.configEmbrionGambling.Value)
{
MoonPropertiesClientRpc("EmbrionGambling");
}
}
}
[ClientRpc]
public void MoonPriceClientRpc()
{
//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)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager == null || !networkManager.IsListening)
{
return;
}
if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
{
ClientRpcParams val = default(ClientRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(297644395u, val, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 297644395u, val, (RpcDelivery)0);
}
if ((int)base.__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost))
{
return;
}
foreach (ExtendedLevel vanillaExtendedLevel in PatchedContent.VanillaExtendedLevels)
{
if (vanillaExtendedLevel.NumberlessPlanetName == "Dine")
{
vanillaExtendedLevel.RoutePrice = 650;
}
}
}
[ClientRpc]
public void WeatherClientRpc()
{
//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_0154: Unknown result type (might be due to invalid IL or missing references)
//IL_012b: 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 != 2 && (networkManager.IsServer || networkManager.IsHost))
{
ClientRpcParams val = default(ClientRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3844008019u, val, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3844008019u, val, (RpcDelivery)0);
}
if ((int)base.__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost))
{
return;
}
foreach (ExtendedLevel vanillaExtendedLevel in PatchedContent.VanillaExtendedLevels)
{
string numberlessPlanetName = vanillaExtendedLevel.NumberlessPlanetName;
if (!(numberlessPlanetName == "Dine"))
{
if (numberlessPlanetName == "March")
{
vanillaExtendedLevel.SelectableLevel.overrideWeather = true;
vanillaExtendedLevel.SelectableLevel.overrideWeatherType = (LevelWeatherType)1;
}
continue;
}
RandomWeatherWithVariables val3 = ((IEnumerable<RandomWeatherWithVariables>)vanillaExtendedLevel.SelectableLevel.randomWeathers).FirstOrDefault((Func<RandomWeatherWithVariables, bool>)((RandomWeatherWithVariables weather) => (int)weather.weatherType == 1));
if (val3 != null)
{
val3.weatherType = (LevelWeatherType)3;
val3.weatherVariable = 4;
val3.weatherVariable2 = 12;
}
}
}
[ClientRpc]
public void MoonPropertiesClientRpc(string configProperty)
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
//IL_00d4: Invalid comparison between Unknown and I4
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_0088: Unknown result type (might be due to invalid IL or missing references)
//IL_008e: Unknown result type (might be due to invalid IL or missing references)
//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
//IL_0212: Unknown result type (might be due to invalid IL or missing references)
//IL_0217: Unknown result type (might be due to invalid IL or missing references)
//IL_021f: Unknown result type (might be due to invalid IL or missing references)
//IL_0228: Expected O, but got Unknown
//IL_02c8: Unknown result type (might be due to invalid IL or missing references)
//IL_02cf: Expected O, but got Unknown
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager == null || !networkManager.IsListening)
{
return;
}
if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
{
ClientRpcParams val = default(ClientRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(246330295u, val, (RpcDelivery)0);
bool flag = configProperty != null;
((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives));
if (flag)
{
((FastBufferWriter)(ref val2)).WriteValueSafe(configProperty, false);
}
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 246330295u, val, (RpcDelivery)0);
}
if ((int)base.__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost))
{
return;
}
foreach (ExtendedLevel vanillaExtendedLevel in PatchedContent.VanillaExtendedLevels)
{
if (!(vanillaExtendedLevel.NumberlessPlanetName == "Embrion"))
{
continue;
}
if (!(configProperty == "EmbrionBoulders"))
{
if (!(configProperty == "EmbrionGambling"))
{
continue;
}
vanillaExtendedLevel.SelectableLevel.spawnableScrap.Clear();
foreach (Item items in StartOfRound.Instance.allItemsList.itemsList)
{
if (!items.twoHanded && items.isScrap && (!items.isDefensiveWeapon || !(items.itemName != "Stop sign") || !(items.itemName != "Yield sign")))
{
SpawnableItemWithRarity val3 = new SpawnableItemWithRarity();
val3.spawnableItem = items;
val3.rarity = 300;
vanillaExtendedLevel.SelectableLevel.spawnableScrap.Add(val3);
}
}
continue;
}
BundledCurve bundledCurve = LoadCurve(ref Plugin.embyBoulderCurve, "EmbrionRockCurve");
if ((Object)(object)bundledCurve == (Object)null || bundledCurve.curve == null)
{
Debug.LogError((object)"Failed to load EmbrionRockCurve!");
break;
}
AnimationCurve curve = bundledCurve.curve;
string[] array = new string[4] { "LargeRock1Embrion", "LargeRock2Embrion", "LargeRock3Embrion", "LargeRock4Embrion" };
SpawnableOutsideObject[] array2 = (SpawnableOutsideObject[])(object)new SpawnableOutsideObject[4]
{
Plugin.embrionBoulder1,
Plugin.embrionBoulder2,
Plugin.embrionBoulder3,
Plugin.embrionBoulder4
};
List<SpawnableOutsideObjectWithRarity> list = new List<SpawnableOutsideObjectWithRarity>();
for (int i = 0; i < array.Length; i++)
{
SpawnableOutsideObject val4 = LoadOutsideObject(ref array2[i], array[i]);
if ((Object)(object)val4 == (Object)null)
{
Debug.LogError((object)("Failed to load object: " + array[i]));
continue;
}
SpawnableOutsideObjectWithRarity item = new SpawnableOutsideObjectWithRarity
{
spawnableObject = val4,
randomAmount = curve
};
list.Add(item);
}
vanillaExtendedLevel.SelectableLevel.spawnableOutsideObjects = list.ToArray();
}
}
public SpawnableOutsideObject LoadOutsideObject(ref SpawnableOutsideObject mapObject, string assetName)
{
if ((Object)(object)mapObject == (Object)null)
{
try
{
mapObject = Plugin.Instance.EmbrionBundle.LoadAsset<SpawnableOutsideObject>(assetName);
}
catch (Exception ex)
{
Plugin.Logger.LogError((object)("Failed to load asset '" + assetName + "' from bundle 'embrionboulders': " + ex.Message));
}
}
return mapObject;
}
public BundledCurve LoadCurve(ref BundledCurve curveObject, string assetName)
{
if ((Object)(object)curveObject == (Object)null)
{
try
{
curveObject = Plugin.Instance.EmbrionBundle.LoadAsset<BundledCurve>(assetName);
}
catch (Exception ex)
{
Plugin.Logger.LogError((object)("Failed to load asset '" + assetName + "' from bundle 'embrionboulders': " + ex.Message));
}
}
return curveObject;
}
[ClientRpc]
public void InteriorClientRpc(string name)
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
//IL_00d4: Invalid comparison between Unknown and I4
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_0088: Unknown result type (might be due to invalid IL or missing references)
//IL_008e: Unknown result type (might be due to invalid IL or missing references)
//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager == null || !networkManager.IsListening)
{
return;
}
if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
{
ClientRpcParams val = default(ClientRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3788975601u, val, (RpcDelivery)0);
bool flag = name != null;
((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives));
if (flag)
{
((FastBufferWriter)(ref val2)).WriteValueSafe(name, false);
}
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3788975601u, val, (RpcDelivery)0);
}
if ((int)base.__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost))
{
return;
}
string name2 = name;
if ((Object)(object)Plugin.rebalancedMoonsMod == (Object)null)
{
return;
}
foreach (ExtendedDungeonFlow extendedDungeonFlow in PatchedContent.ExtendedDungeonFlows)
{
List<StringWithRarity> planetNames2 = extendedDungeonFlow.LevelMatchingProperties.planetNames;
switch (((Object)extendedDungeonFlow.DungeonFlow).name)
{
case "Level1Flow3Exits":
planetNames2.RemoveAll((StringWithRarity p) => p.Name.Equals("March") && name2.Equals("March"));
break;
case "Level1Flow":
UpdateMoonInList(planetNames2, "Titan", 140, name2);
AddMoonIfNotInList(planetNames2, "March", 300, name2);
break;
case "Level2Flow":
UpdateMoonInList(planetNames2, "Titan", 40, name2);
AddMoonIfNotInList(planetNames2, "March", 5, name2);
break;
case "Level3Flow":
UpdateMoonInList(planetNames2, "Dine", 50, name2);
UpdateMoonInList(planetNames2, "Titan", 300, name2);
AddMoonIfNotInList(planetNames2, "March", 190, name2);
break;
}
}
static void AddMoonIfNotInList(List<StringWithRarity> planetNames, string planetName, int rarity, string configEvent)
{
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
//IL_003a: Expected O, but got Unknown
if (!planetNames.Any((StringWithRarity p) => p.Name.Equals(planetName) && p.Name.Equals(configEvent)))
{
planetNames.Add(new StringWithRarity(planetName, rarity));
}
}
static void UpdateMoonInList(List<StringWithRarity> planetNames, string planetName, int newRarity, string configEvent)
{
foreach (StringWithRarity planetName in planetNames)
{
if (planetName.Name.Equals(planetName) && planetName.Name.Equals(configEvent))
{
planetName.Rarity = newRarity;
}
}
}
}
[ClientRpc]
public void DeactivateObjectClientRpc(string name)
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
//IL_00d4: Invalid comparison between Unknown and I4
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_0088: Unknown result type (might be due to invalid IL or missing references)
//IL_008e: Unknown result type (might be due to invalid IL or missing references)
//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager == null || !networkManager.IsListening)
{
return;
}
if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
{
ClientRpcParams val = default(ClientRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(4213369234u, val, (RpcDelivery)0);
bool flag = name != null;
((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives));
if (flag)
{
((FastBufferWriter)(ref val2)).WriteValueSafe(name, false);
}
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4213369234u, val, (RpcDelivery)0);
}
if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
{
GameObject val3 = GameObject.Find(name);
if ((Object)(object)val3 != (Object)null && val3.activeSelf)
{
val3.SetActive(false);
}
}
}
[ServerRpc(RequireOwnership = false)]
public void TriggerLadderServerRpc()
{
//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)
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(4035602187u, val, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendServerRpc(ref val2, 4035602187u, val, (RpcDelivery)0);
}
if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
{
Instance.DeactivateObjectClientRpc("Environment/Map/WaterDam/LadderObject/InteractTrigger");
Instance.TriggerLadderClientRpc();
}
}
}
[ClientRpc]
public void TriggerLadderClientRpc()
{
//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)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager == null || !networkManager.IsListening)
{
return;
}
if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
{
ClientRpcParams val = default(ClientRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2265084959u, val, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2265084959u, val, (RpcDelivery)0);
}
if ((int)base.__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost))
{
return;
}
Instance.DeactivateObjectClientRpc("Environment/Map/WaterDam/LadderObject/InteractTrigger");
foreach (Animator item in from anim in ModUtil.SearchInLatestScene<Animator>()
where ((Object)((Component)anim).gameObject).name == "LadderObject"
select anim)
{
item.SetTrigger("used");
}
}
[ClientRpc]
public void LevelClientRpc(int extendedLevel, string eventName, string sceneName)
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_0115: Unknown result type (might be due to invalid IL or missing references)
//IL_011f: Invalid comparison between Unknown and I4
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_0071: Unknown result type (might be due to invalid IL or missing references)
//IL_0095: Unknown result type (might be due to invalid IL or missing references)
//IL_009b: Unknown result type (might be due to invalid IL or missing references)
//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
//IL_0105: 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 != 2 && (networkManager.IsServer || networkManager.IsHost))
{
ClientRpcParams val = default(ClientRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(737864973u, val, (RpcDelivery)0);
BytePacker.WriteValueBitPacked(val2, extendedLevel);
bool flag = eventName != null;
((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives));
if (flag)
{
((FastBufferWriter)(ref val2)).WriteValueSafe(eventName, false);
}
bool flag2 = sceneName != null;
((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag2, default(ForPrimitives));
if (flag2)
{
((FastBufferWriter)(ref val2)).WriteValueSafe(sceneName, false);
}
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 737864973u, val, (RpcDelivery)0);
}
if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
{
RBMNetworker.SendLevelEvent?.Invoke(extendedLevel, eventName, sceneName);
}
}
[ServerRpc(RequireOwnership = false)]
public void KillWeedServerRpc(Vector3 weedPos)
{
//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_0089: 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)
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(1008222696u, val, (RpcDelivery)0);
((FastBufferWriter)(ref val2)).WriteValueSafe(ref weedPos);
((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1008222696u, val, (RpcDelivery)0);
}
if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
{
KillWeedClientRpc(weedPos);
}
}
}
[ServerRpc(RequireOwnership = false)]
public void KillShipWeedServerRpc(Vector3 weedPos)
{
//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_0089: Unknown result type (might be due to invalid IL or missing references)
//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
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(327766596u, val, (RpcDelivery)0);
((FastBufferWriter)(ref val2)).WriteValueSafe(ref weedPos);
((NetworkBehaviour)this).__endSendServerRpc(ref val2, 327766596u, val, (RpcDelivery)0);
}
if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost) && ModConfig.configShipShrouds.Value)
{
KillWeedClientRpc(weedPos);
}
}
}
[ClientRpc]
public void KillWeedClientRpc(Vector3 weedPos)
{
//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_0089: Unknown result type (might be due to invalid IL or missing references)
//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
//IL_00de: 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 != 2 && (networkManager.IsServer || networkManager.IsHost))
{
ClientRpcParams val = default(ClientRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3494542454u, val, (RpcDelivery)0);
((FastBufferWriter)(ref val2)).WriteValueSafe(ref weedPos);
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3494542454u, val, (RpcDelivery)0);
}
if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
{
Plugin.MoldSpreadManager.DestroyMoldAtPosition(weedPos, false);
Plugin.Logger.LogDebug((object)$"Destroying weed at {weedPos}");
}
}
}
protected override void __initializeVariables()
{
((NetworkBehaviour)this).__initializeVariables();
}
[RuntimeInitializeOnLoadMethod]
internal static void InitializeRPCS_RBMNetworker()
{
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
//IL_001b: Expected O, but got Unknown
//IL_002c: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Expected O, but got Unknown
//IL_0047: Unknown result type (might be due to invalid IL or missing references)
//IL_0051: Expected O, but got Unknown
//IL_0062: Unknown result type (might be due to invalid IL or missing references)
//IL_006c: Expected O, but got Unknown
//IL_007d: Unknown result type (might be due to invalid IL or missing references)
//IL_0087: Expected O, but got Unknown
//IL_0098: Unknown result type (might be due to invalid IL or missing references)
//IL_00a2: Expected O, but got Unknown
//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
//IL_00bd: Expected O, but got Unknown
//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
//IL_00d8: Expected O, but got Unknown
//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
//IL_00f3: Expected O, but got Unknown
//IL_0104: Unknown result type (might be due to invalid IL or missing references)
//IL_010e: Expected O, but got Unknown
//IL_011f: Unknown result type (might be due to invalid IL or missing references)
//IL_0129: Expected O, but got Unknown
//IL_013a: Unknown result type (might be due to invalid IL or missing references)
//IL_0144: Expected O, but got Unknown
//IL_0155: Unknown result type (might be due to invalid IL or missing references)
//IL_015f: Expected O, but got Unknown
//IL_0170: Unknown result type (might be due to invalid IL or missing references)
//IL_017a: Expected O, but got Unknown
//IL_018b: Unknown result type (might be due to invalid IL or missing references)
//IL_0195: Expected O, but got Unknown
NetworkManager.__rpc_func_table.Add(3111670011u, new RpcReceiveHandler(__rpc_handler_3111670011));
NetworkManager.__rpc_func_table.Add(880982333u, new RpcReceiveHandler(__rpc_handler_880982333));
NetworkManager.__rpc_func_table.Add(2387898704u, new RpcReceiveHandler(__rpc_handler_2387898704));
NetworkManager.__rpc_func_table.Add(4189456627u, new RpcReceiveHandler(__rpc_handler_4189456627));
NetworkManager.__rpc_func_table.Add(297644395u, new RpcReceiveHandler(__rpc_handler_297644395));
NetworkManager.__rpc_func_table.Add(3844008019u, new RpcReceiveHandler(__rpc_handler_3844008019));
NetworkManager.__rpc_func_table.Add(246330295u, new RpcReceiveHandler(__rpc_handler_246330295));
NetworkManager.__rpc_func_table.Add(3788975601u, new RpcReceiveHandler(__rpc_handler_3788975601));
NetworkManager.__rpc_func_table.Add(4213369234u, new RpcReceiveHandler(__rpc_handler_4213369234));
NetworkManager.__rpc_func_table.Add(4035602187u, new RpcReceiveHandler(__rpc_handler_4035602187));
NetworkManager.__rpc_func_table.Add(2265084959u, new RpcReceiveHandler(__rpc_handler_2265084959));
NetworkManager.__rpc_func_table.Add(737864973u, new RpcReceiveHandler(__rpc_handler_737864973));
NetworkManager.__rpc_func_table.Add(1008222696u, new RpcReceiveHandler(__rpc_handler_1008222696));
NetworkManager.__rpc_func_table.Add(327766596u, new RpcReceiveHandler(__rpc_handler_327766596));
NetworkManager.__rpc_func_table.Add(3494542454u, new RpcReceiveHandler(__rpc_handler_3494542454));
}
private static void __rpc_handler_3111670011(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
target.__rpc_exec_stage = (__RpcExecStage)1;
((RBMNetworker)(object)target).InteriorServerRpc();
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_880982333(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
target.__rpc_exec_stage = (__RpcExecStage)1;
((RBMNetworker)(object)target).WeatherServerRpc();
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_2387898704(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
target.__rpc_exec_stage = (__RpcExecStage)1;
((RBMNetworker)(object)target).MoonPriceServerRpc();
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_4189456627(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
target.__rpc_exec_stage = (__RpcExecStage)1;
((RBMNetworker)(object)target).MoonPropertiesServerRpc();
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_297644395(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
target.__rpc_exec_stage = (__RpcExecStage)2;
((RBMNetworker)(object)target).MoonPriceClientRpc();
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_3844008019(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
target.__rpc_exec_stage = (__RpcExecStage)2;
((RBMNetworker)(object)target).WeatherClientRpc();
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_246330295(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_002f: Unknown result type (might be due to invalid IL or missing references)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
//IL_0061: Unknown result type (might be due to invalid IL or missing references)
//IL_007b: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
bool flag = default(bool);
((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives));
string configProperty = null;
if (flag)
{
((FastBufferReader)(ref reader)).ReadValueSafe(ref configProperty, false);
}
target.__rpc_exec_stage = (__RpcExecStage)2;
((RBMNetworker)(object)target).MoonPropertiesClientRpc(configProperty);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_3788975601(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_002f: Unknown result type (might be due to invalid IL or missing references)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
//IL_0061: Unknown result type (might be due to invalid IL or missing references)
//IL_007b: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
bool flag = default(bool);
((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives));
string name = null;
if (flag)
{
((FastBufferReader)(ref reader)).ReadValueSafe(ref name, false);
}
target.__rpc_exec_stage = (__RpcExecStage)2;
((RBMNetworker)(object)target).InteriorClientRpc(name);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_4213369234(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_002f: Unknown result type (might be due to invalid IL or missing references)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
//IL_0061: Unknown result type (might be due to invalid IL or missing references)
//IL_007b: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
bool flag = default(bool);
((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives));
string name = null;
if (flag)
{
((FastBufferReader)(ref reader)).ReadValueSafe(ref name, false);
}
target.__rpc_exec_stage = (__RpcExecStage)2;
((RBMNetworker)(object)target).DeactivateObjectClientRpc(name);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_4035602187(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
target.__rpc_exec_stage = (__RpcExecStage)1;
((RBMNetworker)(object)target).TriggerLadderServerRpc();
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_2265084959(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
target.__rpc_exec_stage = (__RpcExecStage)2;
((RBMNetworker)(object)target).TriggerLadderClientRpc();
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_737864973(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_003c: Unknown result type (might be due to invalid IL or missing references)
//IL_0042: Unknown result type (might be due to invalid IL or missing references)
//IL_0074: Unknown result type (might be due to invalid IL or missing references)
//IL_007a: Unknown result type (might be due to invalid IL or missing references)
//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
int extendedLevel = default(int);
ByteUnpacker.ReadValueBitPacked(reader, ref extendedLevel);
bool flag = default(bool);
((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives));
string eventName = null;
if (flag)
{
((FastBufferReader)(ref reader)).ReadValueSafe(ref eventName, false);
}
bool flag2 = default(bool);
((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag2, default(ForPrimitives));
string sceneName = null;
if (flag2)
{
((FastBufferReader)(ref reader)).ReadValueSafe(ref sceneName, false);
}
target.__rpc_exec_stage = (__RpcExecStage)2;
((RBMNetworker)(object)target).LevelClientRpc(extendedLevel, eventName, sceneName);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_1008222696(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0036: 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_0050: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
Vector3 weedPos = default(Vector3);
((FastBufferReader)(ref reader)).ReadValueSafe(ref weedPos);
target.__rpc_exec_stage = (__RpcExecStage)1;
((RBMNetworker)(object)target).KillWeedServerRpc(weedPos);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_327766596(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0036: 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_0050: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
Vector3 weedPos = default(Vector3);
((FastBufferReader)(ref reader)).ReadValueSafe(ref weedPos);
target.__rpc_exec_stage = (__RpcExecStage)1;
((RBMNetworker)(object)target).KillShipWeedServerRpc(weedPos);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_3494542454(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0036: 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_0050: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
Vector3 weedPos = default(Vector3);
((FastBufferReader)(ref reader)).ReadValueSafe(ref weedPos);
target.__rpc_exec_stage = (__RpcExecStage)2;
((RBMNetworker)(object)target).KillWeedClientRpc(weedPos);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
protected internal override string __getTypeName()
{
return "RBMNetworker";
}
}
public class RollupLadderTrigger : NetworkBehaviour
{
public AudioSource thisAudioSource;
public AudioClip useAudio;
public void TriggerLadder(PlayerControllerB playerWhoTriggered)
{
RBMNetworker.Instance.TriggerLadderServerRpc();
}
public void TriggerSound(PlayerControllerB playerWhoTriggered)
{
PlayAudioClientRpc();
}
[ClientRpc]
private void PlayAudioClientRpc()
{
//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_011e: 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 != 2 && (networkManager.IsServer || networkManager.IsHost))
{
ClientRpcParams val = default(ClientRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3909763483u, val, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3909763483u, val, (RpcDelivery)0);
}
if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && !((Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)null) && !((Object)(object)thisAudioSource == (Object)null))
{
AudioClip val3 = useAudio;
if (!((Object)(object)val3 == (Object)null))
{
thisAudioSource.PlayOneShot(val3, 1f);
WalkieTalkie.TransmitOneShotAudio(thisAudioSource, val3, 1f);
RoundManager.Instance.PlayAudibleNoise(((Component)thisAudioSource).transform.position, 18f, 0.7f, 0, StartOfRound.Instance.hangarDoorsClosed, 400);
}
}
}
protected override void __initializeVariables()
{
((NetworkBehaviour)this).__initializeVariables();
}
[RuntimeInitializeOnLoadMethod]
internal static void InitializeRPCS_RollupLadderTrigger()
{
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
//IL_001b: Expected O, but got Unknown
NetworkManager.__rpc_func_table.Add(3909763483u, new RpcReceiveHandler(__rpc_handler_3909763483));
}
private static void __rpc_handler_3909763483(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
target.__rpc_exec_stage = (__RpcExecStage)2;
((RollupLadderTrigger)(object)target).PlayAudioClientRpc();
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
protected internal override string __getTypeName()
{
return "RollupLadderTrigger";
}
}
internal class WeatherRegistryCompat
{
[HarmonyPatch(typeof(RoundManager), "LoadNewLevel")]
[HarmonyPostfix]
private static void startGamePostfix(RoundManager __instance)
{
initWeatherTweaksCompat(__instance);
}
private static void initWeatherTweaksCompat(RoundManager instance)
{
if (!((Object)instance.currentLevel).name.Equals("TitanLevel") || !WeatherManager.GetCurrentLevelWeather().Name.Equals("Blackout"))
{
return;
}
Plugin.Logger.LogDebug((object)"Titan Blackout detected, turning the evil fire exit off...");
foreach (AudioSource item in from aud in ModUtil.SearchInLatestScene<AudioSource>()
where ((Object)((Component)aud).gameObject).name == "BrokenLight"
select aud)
{
item.mute = true;
}
}
}
public static class PluginInfo
{
public const string PLUGIN_GUID = "RebalancedMoons";
public const string PLUGIN_NAME = "RebalancedMoons";
public const string PLUGIN_VERSION = "1.15.6";
}
}
namespace System.Runtime.CompilerServices
{
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
internal sealed class IgnoresAccessChecksToAttribute : Attribute
{
public IgnoresAccessChecksToAttribute(string assemblyName)
{
}
}
}
namespace RebalancedMoons.NetcodePatcher
{
[AttributeUsage(AttributeTargets.Module)]
internal class NetcodePatchedAssemblyAttribute : Attribute
{
}
}