Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of shrooms v1.5.0
shrooms.dll
Decompiled 5 hours ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; using System.IO.Compression; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Serialization; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using HarmonyLib; using JetBrains.Annotations; using Jotunn; using Jotunn.Configs; using Jotunn.Entities; using Jotunn.Managers; using Jotunn.Utils; using Microsoft.CodeAnalysis; using ServerSync; using TMPro; using UnityEngine; using UnityEngine.PostProcessing; using UnityEngine.UI; [assembly: AssemblyFileVersion("1.5.0")] [assembly: ComVisible(false)] [assembly: AssemblyTrademark("")] [assembly: AssemblyCopyright("Copyright © 2021")] [assembly: AssemblyProduct("1010101110.shrooms")] [assembly: AssemblyCompany("1010101110")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyDescription("")] [assembly: AssemblyTitle("shrooms")] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: CompilationRelaxations(8)] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.5.0.0")] [module: UnverifiableCode] namespace tripping { [BepInPlugin("1010101110.shrooms", "shrooms", "1.5.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Mod : BaseUnityPlugin { public const string pluginAuthor = "1010101110"; public const string pluginName = "shrooms"; public const string pluginID = "1010101110.shrooms"; public const string pluginVersion = "1.5.0"; public const string pluginBuildDate = "2026-09-25"; internal static readonly ConfigSync configSync = new ConfigSync("1010101110.shrooms") { DisplayName = "shrooms", CurrentVersion = "1.5.0", MinimumRequiredVersion = "1.5.0" }; internal static ConfigEntry<bool> configLocked; internal static ConfigEntry<bool> configBlackEnable; internal static ConfigEntry<Biome> configBlackBiome; internal static ConfigEntry<int> configBlackGroupSizeMin; internal static ConfigEntry<int> configBlackGroupSizeMax; internal static ConfigEntry<float> configBlackSpawnChance; internal static ConfigEntry<float> configBlackFoodTime; internal static ConfigEntry<float> configBlackFoodHp; internal static ConfigEntry<float> configBlackFoodStamina; internal static ConfigEntry<float> configBlackFoodEitr; internal static ConfigEntry<float> configBlackFoodRegen; internal static ConfigEntry<bool> configPinkEnable; internal static ConfigEntry<Biome> configPinkBiome; internal static ConfigEntry<int> configPinkGroupSizeMin; internal static ConfigEntry<int> configPinkGroupSizeMax; internal static ConfigEntry<float> configPinkSpawnChance; internal static ConfigEntry<float> configPinkFoodTime; internal static ConfigEntry<float> configPinkFoodHp; internal static ConfigEntry<float> configPinkFoodStamina; internal static ConfigEntry<float> configPinkFoodEitr; internal static ConfigEntry<float> configPinkFoodRegen; internal static ConfigEntry<bool> configBloodEnable; internal static ConfigEntry<Biome> configBloodBiome; internal static ConfigEntry<int> configBloodGroupSizeMin; internal static ConfigEntry<int> configBloodGroupSizeMax; internal static ConfigEntry<float> configBloodSpawnChance; internal static ConfigEntry<float> configBloodFoodTime; internal static ConfigEntry<float> configBloodFoodHp; internal static ConfigEntry<float> configBloodFoodStamina; internal static ConfigEntry<float> configBloodFoodEitr; internal static ConfigEntry<float> configBloodFoodRegen; internal static ConfigEntry<bool> configGreenEnable; internal static ConfigEntry<Biome> configGreenBiome; internal static ConfigEntry<int> configGreenGroupSizeMin; internal static ConfigEntry<int> configGreenGroupSizeMax; internal static ConfigEntry<float> configGreenSpawnChance; internal static ConfigEntry<float> configGreenFoodTime; internal static ConfigEntry<float> configGreenFoodHp; internal static ConfigEntry<float> configGreenFoodStamina; internal static ConfigEntry<float> configGreenFoodEitr; internal static ConfigEntry<float> configGreenFoodRegen; internal static ConfigEntry<bool> configBlueEnable; internal static ConfigEntry<Biome> configBlueBiome; internal static ConfigEntry<int> configBlueGroupSizeMin; internal static ConfigEntry<int> configBlueGroupSizeMax; internal static ConfigEntry<float> configBlueSpawnChance; internal static ConfigEntry<float> configBlueFoodTime; internal static ConfigEntry<float> configBlueFoodHp; internal static ConfigEntry<float> configBlueFoodStamina; internal static ConfigEntry<float> configBlueFoodEitr; internal static ConfigEntry<float> configBlueFoodRegen; internal static ConfigEntry<bool> configPurpleEnable; internal static ConfigEntry<Biome> configPurpleBiome; internal static ConfigEntry<int> configPurpleGroupSizeMin; internal static ConfigEntry<int> configPurpleGroupSizeMax; internal static ConfigEntry<float> configPurpleSpawnChance; internal static ConfigEntry<float> configPurpleFoodTime; internal static ConfigEntry<float> configPurpleFoodHp; internal static ConfigEntry<float> configPurpleFoodStamina; internal static ConfigEntry<float> configPurpleFoodEitr; internal static ConfigEntry<float> configPurpleFoodRegen; internal static ConfigEntry<bool> configRainbowEnable; internal static ConfigEntry<Biome> configRainbowBiome; internal static ConfigEntry<int> configRainbowGroupSizeMin; internal static ConfigEntry<int> configRainbowGroupSizeMax; internal static ConfigEntry<float> configRainbowSpawnChance; internal static ConfigEntry<float> configRainbowFoodTime; internal static ConfigEntry<float> configRainbowFoodHp; internal static ConfigEntry<float> configRainbowFoodStamina; internal static ConfigEntry<float> configRainbowFoodEitr; internal static ConfigEntry<float> configRainbowFoodRegen; internal static ConfigEntry<string> configRainbowRecipeStation; internal static ConfigEntry<string> configRainbowRecipe1; internal static ConfigEntry<int> configRainbowRecipe1qty; internal static ConfigEntry<string> configRainbowRecipe2; internal static ConfigEntry<int> configRainbowRecipe2qty; internal static ConfigEntry<string> configRainbowRecipe3; internal static ConfigEntry<int> configRainbowRecipe3qty; internal static ConfigEntry<string> configRainbowRecipe4; internal static ConfigEntry<int> configRainbowRecipe4qty; internal static ConfigEntry<bool> configLavaEnable; internal static ConfigEntry<Biome> configLavaBiome; internal static ConfigEntry<int> configLavaGroupSizeMin; internal static ConfigEntry<int> configLavaGroupSizeMax; internal static ConfigEntry<float> configLavaSpawnChance; internal static ConfigEntry<float> configLavaFoodTime; internal static ConfigEntry<float> configLavaFoodHp; internal static ConfigEntry<float> configLavaFoodStamina; internal static ConfigEntry<float> configLavaFoodEitr; internal static ConfigEntry<float> configLavaFoodRegen; internal static ConfigEntry<bool> configWhiteEnable; internal static ConfigEntry<Biome> configWhiteBiome; internal static ConfigEntry<int> configWhiteGroupSizeMin; internal static ConfigEntry<int> configWhiteGroupSizeMax; internal static ConfigEntry<float> configWhiteSpawnChance; internal static ConfigEntry<float> configWhiteFoodTime; internal static ConfigEntry<float> configWhiteFoodHp; internal static ConfigEntry<float> configWhiteFoodStamina; internal static ConfigEntry<float> configWhiteFoodEitr; internal static ConfigEntry<float> configWhiteFoodRegen; internal static Image vignetteImage; public static readonly Harmony harmony = new Harmony(typeof(Mod).GetCustomAttributes(typeof(BepInPlugin), inherit: false).Cast<BepInPlugin>().First() .GUID); private ConfigEntry<T> config<T>(string group, string name, T value, ConfigDescription description, bool synchronizedSetting = true) { ConfigEntry<T> val = ((BaseUnityPlugin)this).Config.Bind<T>(group, name, value, description); SyncedConfigEntry<T> syncedConfigEntry = configSync.AddConfigEntry<T>(val); syncedConfigEntry.SynchronizedConfig = synchronizedSetting; return val; } private ConfigEntry<T> config<T>(string group, string name, T value, string description, bool synchronizedSetting = true) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown return config(group, name, value, new ConfigDescription(description, (AcceptableValueBase)null, Array.Empty<object>()), synchronizedSetting); } private void Awake() { configLocked = config("0 - Overall", "Lock Configuration", value: true, "Configuration is locked and can be changed by server admins only."); configBlackEnable = config("1 - Black Mushroom", "Enabled", value: true, "Globally enable/disable black mushroom"); configBlackBiome = config<Biome>("1 - Black Mushroom", "Vegetation Biome", (Biome)8, "Mushroom will spawn in this biome. Specific biome, all, or none to disable vegetation"); configBlackGroupSizeMin = config("1 - Black Mushroom", "Vegetation Group Size Min", 2, "minimum number of mushrooms to spawn in a group, 1-6"); configBlackGroupSizeMax = config("1 - Black Mushroom", "Vegetation Group Size", 4, "maximum number of mushrooms to spawn in a group, 1-6"); configBlackSpawnChance = config("1 - Black Mushroom", "Vegetation Spawn Chance", 0.2f, "the chance the mushrooms vegetation object(s) will be placed in a zone, 0.01 - 1.0, so .01 = 1%, .5 - 50%"); configBlackFoodTime = config("1 - Black Mushroom", "Food Time", 600f, "how long the food lasts"); configBlackFoodHp = config("1 - Black Mushroom", "Food Hp", 10f, "how much hp the food gives you"); configBlackFoodStamina = config("1 - Black Mushroom", "Food Stamina", 50f, "how much stamina the food gives you"); configBlackFoodEitr = config("1 - Black Mushroom", "Food Eitr", 0f, "how much eitr the food gives you"); configBlackFoodRegen = config("1 - Black Mushroom", "Food Regen", 0f, "how much hp is regen per tick for this food"); configPinkEnable = config("2 - Pink Mushroom", "Enabled", value: true, "Globally enable/disable pink mushroom"); configPinkBiome = config<Biome>("2 - Pink Mushroom", "Vegetation Biome", (Biome)8, "Mushroom will spawn in this biome. Specific biome, all, or none to disable vegetation"); configPinkGroupSizeMin = config("2 - Pink Mushroom", "Vegetation Group Size Min", 4, "minimum number of mushrooms to spawn in a group, 1-6"); configPinkGroupSizeMax = config("2 - Pink Mushroom", "Vegetation Group Size", 6, "maximum number of mushrooms to spawn in a group, 1-6"); configPinkSpawnChance = config("2 - Pink Mushroom", "Vegetation Spawn Chance", 0.15f, "the chance the mushrooms vegetation object(s) will be placed in a zone, 0.02 - 1.0, so .01 = 1%, .5 - 50%"); configPinkFoodTime = config("2 - Pink Mushroom", "Food Time", 1200f, "how long the food lasts in seconds"); configPinkFoodHp = config("2 - Pink Mushroom", "Food Hp", 10f, "how much hp the food gives you"); configPinkFoodStamina = config("2 - Pink Mushroom", "Food Stamina", 25f, "how much stamina the food gives you"); configPinkFoodEitr = config("2 - Pink Mushroom", "Food Eitr", 10f, "how much eitr the food gives you"); configPinkFoodRegen = config("2 - Pink Mushroom", "Food Regen", 2f, "how much hp is regen per tick for this food"); configBloodEnable = config("3 - Blood Mushroom", "Enabled", value: true, "Globally enable/disable blood mushroom"); configBloodBiome = config<Biome>("3 - Blood Mushroom", "Vegetation Biome", (Biome)2, "Mushroom will spawn in this biome. Specific biome, all, or none to disable vegetation"); configBloodGroupSizeMin = config("3 - Blood Mushroom", "Vegetation Group Size Min", 2, "minimum number of mushrooms to spawn in a group, 1-6"); configBloodGroupSizeMax = config("3 - Blood Mushroom", "Vegetation Group Size", 4, "maximum number of mushrooms to spawn in a group, 1-6"); configBloodSpawnChance = config("3 - Blood Mushroom", "Vegetation Spawn Chance", 0.2f, "the chance the mushrooms vegetation object(s) will be placed in a zone, 0.03 - 1.0, so .01 = 1%, .5 - 50%"); configBloodFoodTime = config("3 - Blood Mushroom", "Food Time", 1200f, "how long the food lasts in seconds"); configBloodFoodHp = config("3 - Blood Mushroom", "Food Hp", 45f, "how much hp the food gives you"); configBloodFoodStamina = config("3 - Blood Mushroom", "Food Stamina", 12f, "how much stamina the food gives you"); configBloodFoodEitr = config("3 - Blood Mushroom", "Food Eitr", 0f, "how much eitr the food gives you"); configBloodFoodRegen = config("3 - Blood Mushroom", "Food Regen", 6f, "how much hp is regen per tick for this food"); configGreenEnable = config("4 - Green Mushroom", "Enabled", value: true, "Globally enable/disable green mushroom"); configGreenBiome = config<Biome>("4 - Green Mushroom", "Vegetation Biome", (Biome)2, "Mushroom will spawn in this biome. Specific biome, all, or none to disable vegetation"); configGreenGroupSizeMin = config("4 - Green Mushroom", "Vegetation Group Size Min", 2, "minimum number of mushrooms to spawn in a group, 1-6"); configGreenGroupSizeMax = config("4 - Green Mushroom", "Vegetation Group Size", 4, "maximum number of mushrooms to spawn in a group, 1-6"); configGreenSpawnChance = config("4 - Green Mushroom", "Vegetation Spawn Chance", 0.2f, "the chance the mushrooms vegetation object(s) will be placed in a zone, 0.04 - 1.0, so .01 = 1%, .5 - 50%"); configGreenFoodTime = config("4 - Green Mushroom", "Food Time", 1200f, "how long the food lasts in seconds"); configGreenFoodHp = config("4 - Green Mushroom", "Food Hp", 25f, "how much hp the food gives you"); configGreenFoodStamina = config("4 - Green Mushroom", "Food Stamina", 25f, "how much stamina the food gives you"); configGreenFoodEitr = config("4 - Green Mushroom", "Food Eitr", 10f, "how much eitr the food gives you"); configGreenFoodRegen = config("4 - Green Mushroom", "Food Regen", 2f, "how much hp is regen per tick for this food"); configBlueEnable = config("5 - Blue Mushroom", "Enabled", value: true, "Globally enable/disable Blue mushroom"); configBlueBiome = config<Biome>("5 - Blue Mushroom", "Vegetation Biome", (Biome)4, "Mushroom will spawn in this biome. Specific biome, all, or none to disable vegetation"); configBlueGroupSizeMin = config("5 - Blue Mushroom", "Vegetation Group Size Min", 2, "minimum number of mushrooms to spawn in a group, 1-6"); configBlueGroupSizeMax = config("5 - Blue Mushroom", "Vegetation Group Size", 4, "maximum number of mushrooms to spawn in a group, 1-6"); configBlueSpawnChance = config("5 - Blue Mushroom", "Vegetation Spawn Chance", 0.2f, "the chance the mushrooms vegetation object(s) will be placed in a zone, 0.05 - 1.0, so .01 = 1%, .5 - 50%"); configBlueFoodTime = config("5 - Blue Mushroom", "Food Time", 1800f, "how long the food lasts in seconds"); configBlueFoodHp = config("5 - Blue Mushroom", "Food Hp", 25f, "how much hp the food gives you"); configBlueFoodStamina = config("5 - Blue Mushroom", "Food Stamina", 25f, "how much stamina the food gives you"); configBlueFoodEitr = config("5 - Blue Mushroom", "Food Eitr", 20f, "how much eitr the food gives you"); configBlueFoodRegen = config("5 - Blue Mushroom", "Food Regen", 2f, "how much hp is regen per tick for this food"); configPurpleEnable = config("6 - Purple Mushroom", "Enabled", value: true, "Globally enable/disable purple mushroom"); configPurpleBiome = config<Biome>("6 - Purple Mushroom", "Vegetation Biome", (Biome)4, "Mushroom will spawn in this biome. Specific biome, all, or none to disable vegetation"); configPurpleGroupSizeMin = config("6 - Purple Mushroom", "Vegetation Group Size Min", 5, "minimum number of mushrooms to spawn in a group, 1-6"); configPurpleGroupSizeMax = config("6 - Purple Mushroom", "Vegetation Group Size", 8, "maximum number of mushrooms to spawn in a group, 1-6"); configPurpleSpawnChance = config("6 - Purple Mushroom", "Vegetation Spawn Chance", 0.1f, "the chance the mushrooms vegetation object(s) will be placed in a zone, 0.06 - 1.0, so .01 = 1%, .6 - 50%"); configPurpleFoodTime = config("6 - Purple Mushroom", "Food Time", 1800f, "how long the food lasts in seconds"); configPurpleFoodHp = config("6 - Purple Mushroom", "Food Hp", 25f, "how much hp the food gives you"); configPurpleFoodStamina = config("6 - Purple Mushroom", "Food Stamina", 25f, "how much stamina the food gives you"); configPurpleFoodEitr = config("6 - Purple Mushroom", "Food Eitr", 20f, "how much eitr the food gives you"); configPurpleFoodRegen = config("6 - Purple Mushroom", "Food Regen", 2f, "how much hp is regen per tick for this food"); configRainbowEnable = config("7 - Rainbow Mushroom", "Enabled", value: true, "Globally enable/disable rainbow mushroom"); configRainbowBiome = config<Biome>("7 - Rainbow Mushroom", "Vegetation Biome", (Biome)0, "Mushroom will spawn in this biome. Specific biome, all, or none to disable vegetation"); configRainbowGroupSizeMin = config("7 - Rainbow Mushroom", "Vegetation Group Size Min", 2, "minimum number of mushrooms to spawn in a group, 1-6"); configRainbowGroupSizeMax = config("7 - Rainbow Mushroom", "Vegetation Group Size", 4, "maximum number of mushrooms to spawn in a group, 1-6"); configRainbowSpawnChance = config("7 - Rainbow Mushroom", "Vegetation Spawn Chance", 0.1f, "the chance the mushrooms vegetation object(s) will be placed in a zone, 0.07 - 1.0, so .01 = 1%, .7 - 50%"); configRainbowFoodTime = config("7 - Rainbow Mushroom", "Food Time", 3600f, "how long the food lasts in seconds"); configRainbowFoodHp = config("7 - Rainbow Mushroom", "Food Hp", 30f, "how much hp the food gives you"); configRainbowFoodStamina = config("7 - Rainbow Mushroom", "Food Stamina", 30f, "how much stamina the food gives you"); configRainbowFoodEitr = config("7 - Rainbow Mushroom", "Food Eitr", 30f, "how much eitr the food gives you"); configRainbowFoodRegen = config("7 - Rainbow Mushroom", "Food Regen", 6f, "how much hp is regen per tick for this food"); configRainbowRecipeStation = config("7 - Rainbow Mushroom", "Recipe Crafting Station", "piece_cauldron", "Crafting Station, set to asdf to disable crafting"); configRainbowRecipe1 = config("7 - Rainbow Mushroom", "Recipe Item 1", "MushroomBlack", "Crafting Item prefab name"); configRainbowRecipe1qty = config("7 - Rainbow Mushroom", "Recipe Item 1 Quantity", 1, "How many of item required?"); configRainbowRecipe2 = config("7 - Rainbow Mushroom", "Recipe Item 2", "MushroomBlue", "Crafting Item prefab name"); configRainbowRecipe2qty = config("7 - Rainbow Mushroom", "Recipe Item 2 Quantity", 1, "How many of item required?"); configRainbowRecipe3 = config("7 - Rainbow Mushroom", "Recipe Item 3", "MushroomGreen", "Crafting Item prefab name"); configRainbowRecipe3qty = config("7 - Rainbow Mushroom", "Recipe Item 3 Quantity", 1, "How many of item required?"); configRainbowRecipe4 = config("7 - Rainbow Mushroom", "Recipe Item 4", "Mushroom", "Crafting Item prefab name"); configRainbowRecipe4qty = config("7 - Rainbow Mushroom", "Recipe Item 4 Quantity", 1, "How many of item required?"); configLavaEnable = config("8 - Lava Mushroom", "Enabled", value: true, "Globally enable/disable purple mushroom"); configLavaBiome = config<Biome>("8 - Lava Mushroom", "Vegetation Biome", (Biome)32, "Mushroom will spawn in this biome. Specific biome, all, or none to disable vegetation"); configLavaGroupSizeMin = config("8 - Lava Mushroom", "Vegetation Group Size Min", 5, "minimum number of mushrooms to spawn in a group, 1-6"); configLavaGroupSizeMax = config("8 - Lava Mushroom", "Vegetation Group Size", 8, "maximum number of mushrooms to spawn in a group, 1-6"); configLavaSpawnChance = config("8 - Lava Mushroom", "Vegetation Spawn Chance", 0.1f, "the chance the mushrooms vegetation object(s) will be placed in a zone, 0.08 - 1.0, so .01 = 1%, .8 - 50%"); configLavaFoodTime = config("8 - Lava Mushroom", "Food Time", 1800f, "how long the food lasts in seconds"); configLavaFoodHp = config("8 - Lava Mushroom", "Food Hp", 25f, "how much hp the food gives you"); configLavaFoodStamina = config("8 - Lava Mushroom", "Food Stamina", 25f, "how much stamina the food gives you"); configLavaFoodEitr = config("8 - Lava Mushroom", "Food Eitr", 20f, "how much eitr the food gives you"); configLavaFoodRegen = config("8 - Lava Mushroom", "Food Regen", 2f, "how much hp is regen per tick for this food"); configWhiteEnable = config("9 - White Mushroom", "Enabled", value: true, "Globally enable/disable purple mushroom"); configWhiteBiome = config<Biome>("9 - White Mushroom", "Vegetation Biome", (Biome)64, "Mushroom will spawn in this biome. Specific biome, all, or none to disable vegetation"); configWhiteGroupSizeMin = config("9 - White Mushroom", "Vegetation Group Size Min", 5, "minimum number of mushrooms to spawn in a group, 1-6"); configWhiteGroupSizeMax = config("9 - White Mushroom", "Vegetation Group Size", 8, "maximum number of mushrooms to spawn in a group, 1-6"); configWhiteSpawnChance = config("9 - White Mushroom", "Vegetation Spawn Chance", 0.1f, "the chance the mushrooms vegetation object(s) will be placed in a zone, 0.09 - 1.0, so .01 = 1%, .9 - 50%"); configWhiteFoodTime = config("9 - White Mushroom", "Food Time", 1800f, "how long the food lasts in seconds"); configWhiteFoodHp = config("9 - White Mushroom", "Food Hp", 25f, "how much hp the food gives you"); configWhiteFoodStamina = config("9 - White Mushroom", "Food Stamina", 25f, "how much stamina the food gives you"); configWhiteFoodEitr = config("9 - White Mushroom", "Food Eitr", 20f, "how much eitr the food gives you"); configWhiteFoodRegen = config("9 - White Mushroom", "Food Regen", 2f, "how much hp is regen per tick for this food"); configSync.AddLockingConfigEntry<bool>(configLocked); ((BaseUnityPlugin)this).Logger.LogInfo((object)"shrooms= created by $1010101110 = $1.5.0 = Awake"); harmony.PatchAll(); PrefabManager.OnVanillaPrefabsAvailable += AddShrooms; } private void OnDestroy() { harmony.UnpatchSelf(); } private void AddShrooms() { //IL_091e: Unknown result type (might be due to invalid IL or missing references) //IL_0923: Unknown result type (might be due to invalid IL or missing references) //IL_0929: Unknown result type (might be due to invalid IL or missing references) //IL_0934: Unknown result type (might be due to invalid IL or missing references) //IL_0945: Unknown result type (might be due to invalid IL or missing references) //IL_094d: Unknown result type (might be due to invalid IL or missing references) //IL_095e: Unknown result type (might be due to invalid IL or missing references) //IL_096f: Unknown result type (might be due to invalid IL or missing references) //IL_097b: Unknown result type (might be due to invalid IL or missing references) //IL_098c: Expected O, but got Unknown //IL_0987: Unknown result type (might be due to invalid IL or missing references) //IL_0991: Expected O, but got Unknown //IL_02f0: Unknown result type (might be due to invalid IL or missing references) //IL_02f5: Unknown result type (might be due to invalid IL or missing references) //IL_0301: Unknown result type (might be due to invalid IL or missing references) //IL_030d: Unknown result type (might be due to invalid IL or missing references) //IL_031a: Expected O, but got Unknown //IL_0315: Unknown result type (might be due to invalid IL or missing references) //IL_031c: Expected O, but got Unknown //IL_03d1: Unknown result type (might be due to invalid IL or missing references) //IL_03d6: Unknown result type (might be due to invalid IL or missing references) //IL_03dc: Unknown result type (might be due to invalid IL or missing references) //IL_03e7: Unknown result type (might be due to invalid IL or missing references) //IL_03f8: Unknown result type (might be due to invalid IL or missing references) //IL_0400: Unknown result type (might be due to invalid IL or missing references) //IL_0411: Unknown result type (might be due to invalid IL or missing references) //IL_0422: Unknown result type (might be due to invalid IL or missing references) //IL_042e: Unknown result type (might be due to invalid IL or missing references) //IL_043f: Expected O, but got Unknown //IL_043a: Unknown result type (might be due to invalid IL or missing references) //IL_0444: Expected O, but got Unknown //IL_04e5: Unknown result type (might be due to invalid IL or missing references) //IL_04ea: Unknown result type (might be due to invalid IL or missing references) //IL_04f6: Unknown result type (might be due to invalid IL or missing references) //IL_0502: Unknown result type (might be due to invalid IL or missing references) //IL_050f: Expected O, but got Unknown //IL_050a: Unknown result type (might be due to invalid IL or missing references) //IL_0511: Expected O, but got Unknown //IL_05c6: Unknown result type (might be due to invalid IL or missing references) //IL_05cb: Unknown result type (might be due to invalid IL or missing references) //IL_05d1: Unknown result type (might be due to invalid IL or missing references) //IL_05dc: Unknown result type (might be due to invalid IL or missing references) //IL_05ed: Unknown result type (might be due to invalid IL or missing references) //IL_05f5: Unknown result type (might be due to invalid IL or missing references) //IL_0606: Unknown result type (might be due to invalid IL or missing references) //IL_0617: Unknown result type (might be due to invalid IL or missing references) //IL_0623: Unknown result type (might be due to invalid IL or missing references) //IL_062f: Unknown result type (might be due to invalid IL or missing references) //IL_0640: Expected O, but got Unknown //IL_063b: Unknown result type (might be due to invalid IL or missing references) //IL_0645: Expected O, but got Unknown //IL_06d3: Unknown result type (might be due to invalid IL or missing references) //IL_06d8: Unknown result type (might be due to invalid IL or missing references) //IL_06e4: Unknown result type (might be due to invalid IL or missing references) //IL_06f0: Unknown result type (might be due to invalid IL or missing references) //IL_06fd: Expected O, but got Unknown //IL_06f8: Unknown result type (might be due to invalid IL or missing references) //IL_06ff: Expected O, but got Unknown //IL_07b4: Unknown result type (might be due to invalid IL or missing references) //IL_07b9: Unknown result type (might be due to invalid IL or missing references) //IL_07bf: Unknown result type (might be due to invalid IL or missing references) //IL_07ca: Unknown result type (might be due to invalid IL or missing references) //IL_07db: Unknown result type (might be due to invalid IL or missing references) //IL_07e3: Unknown result type (might be due to invalid IL or missing references) //IL_07f4: Unknown result type (might be due to invalid IL or missing references) //IL_0805: Unknown result type (might be due to invalid IL or missing references) //IL_0811: Unknown result type (might be due to invalid IL or missing references) //IL_0822: Expected O, but got Unknown //IL_081d: Unknown result type (might be due to invalid IL or missing references) //IL_0827: Expected O, but got Unknown //IL_0a1f: Unknown result type (might be due to invalid IL or missing references) //IL_0a24: Unknown result type (might be due to invalid IL or missing references) //IL_0a30: Unknown result type (might be due to invalid IL or missing references) //IL_0a3c: Unknown result type (might be due to invalid IL or missing references) //IL_0a49: Expected O, but got Unknown //IL_0a44: Unknown result type (might be due to invalid IL or missing references) //IL_0a4b: Expected O, but got Unknown //IL_0b00: Unknown result type (might be due to invalid IL or missing references) //IL_0b05: Unknown result type (might be due to invalid IL or missing references) //IL_0b0b: Unknown result type (might be due to invalid IL or missing references) //IL_0b16: Unknown result type (might be due to invalid IL or missing references) //IL_0b27: Unknown result type (might be due to invalid IL or missing references) //IL_0b2f: Unknown result type (might be due to invalid IL or missing references) //IL_0b40: Unknown result type (might be due to invalid IL or missing references) //IL_0b51: Unknown result type (might be due to invalid IL or missing references) //IL_0b5d: Unknown result type (might be due to invalid IL or missing references) //IL_0b6e: Expected O, but got Unknown //IL_0b69: Unknown result type (might be due to invalid IL or missing references) //IL_0b73: Expected O, but got Unknown //IL_0c01: Unknown result type (might be due to invalid IL or missing references) //IL_0c08: Expected O, but got Unknown //IL_0c50: Unknown result type (might be due to invalid IL or missing references) //IL_0c55: Unknown result type (might be due to invalid IL or missing references) //IL_0c66: Unknown result type (might be due to invalid IL or missing references) //IL_0c78: Expected O, but got Unknown //IL_0c7a: Unknown result type (might be due to invalid IL or missing references) //IL_0c7f: Unknown result type (might be due to invalid IL or missing references) //IL_0c90: Unknown result type (might be due to invalid IL or missing references) //IL_0ca2: Expected O, but got Unknown //IL_0ca4: Unknown result type (might be due to invalid IL or missing references) //IL_0ca9: Unknown result type (might be due to invalid IL or missing references) //IL_0cba: Unknown result type (might be due to invalid IL or missing references) //IL_0ccc: Expected O, but got Unknown //IL_0cce: Unknown result type (might be due to invalid IL or missing references) //IL_0cd3: Unknown result type (might be due to invalid IL or missing references) //IL_0ce4: Unknown result type (might be due to invalid IL or missing references) //IL_0cf6: Expected O, but got Unknown //IL_0cfe: Unknown result type (might be due to invalid IL or missing references) //IL_0d05: Expected O, but got Unknown //IL_0dba: Unknown result type (might be due to invalid IL or missing references) //IL_0dbf: Unknown result type (might be due to invalid IL or missing references) //IL_0dc5: Unknown result type (might be due to invalid IL or missing references) //IL_0dd0: Unknown result type (might be due to invalid IL or missing references) //IL_0de1: Unknown result type (might be due to invalid IL or missing references) //IL_0de9: Unknown result type (might be due to invalid IL or missing references) //IL_0dfa: Unknown result type (might be due to invalid IL or missing references) //IL_0e0b: Unknown result type (might be due to invalid IL or missing references) //IL_0e17: Unknown result type (might be due to invalid IL or missing references) //IL_0e28: Expected O, but got Unknown //IL_0e23: Unknown result type (might be due to invalid IL or missing references) //IL_0e2d: Expected O, but got Unknown //IL_0ebb: Unknown result type (might be due to invalid IL or missing references) //IL_0ec0: Unknown result type (might be due to invalid IL or missing references) //IL_0ecc: Unknown result type (might be due to invalid IL or missing references) //IL_0ed8: Unknown result type (might be due to invalid IL or missing references) //IL_0ee5: Expected O, but got Unknown //IL_0ee0: Unknown result type (might be due to invalid IL or missing references) //IL_0ee7: Expected O, but got Unknown //IL_0f9c: Unknown result type (might be due to invalid IL or missing references) //IL_0fa1: Unknown result type (might be due to invalid IL or missing references) //IL_0fa7: Unknown result type (might be due to invalid IL or missing references) //IL_0fb2: Unknown result type (might be due to invalid IL or missing references) //IL_0fc3: Unknown result type (might be due to invalid IL or missing references) //IL_0fcb: Unknown result type (might be due to invalid IL or missing references) //IL_0fdc: Unknown result type (might be due to invalid IL or missing references) //IL_0fed: Unknown result type (might be due to invalid IL or missing references) //IL_0ff9: Unknown result type (might be due to invalid IL or missing references) //IL_1005: Unknown result type (might be due to invalid IL or missing references) //IL_1016: Expected O, but got Unknown //IL_1011: Unknown result type (might be due to invalid IL or missing references) //IL_101b: Expected O, but got Unknown //IL_10a9: Unknown result type (might be due to invalid IL or missing references) //IL_10ae: Unknown result type (might be due to invalid IL or missing references) //IL_10ba: Unknown result type (might be due to invalid IL or missing references) //IL_10c6: Unknown result type (might be due to invalid IL or missing references) //IL_10d3: Expected O, but got Unknown //IL_10ce: Unknown result type (might be due to invalid IL or missing references) //IL_10d5: Expected O, but got Unknown //IL_118a: Unknown result type (might be due to invalid IL or missing references) //IL_118f: Unknown result type (might be due to invalid IL or missing references) //IL_1195: Unknown result type (might be due to invalid IL or missing references) //IL_11a0: Unknown result type (might be due to invalid IL or missing references) //IL_11b1: Unknown result type (might be due to invalid IL or missing references) //IL_11b9: Unknown result type (might be due to invalid IL or missing references) //IL_11ca: Unknown result type (might be due to invalid IL or missing references) //IL_11db: Unknown result type (might be due to invalid IL or missing references) //IL_11e7: Unknown result type (might be due to invalid IL or missing references) //IL_11f8: Expected O, but got Unknown //IL_11f3: Unknown result type (might be due to invalid IL or missing references) //IL_11fd: Expected O, but got Unknown //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0113: 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) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Expected O, but got Unknown //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Expected O, but got Unknown //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: 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_0205: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Expected O, but got Unknown //IL_0258: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Expected O, but got Unknown AssetBundle val = null; try { val = AssetUtils.LoadAssetBundleFromResources("tripping.shroom", typeof(Mod).Assembly); if ((Object)(object)val == (Object)null) { throw new Exception("shroombundle is null"); } } catch (Exception ex) { ((BaseUnityPlugin)this).Logger.LogError((object)("failed loading asset bundles " + ex.Message)); string[] manifestResourceNames = typeof(Mod).Assembly.GetManifestResourceNames(); string[] array = manifestResourceNames; foreach (string text in array) { ((BaseUnityPlugin)this).Logger.LogInfo((object)("Found embedded resource: " + text)); } return; } if (configBlackEnable.Value) { try { GameObject val2 = val.LoadAsset<GameObject>("MushroomBlack"); if ((Object)(object)val2 == (Object)null) { throw new Exception("goMushroom is null"); } GameObject val3 = val.LoadAsset<GameObject>("Pickable_Mushroom_black"); if ((Object)(object)val3 == (Object)null) { throw new Exception("goPickable is null"); } CustomItem val4 = new CustomItem(val2, false, new ItemConfig { Name = "MushroomBlack", Description = "This mushroom seems ominous but energizing", Enabled = false }); val4.ItemDrop.m_itemData.m_shared.m_food = configBlackFoodHp.Value; val4.ItemDrop.m_itemData.m_shared.m_foodStamina = configBlackFoodStamina.Value; val4.ItemDrop.m_itemData.m_shared.m_foodEitr = configBlackFoodEitr.Value; val4.ItemDrop.m_itemData.m_shared.m_foodRegen = configBlackFoodRegen.Value; val4.ItemDrop.m_itemData.m_shared.m_foodBurnTime = configBlackFoodTime.Value; ItemManager.Instance.AddItem(val4); ZoneManager.Instance.AddCustomVegetation(new CustomVegetation(val3, false, new VegetationConfig { Biome = configBlackBiome.Value, Max = configBlackSpawnChance.Value, BlockCheck = true, GroupSizeMin = configBlackGroupSizeMin.Value, GroupSizeMax = configBlackGroupSizeMax.Value, GroupRadius = 4f, MinAltitude = 1f })); } catch (Exception ex2) { ((BaseUnityPlugin)this).Logger.LogError((object)("shrooms= Error initializing Black Mushroom " + ex2.Message)); } } if (configPinkEnable.Value) { try { GameObject val5 = val.LoadAsset<GameObject>("MushroomPink"); if ((Object)(object)val5 == (Object)null) { throw new Exception("goMushroom is null"); } GameObject val6 = val.LoadAsset<GameObject>("Pickable_Mushroom_pink"); if ((Object)(object)val6 == (Object)null) { throw new Exception("goPickable is null"); } CustomItem val7 = new CustomItem(val5, false, new ItemConfig { Name = "MushroomPink", Description = "Mushroom with sparkles of fae, helps you find things", Enabled = false }); val7.ItemDrop.m_itemData.m_shared.m_food = configPinkFoodHp.Value; val7.ItemDrop.m_itemData.m_shared.m_foodStamina = configPinkFoodStamina.Value; val7.ItemDrop.m_itemData.m_shared.m_foodEitr = configPinkFoodEitr.Value; val7.ItemDrop.m_itemData.m_shared.m_foodRegen = configPinkFoodRegen.Value; val7.ItemDrop.m_itemData.m_shared.m_foodBurnTime = configPinkFoodTime.Value; ItemManager.Instance.AddItem(val7); ZoneManager.Instance.AddCustomVegetation(new CustomVegetation(val6, false, new VegetationConfig { Biome = configPinkBiome.Value, Max = configPinkSpawnChance.Value, BlockCheck = true, GroupSizeMin = configPinkGroupSizeMin.Value, GroupSizeMax = configPinkGroupSizeMax.Value, GroupRadius = 4f, MinAltitude = 1f })); } catch (Exception ex3) { ((BaseUnityPlugin)this).Logger.LogError((object)("shrooms= Error initializing Pink Mushroom " + ex3.Message)); ((BaseUnityPlugin)this).Logger.LogError((object)ex3.StackTrace); } } if (configBloodEnable.Value) { try { GameObject val8 = val.LoadAsset<GameObject>("MushroomBlood"); if ((Object)(object)val8 == (Object)null) { throw new Exception("goMushroom is null"); } GameObject val9 = val.LoadAsset<GameObject>("Pickable_Mushroom_blood"); if ((Object)(object)val9 == (Object)null) { throw new Exception("goPickable is null"); } CustomItem val10 = new CustomItem(val8, false, new ItemConfig { Name = "MushroomBlood", Description = "Mushroom saturaed with blood", Enabled = false }); val10.ItemDrop.m_itemData.m_shared.m_food = configBloodFoodHp.Value; val10.ItemDrop.m_itemData.m_shared.m_foodStamina = configBloodFoodStamina.Value; val10.ItemDrop.m_itemData.m_shared.m_foodEitr = configBloodFoodEitr.Value; val10.ItemDrop.m_itemData.m_shared.m_foodRegen = configBloodFoodRegen.Value; val10.ItemDrop.m_itemData.m_shared.m_foodBurnTime = configBloodFoodTime.Value; ItemManager.Instance.AddItem(val10); ZoneManager.Instance.AddCustomVegetation(new CustomVegetation(val9, false, new VegetationConfig { Biome = configBloodBiome.Value, Max = configBloodSpawnChance.Value, BlockCheck = true, GroupSizeMin = configBloodGroupSizeMin.Value, GroupSizeMax = configBloodGroupSizeMax.Value, GroupRadius = 4f, MinAltitude = 0.1f, MaxAltitude = 0.6f })); } catch (Exception ex4) { ((BaseUnityPlugin)this).Logger.LogError((object)("shrooms= Error initializing Blood Mushroom $" + ex4.Message)); } } if (configGreenEnable.Value) { try { GameObject val11 = val.LoadAsset<GameObject>("MushroomGreen"); if ((Object)(object)val11 == (Object)null) { throw new Exception("goMushroom is null"); } GameObject val12 = val.LoadAsset<GameObject>("Pickable_Mushroom_green"); if ((Object)(object)val12 == (Object)null) { throw new Exception("goPickable is null"); } CustomItem val13 = new CustomItem(val11, false, new ItemConfig { Name = "MushroomGreen", Description = "Mushroom is kinda stinky and has a ringing sound", Enabled = false }); val13.ItemDrop.m_itemData.m_shared.m_food = configGreenFoodHp.Value; val13.ItemDrop.m_itemData.m_shared.m_foodStamina = configGreenFoodStamina.Value; val13.ItemDrop.m_itemData.m_shared.m_foodEitr = configGreenFoodEitr.Value; val13.ItemDrop.m_itemData.m_shared.m_foodRegen = configGreenFoodRegen.Value; val13.ItemDrop.m_itemData.m_shared.m_foodBurnTime = configGreenFoodTime.Value; ItemManager.Instance.AddItem(val13); ZoneManager.Instance.AddCustomVegetation(new CustomVegetation(val12, false, new VegetationConfig { Biome = configGreenBiome.Value, Max = configGreenSpawnChance.Value, BlockCheck = true, GroupSizeMin = configGreenGroupSizeMin.Value, GroupSizeMax = configGreenGroupSizeMax.Value, GroupRadius = 4f, MinAltitude = 0.5f })); } catch (Exception ex5) { ((BaseUnityPlugin)this).Logger.LogError((object)("shrooms= Error initializing Green Mushroom $" + ex5.Message)); } } if (configBlueEnable.Value) { try { GameObject prefab = PrefabManager.Instance.GetPrefab("MushroomBlue"); ItemDrop component = prefab.GetComponent<ItemDrop>(); component.m_itemData.m_shared.m_food = configBlueFoodHp.Value; component.m_itemData.m_shared.m_foodStamina = configBlueFoodStamina.Value; component.m_itemData.m_shared.m_foodEitr = configBlueFoodEitr.Value; component.m_itemData.m_shared.m_foodRegen = configBlueFoodRegen.Value; component.m_itemData.m_shared.m_foodBurnTime = configBlueFoodTime.Value; GameObject prefab2 = PrefabManager.Instance.GetPrefab("Pickable_Mushroom_blue"); ZoneManager.Instance.AddCustomVegetation(new CustomVegetation(prefab2, false, new VegetationConfig { Biome = configBlueBiome.Value, Max = configBlueSpawnChance.Value, BlockCheck = true, GroupSizeMin = configBlueGroupSizeMin.Value, GroupSizeMax = configBlueGroupSizeMax.Value, GroupRadius = 4f, MinAltitude = 1f })); } catch (Exception ex6) { ((BaseUnityPlugin)this).Logger.LogError((object)("shrooms= Error initializing Blue Mushroom " + ex6.Message)); } } if (configPurpleEnable.Value) { try { GameObject val14 = val.LoadAsset<GameObject>("MushroomPurple"); if ((Object)(object)val14 == (Object)null) { throw new Exception("goMushroom is null"); } GameObject val15 = val.LoadAsset<GameObject>("Pickable_Mushroom_purple"); if ((Object)(object)val15 == (Object)null) { throw new Exception("goPickable is null"); } CustomItem val16 = new CustomItem(val14, false, new ItemConfig { Name = "MushroomPurple", Description = "It's kinda cute but mysterious", Enabled = false }); val16.ItemDrop.m_itemData.m_shared.m_food = configPurpleFoodHp.Value; val16.ItemDrop.m_itemData.m_shared.m_foodStamina = configPurpleFoodStamina.Value; val16.ItemDrop.m_itemData.m_shared.m_foodEitr = configPurpleFoodEitr.Value; val16.ItemDrop.m_itemData.m_shared.m_foodRegen = configPurpleFoodRegen.Value; val16.ItemDrop.m_itemData.m_shared.m_foodBurnTime = configPurpleFoodTime.Value; ItemManager.Instance.AddItem(val16); ZoneManager.Instance.AddCustomVegetation(new CustomVegetation(val15, false, new VegetationConfig { Biome = configPurpleBiome.Value, Max = configPurpleSpawnChance.Value, BlockCheck = true, GroupSizeMin = configPurpleGroupSizeMin.Value, GroupSizeMax = configPurpleGroupSizeMax.Value, GroupRadius = 6f, MinAltitude = 1f })); } catch (Exception ex7) { ((BaseUnityPlugin)this).Logger.LogError((object)("shrooms= Error initializing Purple Mushroom " + ex7.Message)); } } if (configRainbowEnable.Value) { try { GameObject val17 = val.LoadAsset<GameObject>("MushroomRainbow"); if ((Object)(object)val17 == (Object)null) { throw new Exception("goMushroom is null"); } GameObject val18 = val.LoadAsset<GameObject>("Pickable_Mushroom_rainbow"); if ((Object)(object)val18 == (Object)null) { throw new Exception("goPickable is null"); } ItemConfig val19 = new ItemConfig(); val19.Enabled = true; val19.Name = "MushroomRainbow"; val19.Description = "Wow this mushroom is so flamboyant and tasty!"; val19.CraftingStation = configRainbowRecipeStation.Value; val19.Amount = 2; val19.Requirements = (RequirementConfig[])(object)new RequirementConfig[4] { new RequirementConfig { Item = configRainbowRecipe1.Value, Amount = configRainbowRecipe1qty.Value }, new RequirementConfig { Item = configRainbowRecipe2.Value, Amount = configRainbowRecipe2qty.Value }, new RequirementConfig { Item = configRainbowRecipe3.Value, Amount = configRainbowRecipe3qty.Value }, new RequirementConfig { Item = configRainbowRecipe4.Value, Amount = configRainbowRecipe4qty.Value } }; CustomItem val20 = new CustomItem(val17, false, val19); val20.ItemDrop.m_itemData.m_shared.m_food = configRainbowFoodHp.Value; val20.ItemDrop.m_itemData.m_shared.m_foodStamina = configRainbowFoodStamina.Value; val20.ItemDrop.m_itemData.m_shared.m_foodEitr = configRainbowFoodEitr.Value; val20.ItemDrop.m_itemData.m_shared.m_foodRegen = configRainbowFoodRegen.Value; val20.ItemDrop.m_itemData.m_shared.m_foodBurnTime = configRainbowFoodTime.Value; ItemManager.Instance.AddItem(val20); ZoneManager.Instance.AddCustomVegetation(new CustomVegetation(val18, false, new VegetationConfig { Biome = configRainbowBiome.Value, Max = configRainbowSpawnChance.Value, BlockCheck = true, GroupSizeMin = configRainbowGroupSizeMin.Value, GroupSizeMax = configRainbowGroupSizeMax.Value, GroupRadius = 4f, MinAltitude = 1f })); } catch (Exception ex8) { ((BaseUnityPlugin)this).Logger.LogError((object)("shrooms= Error initializing Rainbow Mushroom " + ex8.Message)); } } if (configLavaEnable.Value) { try { GameObject val21 = val.LoadAsset<GameObject>("MushroomLava"); if ((Object)(object)val21 == (Object)null) { throw new Exception("goMushroom is null"); } GameObject val22 = val.LoadAsset<GameObject>("Pickable_Mushroom_lava"); if ((Object)(object)val22 == (Object)null) { throw new Exception("goPickable is null"); } CustomItem val23 = new CustomItem(val21, false, new ItemConfig { Name = "MushroomLava", Description = "It BURNS, you feel hyper", Enabled = false }); val23.ItemDrop.m_itemData.m_shared.m_food = configLavaFoodHp.Value; val23.ItemDrop.m_itemData.m_shared.m_foodStamina = configLavaFoodStamina.Value; val23.ItemDrop.m_itemData.m_shared.m_foodEitr = configLavaFoodEitr.Value; val23.ItemDrop.m_itemData.m_shared.m_foodRegen = configLavaFoodRegen.Value; val23.ItemDrop.m_itemData.m_shared.m_foodBurnTime = configLavaFoodTime.Value; ItemManager.Instance.AddItem(val23); ZoneManager.Instance.AddCustomVegetation(new CustomVegetation(val22, false, new VegetationConfig { Biome = configLavaBiome.Value, Max = configLavaSpawnChance.Value, BlockCheck = true, GroupSizeMin = configLavaGroupSizeMin.Value, GroupSizeMax = configLavaGroupSizeMax.Value, GroupRadius = 6f, MinAltitude = 0.1f, MaxAltitude = 1f })); } catch (Exception ex9) { ((BaseUnityPlugin)this).Logger.LogError((object)("shrooms= Error initializing Lava Mushroom " + ex9.Message)); } } if (configWhiteEnable.Value) { try { GameObject val24 = val.LoadAsset<GameObject>("MushroomWhite"); if ((Object)(object)val24 == (Object)null) { throw new Exception("goMushroom is null"); } GameObject val25 = val.LoadAsset<GameObject>("Pickable_Mushroom_white"); if ((Object)(object)val25 == (Object)null) { throw new Exception("goPickable is null"); } CustomItem val26 = new CustomItem(val24, false, new ItemConfig { Name = "MushroomWhite", Description = "Slightly minty, you feel more magical", Enabled = false }); val26.ItemDrop.m_itemData.m_shared.m_food = configWhiteFoodHp.Value; val26.ItemDrop.m_itemData.m_shared.m_foodStamina = configWhiteFoodStamina.Value; val26.ItemDrop.m_itemData.m_shared.m_foodEitr = configWhiteFoodEitr.Value; val26.ItemDrop.m_itemData.m_shared.m_foodRegen = configWhiteFoodRegen.Value; val26.ItemDrop.m_itemData.m_shared.m_foodBurnTime = configWhiteFoodTime.Value; ItemManager.Instance.AddItem(val26); ZoneManager.Instance.AddCustomVegetation(new CustomVegetation(val25, false, new VegetationConfig { Biome = configWhiteBiome.Value, Max = configWhiteSpawnChance.Value, BlockCheck = true, GroupSizeMin = configWhiteGroupSizeMin.Value, GroupSizeMax = configWhiteGroupSizeMax.Value, GroupRadius = 6f, MinAltitude = 20f })); } catch (Exception ex10) { ((BaseUnityPlugin)this).Logger.LogError((object)("shrooms= Error initializing White Mushroom " + ex10.Message)); } } if ((Object)(object)vignetteImage == (Object)null) { CreateOverlay(); } } private void CreateOverlay() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0084: 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) GameObject val = new GameObject("ModBrightVignetteCanvas"); Object.DontDestroyOnLoad((Object)(object)val); Canvas val2 = val.AddComponent<Canvas>(); val2.renderMode = (RenderMode)0; val2.sortingOrder = 100; GameObject val3 = new GameObject("VignetteImage"); val3.transform.SetParent(val.transform, false); vignetteImage = val3.AddComponent<Image>(); ((Graphic)vignetteImage).raycastTarget = false; RectTransform component = ((Component)vignetteImage).GetComponent<RectTransform>(); component.anchorMin = Vector2.zero; component.anchorMax = Vector2.one; component.sizeDelta = Vector2.zero; vignetteImage.sprite = GenerateVignetteSprite(1080); ((Graphic)vignetteImage).color = Color.clear; } private Sprite GenerateVignetteSprite(int size) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_00c3: 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_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: 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_007c: Unknown result type (might be due to invalid IL or missing references) Texture2D val = new Texture2D(size, size, (TextureFormat)4, false); Color[] array = (Color[])(object)new Color[size * size]; float num = (float)size / 2f; Vector2 val2 = default(Vector2); ((Vector2)(ref val2))..ctor(num, num); for (int i = 0; i < size; i++) { for (int j = 0; j < size; j++) { float num2 = Vector2.Distance(new Vector2((float)j, (float)i), val2); float num3 = Mathf.Clamp01(num2 / num); float num4 = Mathf.Pow(num3, 2.5f); array[i * size + j] = new Color(1f, 1f, 1f, num4); } } val.SetPixels(array); val.Apply(); return Sprite.Create(val, new Rect(0f, 0f, (float)size, (float)size), new Vector2(0.5f, 0.5f)); } public static void SetVignette(Color? color, float intensity) { //IL_0028: 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) //IL_002d: 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) if ((Object)(object)vignetteImage != (Object)null) { Color color2 = ((!color.HasValue) ? ((Graphic)vignetteImage).color : color.Value); color2.a = Mathf.Clamp01(intensity); ((Graphic)vignetteImage).color = color2; } } } } namespace tripping.Patches { public class TrippingPatches { [HarmonyPatch(typeof(Player), "FixedUpdate")] private class playerposty { private static void Postfix(ref Player __instance) { //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Expected O, but got Unknown //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_0227: Unknown result type (might be due to invalid IL or missing references) //IL_022e: Expected O, but got Unknown //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_06a6: Unknown result type (might be due to invalid IL or missing references) //IL_06ab: Unknown result type (might be due to invalid IL or missing references) //IL_06fd: Unknown result type (might be due to invalid IL or missing references) //IL_0634: Unknown result type (might be due to invalid IL or missing references) //IL_0643: Unknown result type (might be due to invalid IL or missing references) //IL_0653: Unknown result type (might be due to invalid IL or missing references) //IL_0658: Unknown result type (might be due to invalid IL or missing references) //IL_0511: Unknown result type (might be due to invalid IL or missing references) //IL_0520: Unknown result type (might be due to invalid IL or missing references) //IL_052a: Unknown result type (might be due to invalid IL or missing references) //IL_052f: Unknown result type (might be due to invalid IL or missing references) //IL_0534: Unknown result type (might be due to invalid IL or missing references) //IL_0539: Unknown result type (might be due to invalid IL or missing references) //IL_053e: Unknown result type (might be due to invalid IL or missing references) //IL_0758: Unknown result type (might be due to invalid IL or missing references) //IL_075d: Unknown result type (might be due to invalid IL or missing references) //IL_07af: Unknown result type (might be due to invalid IL or missing references) //IL_081e: Unknown result type (might be due to invalid IL or missing references) //IL_0823: Unknown result type (might be due to invalid IL or missing references) //IL_0875: Unknown result type (might be due to invalid IL or missing references) //IL_08e4: Unknown result type (might be due to invalid IL or missing references) //IL_08e9: Unknown result type (might be due to invalid IL or missing references) //IL_093b: Unknown result type (might be due to invalid IL or missing references) //IL_09aa: Unknown result type (might be due to invalid IL or missing references) //IL_09af: Unknown result type (might be due to invalid IL or missing references) //IL_0a01: Unknown result type (might be due to invalid IL or missing references) //IL_0ab8: Unknown result type (might be due to invalid IL or missing references) if (!((Character)__instance).m_nview.IsValid() || !((Character)__instance).m_nview.IsOwner() || __instance.GetPlayerID() != Player.m_localPlayer.GetPlayerID()) { return; } StatusEffect statusEffect = ((Character)__instance).m_seman.GetStatusEffect(StringExtensionMethods.GetStableHashCode("se_alcohol")); bool flag = false; bool flag2 = false; bool flag3 = false; bool flag4 = false; bool flag5 = false; bool flag6 = false; bool flag7 = false; bool flag8 = false; foreach (Food food in Player.m_localPlayer.m_foods) { if (food.m_name == "MushroomBlue") { flag = true; } if (food.m_name == "MushroomBlack") { flag2 = true; blacktimer += Time.deltaTime; } if (food.m_name == "MushroomBlood") { flag3 = true; } if (food.m_name == "MushroomRainbow") { flag4 = true; } if (food.m_name == "MushroomPurple") { flag5 = true; } if (food.m_name == "MushroomGreen") { flag6 = true; } if (food.m_name == "MushroomLava") { flag8 = true; lavatimer += Time.deltaTime; } if (food.m_name == "MushroomWhite") { flag7 = true; } } if (flag2 && blacktimer > 1f) { HitData val = new HitData(); val.m_point = ((Character)__instance).GetCenterPoint(); val.m_damage.m_spirit = 1f; ((Character)__instance).ApplyDamage(val, true, false, (DamageModifier)0); blacktimer = 0f; } if (flag8 && lavatimer > 1f) { HitData val2 = new HitData(); val2.m_point = ((Character)__instance).GetCenterPoint(); val2.m_damage.m_fire = 1f; ((Character)__instance).ApplyDamage(val2, true, false, (DamageModifier)0); if (__instance.m_stamina < __instance.m_maxStamina) { Player obj = __instance; obj.m_stamina += 2f; } ((Character)__instance).m_nview.GetZDO().Set(ZDOVars.s_stamina, __instance.m_stamina); lavatimer = 0f; } if (flag7) { if (__instance.m_eitr < __instance.m_maxEitr) { Player obj2 = __instance; obj2.m_eitr += 2f; } ((Character)__instance).m_nview.GetZDO().Set(ZDOVars.s_eitr, __instance.m_eitr); } if (flag6 || (((Humanoid)Player.m_localPlayer).m_utilityItem != null && ((Humanoid)Player.m_localPlayer).m_utilityItem.m_shared.m_name.Contains("wishbone"))) { ((Character)Player.m_localPlayer).m_seman.AddStatusEffect(StringExtensionMethods.GetStableHashCode("Wishbone"), false, 0, 0f, (short)(-1)); } else { ((Character)Player.m_localPlayer).m_seman.RemoveStatusEffect(StringExtensionMethods.GetStableHashCode("Wishbone"), false); } if (flag5 && Time.frameCount % 200 == 0) { int num = Random.Range(1, 120); GameObject val3 = null; switch (num) { case 100: val3 = PrefabManager.Instance.GetPrefab("sfx_ghost_alert"); break; case 99: val3 = PrefabManager.Instance.GetPrefab("sfx_haldor_laugh"); break; case 98: val3 = PrefabManager.Instance.GetPrefab("sfx_land_water"); break; case 97: val3 = PrefabManager.Instance.GetPrefab("sfx_offering"); break; case 96: val3 = PrefabManager.Instance.GetPrefab("sfx_secretfound"); break; case 95: val3 = PrefabManager.Instance.GetPrefab("sfx_tree_fall"); break; case 94: val3 = PrefabManager.Instance.GetPrefab("sfx_wraith_idle"); break; case 93: val3 = PrefabManager.Instance.GetPrefab("sfx_coins_pile_destroyed"); break; case 92: val3 = PrefabManager.Instance.GetPrefab("sfx_eikthyr_idle"); break; case 91: val3 = PrefabManager.Instance.GetPrefab("sfx_gui_craftitem_cauldron"); break; case 90: val3 = PrefabManager.Instance.GetPrefab("sfx_lootspawn"); break; case 89: ((Humanoid)Player.m_localPlayer).UnequipAllItems(); break; } if (Object.op_Implicit((Object)(object)val3)) { ZLog.LogError((object)("purple sound " + ((Object)val3).name)); Object.Instantiate<GameObject>(val3, ((Component)Player.m_localPlayer).transform.position + ((Component)Player.m_localPlayer).transform.forward * 2f + Vector3.up, Quaternion.identity); } } PostProcessingBehaviour postProcessing = CameraEffects.instance.m_postProcessing; if (!((Object)(object)postProcessing != (Object)null)) { return; } if (flag4) { ((PostProcessingModel)((PostProcessingComponent<VignetteModel>)(object)postProcessing.m_Vignette).model).m_Enabled = true; ((PostProcessingComponent<VignetteModel>)(object)postProcessing.m_Vignette).model.m_Settings.intensity = Mathf.Min(2f, ((PostProcessingComponent<VignetteModel>)(object)postProcessing.m_Vignette).model.m_Settings.intensity + 0.01f); rainbowtimer += Time.deltaTime; if (rainbowtimer > rainbowchangeevery) { rainbowcurrent = (rainbowcurrent + 1) % rainbowcolors.Length; rainbownext = (rainbowcurrent + 1) % rainbowcolors.Length; rainbowtimer = 0f; } ((PostProcessingComponent<VignetteModel>)(object)postProcessing.m_Vignette).model.m_Settings.color = Color.Lerp(rainbowcolors[rainbowcurrent], rainbowcolors[rainbownext], rainbowtimer / rainbowchangeevery); } else if (flag8) { ((PostProcessingModel)((PostProcessingComponent<VignetteModel>)(object)postProcessing.m_Vignette).model).m_Enabled = false; ((PostProcessingComponent<VignetteModel>)(object)postProcessing.m_Vignette).model.m_Settings.color = new Color(1f, 0.6470588f, 0f, 1f); ((PostProcessingComponent<VignetteModel>)(object)postProcessing.m_Vignette).model.m_Settings.intensity = Mathf.Min(0.3f, ((PostProcessingComponent<VignetteModel>)(object)postProcessing.m_Vignette).model.m_Settings.intensity + 0.01f); Mod.SetVignette(((PostProcessingComponent<VignetteModel>)(object)postProcessing.m_Vignette).model.m_Settings.color, ((PostProcessingComponent<VignetteModel>)(object)postProcessing.m_Vignette).model.m_Settings.intensity); } else if (flag7) { ((PostProcessingModel)((PostProcessingComponent<VignetteModel>)(object)postProcessing.m_Vignette).model).m_Enabled = false; ((PostProcessingComponent<VignetteModel>)(object)postProcessing.m_Vignette).model.m_Settings.color = Color.white; ((PostProcessingComponent<VignetteModel>)(object)postProcessing.m_Vignette).model.m_Settings.intensity = Mathf.Min(0.3f, ((PostProcessingComponent<VignetteModel>)(object)postProcessing.m_Vignette).model.m_Settings.intensity + 0.01f); Mod.SetVignette(((PostProcessingComponent<VignetteModel>)(object)postProcessing.m_Vignette).model.m_Settings.color, ((PostProcessingComponent<VignetteModel>)(object)postProcessing.m_Vignette).model.m_Settings.intensity); } else if (flag3) { ((PostProcessingModel)((PostProcessingComponent<VignetteModel>)(object)postProcessing.m_Vignette).model).m_Enabled = false; ((PostProcessingComponent<VignetteModel>)(object)postProcessing.m_Vignette).model.m_Settings.color = new Color(5f, 0f, 0f, 1f); ((PostProcessingComponent<VignetteModel>)(object)postProcessing.m_Vignette).model.m_Settings.intensity = Mathf.Min(0.3f, ((PostProcessingComponent<VignetteModel>)(object)postProcessing.m_Vignette).model.m_Settings.intensity + 0.01f); Mod.SetVignette(((PostProcessingComponent<VignetteModel>)(object)postProcessing.m_Vignette).model.m_Settings.color, ((PostProcessingComponent<VignetteModel>)(object)postProcessing.m_Vignette).model.m_Settings.intensity); } else if (flag2) { ((PostProcessingModel)((PostProcessingComponent<VignetteModel>)(object)postProcessing.m_Vignette).model).m_Enabled = false; ((PostProcessingComponent<VignetteModel>)(object)postProcessing.m_Vignette).model.m_Settings.color = new Color(0f, 0f, 0f, 1f); ((PostProcessingComponent<VignetteModel>)(object)postProcessing.m_Vignette).model.m_Settings.intensity = Mathf.Min(0.3f, ((PostProcessingComponent<VignetteModel>)(object)postProcessing.m_Vignette).model.m_Settings.intensity + 0.01f); Mod.SetVignette(((PostProcessingComponent<VignetteModel>)(object)postProcessing.m_Vignette).model.m_Settings.color, ((PostProcessingComponent<VignetteModel>)(object)postProcessing.m_Vignette).model.m_Settings.intensity); } else if (flag) { ((PostProcessingModel)((PostProcessingComponent<VignetteModel>)(object)postProcessing.m_Vignette).model).m_Enabled = false; ((PostProcessingComponent<VignetteModel>)(object)postProcessing.m_Vignette).model.m_Settings.color = new Color(0f, 0f, 2f, 1f); ((PostProcessingComponent<VignetteModel>)(object)postProcessing.m_Vignette).model.m_Settings.intensity = Mathf.Min(0.3f, ((PostProcessingComponent<VignetteModel>)(object)postProcessing.m_Vignette).model.m_Settings.intensity + 0.01f); Mod.SetVignette(((PostProcessingComponent<VignetteModel>)(object)postProcessing.m_Vignette).model.m_Settings.color, ((PostProcessingComponent<VignetteModel>)(object)postProcessing.m_Vignette).model.m_Settings.intensity); } else if (((PostProcessingComponent<VignetteModel>)(object)postProcessing.m_Vignette).model.m_Settings.intensity > 0.05f) { ((PostProcessingComponent<VignetteModel>)(object)postProcessing.m_Vignette).model.m_Settings.intensity = Mathf.Max(0.05f, ((PostProcessingComponent<VignetteModel>)(object)postProcessing.m_Vignette).model.m_Settings.intensity - 0.001f); Mod.SetVignette(null, ((PostProcessingComponent<VignetteModel>)(object)postProcessing.m_Vignette).model.m_Settings.intensity); } else { Mod.SetVignette(Color.clear, 0f); ((PostProcessingModel)((PostProcessingComponent<VignetteModel>)(object)postProcessing.m_Vignette).model).m_Enabled = false; } if (flag || flag2 || flag3 || flag4 || flag5) { ((PostProcessingComponent<ChromaticAberrationModel>)(object)postProcessing.m_ChromaticAberration).model.m_Settings.intensity = Mathf.Min(10f, ((PostProcessingComponent<ChromaticAberrationModel>)(object)postProcessing.m_ChromaticAberration).model.m_Settings.intensity + 0.5f); } else if ((Object)(object)statusEffect != (Object)null) { ((PostProcessingComponent<ChromaticAberrationModel>)(object)postProcessing.m_ChromaticAberration).model.m_Settings.intensity += 0.003f; } else if (((PostProcessingComponent<ChromaticAberrationModel>)(object)postProcessing.m_ChromaticAberration).model.m_Settings.intensity > 0.14f) { ((PostProcessingComponent<ChromaticAberrationModel>)(object)postProcessing.m_ChromaticAberration).model.m_Settings.intensity = Mathf.Max(0.14f, ((PostProcessingComponent<ChromaticAberrationModel>)(object)postProcessing.m_ChromaticAberration).model.m_Settings.intensity - 0.01f); } if (flag || flag4) { if (((PostProcessingComponent<ColorGradingModel>)(object)postProcessing.m_ColorGrading).model.m_Settings.basic.saturation != 2f) { ((PostProcessingComponent<ColorGradingModel>)(object)postProcessing.m_ColorGrading).model.m_Settings.basic.saturation = Mathf.Min(2f, ((PostProcessingComponent<ColorGradingModel>)(object)postProcessing.m_ColorGrading).model.m_Settings.basic.saturation + 0.05f); ((PostProcessingComponent<ColorGradingModel>)(object)postProcessing.m_ColorGrading).model.isDirty = true; } } else if (flag2 || flag6) { if (((PostProcessingComponent<ColorGradingModel>)(object)postProcessing.m_ColorGrading).model.m_Settings.basic.saturation != 0.2f) { ((PostProcessingComponent<ColorGradingModel>)(object)postProcessing.m_ColorGrading).model.m_Settings.basic.saturation = 0.2f; ((PostProcessingComponent<ColorGradingModel>)(object)postProcessing.m_ColorGrading).model.isDirty = true; } } else if (((PostProcessingComponent<ColorGradingModel>)(object)postProcessing.m_ColorGrading).model.m_Settings.basic.saturation != 1f) { if (((PostProcessingComponent<ColorGradingModel>)(object)postProcessing.m_ColorGrading).model.m_Settings.basic.saturation < 1f) { ((PostProcessingComponent<ColorGradingModel>)(object)postProcessing.m_ColorGrading).model.m_Settings.basic.saturation = Mathf.Min(1f, ((PostProcessingComponent<ColorGradingModel>)(object)postProcessing.m_ColorGrading).model.m_Settings.basic.saturation + 0.01f); } else { ((PostProcessingComponent<ColorGradingModel>)(object)postProcessing.m_ColorGrading).model.m_Settings.basic.saturation = Mathf.Max(1f, ((PostProcessingComponent<ColorGradingModel>)(object)postProcessing.m_ColorGrading).model.m_Settings.basic.saturation - 0.01f); } ((PostProcessingComponent<ColorGradingModel>)(object)postProcessing.m_ColorGrading).model.isDirty = true; } } } [HarmonyPatch(typeof(Pickable), "Awake")] private class pickableposty { private static void Postfix(ref Pickable __instance) { ((MonoBehaviour)__instance).StartCoroutine(CheckPinkMushroom(__instance)); } } [HarmonyPatch(typeof(Pickable), "SetPicked")] private class pickablepostpick { private static void Postfix(bool picked, ref Pickable __instance) { if (!picked) { return; } GameObject gameObject = ((Component)((Component)__instance).transform).gameObject; if ((Object)(object)gameObject != (Object)null) { Transform val = gameObject.transform.Find("pinkfloaters"); if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)((Component)val).gameObject)) { Object.Destroy((Object)(object)((Component)val).gameObject); } } } } private static Color[] rainbowcolors = (Color[])(object)new Color[8] { new Color(5f, 0f, 0f, 1f), new Color(5f, 2f, 0f, 1f), new Color(5f, 5f, 0f, 1f), new Color(0f, 5f, 0f, 1f), new Color(0f, 3f, 2f, 1f), new Color(0f, 0f, 5f, 1f), new Color(3f, 0f, 5f, 1f), new Color(4f, 0f, 2f, 1f) }; private static int rainbowcurrent = 0; private static int rainbownext = 1; private static float rainbowtimer = 0f; private static float rainbowchangeevery = 0.5f; private static float blacktimer = 0f; private static float lavatimer = 0f; public static IEnumerator CheckPinkMushroom(Pickable __instance) { while (true) { if (__instance.m_nview.IsValid() && (Object)(object)Player.m_localPlayer != (Object)null && ((Character)Player.m_localPlayer).m_nview.IsValid()) { bool pinkshroom = false; foreach (Food food in Player.m_localPlayer.m_foods) { if (food.m_name == "MushroomPink") { pinkshroom = true; } } if (!__instance.m_picked && pinkshroom) { GameObject parento = ((Component)((Component)__instance).transform).gameObject; if ((Object)(object)parento != (Object)null) { bool found = false; Transform floaterstransform = parento.transform.Find("pinkfloaters"); if (Object.op_Implicit((Object)(object)floaterstransform) && Object.op_Implicit((Object)(object)((Component)floaterstransform).gameObject)) { found = true; } if (!found) { GameObject pinkprefab = PrefabManager.Instance.GetPrefab("MushroomPink"); if (Object.op_Implicit((Object)(object)pinkprefab)) { Transform pinkfloaterstransform = pinkprefab.transform.Find("attach/floaters"); if (Object.op_Implicit((Object)(object)pinkfloaterstransform) && Object.op_Implicit((Object)(object)((Component)pinkfloaterstransform).gameObject)) { GameObject pinkfloaters = Object.Instantiate<GameObject>(((Component)pinkfloaterstransform).gameObject, parento.transform); ((Object)pinkfloaters).name = "pinkfloaters"; pinkfloaters.transform.localScale = new Vector3(2f, 2f, 2f); } else { Logger.LogError((object)"failed to find MushroomPink floaters"); } } else { Logger.LogError((object)"failed to find MushroomPink"); } } } } else { GameObject parento2 = ((Component)((Component)__instance).transform).gameObject; if ((Object)(object)parento2 != (Object)null) { Transform floaterstransform2 = parento2.transform.Find("pinkfloaters"); if (Object.op_Implicit((Object)(object)floaterstransform2) && Object.op_Implicit((Object)(object)((Component)floaterstransform2).gameObject)) { Object.Destroy((Object)(object)((Component)floaterstransform2).gameObject); } } } } yield return (object)new WaitForSeconds(Random.Range(10f, 20f)); } } } } namespace Microsoft.CodeAnalysis { [Embedded] [CompilerGenerated] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [Embedded] [CompilerGenerated] [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] [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; } } [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] [Embedded] [CompilerGenerated] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace ServerSync { [PublicAPI] internal abstract class OwnConfigEntryBase { public object? LocalBaseValue; public bool SynchronizedConfig = true; public abstract ConfigEntryBase BaseConfig { get; } } [PublicAPI] internal class SyncedConfigEntry<T>(ConfigEntry<T> sourceConfig) : OwnConfigEntryBase() { public readonly ConfigEntry<T> SourceConfig = sourceConfig; public override ConfigEntryBase BaseConfig => (ConfigEntryBase)(object)SourceConfig; public T Value { get { return SourceConfig.Value; } set { SourceConfig.Value = value; } } public void AssignLocalValue(T value) { if (LocalBaseValue == null) { Value = value; } else { LocalBaseValue = value; } } } internal abstract class CustomSyncedValueBase { public object? LocalBaseValue; public readonly string Identifier; public readonly Type Type; private object? boxedValue; protected bool localIsOwner; public readonly int Priority; public object? BoxedValue { get { return boxedValue; } set { boxedValue = value; this.ValueChanged?.Invoke(); } } public event Action? ValueChanged; protected CustomSyncedValueBase(ConfigSync configSync, string identifier, Type type, int priority) { Priority = priority; Identifier = identifier; Type = type; configSync.AddCustomValue(this); localIsOwner = configSync.IsSourceOfTruth; configSync.SourceOfTruthChanged += delegate(bool truth) { localIsOwner = truth; }; } } [PublicAPI] internal sealed class CustomSyncedValue<T> : CustomSyncedValueBase { public T Value { get { return (T)base.BoxedValue; } set { base.BoxedValue = value; } } public CustomSyncedValue(ConfigSync configSync, string identifier, T value = default(T), int priority = 0) : base(configSync, identifier, typeof(T), priority) { Value = value; } public void AssignLocalValue(T value) { if (localIsOwner) { Value = value; } else { LocalBaseValue = value; } } } internal class ConfigurationManagerAttributes { [UsedImplicitly] public bool? ReadOnly = false; } [PublicAPI] internal class ConfigSync { [HarmonyPatch(typeof(ZRpc), "HandlePackage")] private static class SnatchCurrentlyHandlingRPC { public static ZRpc? currentRpc; [HarmonyPrefix] private static void Prefix(ZRpc __instance) { currentRpc = __instance; } } [HarmonyPatch(typeof(ZNet), "Awake")] internal static class RegisterRPCPatch { [HarmonyPostfix] private static void Postfix(ZNet __instance) { isServer = __instance.IsServer(); foreach (ConfigSync configSync2 in configSyncs) { ZRoutedRpc.instance.Register<ZPackage>(configSync2.Name + " ConfigSync", (Action<long, ZPackage>)configSync2.RPC_FromOtherClientConfigSync); if (isServer) { configSync2.InitialSyncDone = true; Debug.Log((object)("Registered '" + configSync2.Name + " ConfigSync' RPC - waiting for incoming connections")); } } if (isServer) { ((MonoBehaviour)__instance).StartCoroutine(WatchAdminListChanges()); } static void SendAdmin(List<ZNetPeer> peers, bool isAdmin) { ZPackage package = ConfigsToPackage(null, null, new PackageEntry[1] { new PackageEntry { section = "Internal", key = "lockexempt", type = typeof(bool), value = isAdmin } }); ConfigSync configSync = configSyncs.First(); if (configSync != null) { ((MonoBehaviour)ZNet.instance).StartCoroutine(configSync.sendZPackage(peers, package)); } } static IEnumerator WatchAdminListChanges() { MethodInfo listContainsId = AccessTools.DeclaredMethod(typeof(ZNet), "ListContainsId", (Type[])null, (Type[])null); SyncedList adminList = (SyncedList)AccessTools.DeclaredField(typeof(ZNet), "m_adminList").GetValue(ZNet.instance); List<string> CurrentList = new List<string>(adminList.GetList()); while (true) { yield return (object)new WaitForSeconds(30f); if (!adminList.GetList().SequenceEqual(CurrentList)) { CurrentList = new List<string>(adminList.GetList()); List<ZNetPeer> adminPeer = ZNet.instance.GetPeers().Where(delegate(ZNetPeer p) { string hostName = p.m_rpc.GetSocket().GetHostName(); return ((object)listContainsId == null) ? adminList.Contains(hostName) : ((bool)listContainsId.Invoke(ZNet.instance, new object[2] { adminList, hostName })); }).ToList(); List<ZNetPeer> nonAdminPeer = ZNet.instance.GetPeers().Except(adminPeer).ToList(); SendAdmin(nonAdminPeer, isAdmin: false); SendAdmin(adminPeer, isAdmin: true); } } } } } [HarmonyPatch(typeof(ZNet), "OnNewConnection")] private static class RegisterClientRPCPatch { [HarmonyPostfix] private static void Postfix(ZNet __instance, ZNetPeer peer) { if (__instance.IsServer()) { return; } foreach (ConfigSync configSync in configSyncs) { peer.m_rpc.Register<ZPackage>(configSync.Name + " ConfigSync", (Action<ZRpc, ZPackage>)configSync.RPC_FromServerConfigSync); } } } private class ParsedConfigs { public readonly Dictionary<OwnConfigEntryBase, object?> configValues = new Dictionary<OwnConfigEntryBase, object>(); public readonly Dictionary<CustomSyncedValueBase, object?> customValues = new Dictionary<CustomSyncedValueBase, object>(); } [HarmonyPatch(typeof(ZNet), "Shutdown")] private class ResetConfigsOnShutdown { [HarmonyPostfix] private static void Postfix() { ProcessingServerUpdate = true; foreach (ConfigSync configSync in configSyncs) { configSync.resetConfigsFromServer(); configSync.IsSourceOfTruth = true; configSync.InitialSyncDone = false; } ProcessingServerUpdate = false; } } [HarmonyPatch(typeof(ZNet), "RPC_PeerInfo")] private class SendConfigsAfterLogin { private class BufferingSocket : ZPlayFabSocket, ISocket { public volatile bool finished = false; public volatile int versionMatchQueued = -1; public readonly List<ZPackage> Package = new List<ZPackage>(); public readonly ISocket Original; public BufferingSocket(ISocket original) { Original = original; ((ZPlayFabSocket)this)..ctor(); } public bool IsConnected() { return Original.IsConnected(); } public ZPackage Recv() { return Original.Recv(); } public int GetSendQueueSize() { return Original.GetSendQueueSize(); } public int GetCurrentSendRate() { return Original.GetCurrentSendRate(); } public bool IsHost() { return Original.IsHost(); } public void Dispose() { Original.Dispose(); } public bool GotNewData() { return Original.GotNewData(); } public void Close() { Original.Close(); } public string GetEndPointString() { return Original.GetEndPointString(); } public void GetAndResetStats(out int totalSent, out int totalRecv) { Original.GetAndResetStats(ref totalSent, ref totalRecv); } public void GetConnectionQuality(out float localQuality, out float remoteQuality, out int ping, out float outByteSec, out float inByteSec) { Original.GetConnectionQuality(ref localQuality, ref remoteQuality, ref ping, ref outByteSec, ref inByteSec); } public ISocket Accept() { return Original.Accept(); } public int GetHostPort() { return Original.GetHostPort(); } public bool Flush() { return Original.Flush(); } public string GetHostName() { return Original.GetHostName(); } public void VersionMatch() { if (finished) { Original.VersionMatch(); } else { versionMatchQueued = Package.Count; } } public void Send(ZPackage pkg) { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Expected O, but got Unknown int pos = pkg.GetPos(); pkg.SetPos(0); int num = pkg.ReadInt(); if ((num == StringExtensionMethods.GetStableHashCode("PeerInfo") || num == StringExtensionMethods.GetStableHashCode("RoutedRPC") || num == StringExtensionMethods.GetStableHashCode("ZDOData")) && !finished) { ZPackage val = new ZPackage(pkg.GetArray()); val.SetPos(pos); Package.Add(val); } else { pkg.SetPos(pos); Original.Send(pkg); } } } [HarmonyPriority(800)] [HarmonyPrefix] private static void Prefix(ref Dictionary<Assembly, BufferingSocket>? __state, ZNet __instance, ZRpc rpc) { //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Invalid comparison between Unknown and I4 if (!__instance.IsServer()) { return; } BufferingSocket bufferingSocket = new BufferingSocket(rpc.GetSocket()); AccessTools.DeclaredField(typeof(ZRpc), "m_socket").SetValue(rpc, bufferingSocket); object? obj = AccessTools.DeclaredMethod(typeof(ZNet), "GetPeer", new Type[1] { typeof(ZRpc) }, (Type[])null).Invoke(__instance, new object[1] { rpc }); ZNetPeer val = (ZNetPeer)((obj is ZNetPeer) ? obj : null); if (val != null && (int)ZNet.m_onlineBackend > 0) { FieldInfo fieldInfo = AccessTools.DeclaredField(typeof(ZNetPeer), "m_socket"); object? value = fieldInfo.GetValue(val); ZPlayFabSocket val2 = (ZPlayFabSocket)((value is ZPlayFabSocket) ? value : null); if (val2 != null) { typeof(ZPlayFabSocket).GetField("m_remotePlayerId").SetValue(bufferingSocket, val2.m_remotePlayerId); } fieldInfo.SetValue(val, bufferingSocket); } if (__state == null) { __state = new Dictionary<Assembly, BufferingSocket>(); } __state[Assembly.GetExecutingAssembly()] = bufferingSocket; } [HarmonyPostfix] private static void Postfix(Dictionary<Assembly, BufferingSocket> __state, ZNet __instance, ZRpc rpc) { ZNetPeer peer; if (__instance.IsServer()) { object obj = AccessTools.DeclaredMethod(typeof(ZNet), "GetPeer", new Type[1] { typeof(ZRpc) }, (Type[])null).Invoke(__instance, new object[1] { rpc }); peer = (ZNetPeer)((obj is ZNetPeer) ? obj : null); if (peer == null) { SendBufferedData(); } else { ((MonoBehaviour)__instance).StartCoroutine(sendAsync()); } } void SendBufferedData() { if (rpc.GetSocket() is BufferingSocket bufferingSocket) { AccessTools.DeclaredField(typeof(ZRpc), "m_socket").SetValue(rpc, bufferingSocket.Original); object? obj2 = AccessTools.DeclaredMethod(typeof(ZNet), "GetPeer", new Type[1] { typeof(ZRpc) }, (Type[])null).Invoke(__instance, new object[1] { rpc }); ZNetPeer val = (ZNetPeer)((obj2 is ZNetPeer) ? obj2 : null); if (val != null) { AccessTools.DeclaredField(typeof(ZNetPeer), "m_socket").SetValue(val, bufferingSocket.Original); } } BufferingSocket bufferingSocket2 = __state[Assembly.GetExecutingAssembly()]; bufferingSocket2.finished = true; for (int i = 0; i < bufferingSocket2.Package.Count; i++) { if (i == bufferingSocket2.versionMatchQueued) { bufferingSocket2.Original.VersionMatch(); } bufferingSocket2.Original.Send(bufferingSocket2.Package[i]); } if (bufferingSocket2.Package.Count == bufferingSocket2.versionMatchQueued) { bufferingSocket2.Original.VersionMatch(); } } IEnumerator sendAsync() { foreach (ConfigSync configSync in configSyncs) { List<PackageEntry> entries = new List<PackageEntry>(); if (configSync.CurrentVersion != null) { entries.Add(new PackageEntry { section = "Internal", key = "serverversion", type = typeof(string), value = configSync.CurrentVersion }); } MethodInfo listContainsId = AccessTools.DeclaredMethod(typeof(ZNet), "ListContainsId", (Type[])null, (Type[])null); SyncedList adminList = (SyncedList)AccessTools.DeclaredField(typeof(ZNet), "m_adminList").GetValue(ZNet.instance); entries.Add(new PackageEntry { section = "Internal", key = "lockexempt", type = typeof(bool), value = (((object)listContainsId == null) ? ((object)adminList.Contains(rpc.GetSocket().GetHostName())) : listContainsId.Invoke(ZNet.instance, new object[2] { adminList, rpc.GetSocket().GetHostName() })) }); ZPackage package = ConfigsToPackage(configSync.allConfigs.Select((OwnConfigEntryBase c) => c.BaseConfig), configSync.allCustomValues, entries, partial: false); yield return ((MonoBehaviour)__instance).StartCoroutine(configSync.sendZPackage(new List<ZNetPeer> { peer }, package)); } SendBufferedData(); } } } private class PackageEntry { public string section = null; public string key = null; public Type type = null; public object? value; } [HarmonyPatch(typeof(ConfigEntryBase), "GetSerializedValue")] private static class PreventSavingServerInfo { [HarmonyPrefix] private static bool Prefix(ConfigEntryBase __instance, ref string __result) { OwnConfigEntryBase ownConfigEntryBase = configData(__instance); if (ownConfigEntryBase == null || isWritableConfig(ownConfigEntryBase)) { return true; } __result = TomlTypeConverter.ConvertToString(ownConfigEntryBase.LocalBaseValue, __instance.SettingType); return false; } } [HarmonyPatch(typeof(ConfigEntryBase), "SetSerializedValue")] private static class PreventConfigRereadChangingValues { [HarmonyPrefix] private static bool Prefix(ConfigEntryBase __instance, string value) { OwnConfigEntryBase ownConfigEntryBase = configData(__instance); if (ownConfigEntryBase == null || ownConfigEntryBase.LocalBaseValue == null) { return true; } try { ownConfigEntryBase.LocalBaseValue = TomlTypeConverter.ConvertToValue(value, __instance.SettingType); } catch (Exception ex) { Debug.LogWarning((object)$"Config value of setting \"{__instance.Definition}\" could not be parsed and will be ignored. Reason: {ex.Message}; Value: {value}"); } return false; } } private class InvalidDeserializationTypeException : Exception { public string expected = null; public string received = null; public string field = ""; } public static bool ProcessingServerUpdate; public readonly string Name; public string? DisplayName; public string? CurrentVersion; public string? MinimumRequiredVersion; public bool ModRequired = false; private bool? forceConfigLocking; private bool isSourceOfTruth = true; private static readonly HashSet<ConfigSync> configSyncs; private readonly HashSet<OwnConfigEntryBase> allConfigs = new HashSet<OwnConfigEntryBase>(); private HashSet<CustomSyncedValueBase> allCustomValues = new HashSet<CustomSyncedValueBase>(); private static bool isServer; private static bool lockExempt; private OwnConfigEntryBase? lockedConfig = null; private const byte PARTIAL_CONFIGS = 1; private const byte FRAGMENTED_CONFIG = 2; private const byte COMPRESSED_CONFIG = 4; private readonly Dictionary<string, SortedDictionary<int, byte[]>> configValueCache = new Dictionary<string, SortedDictionary<int, byte[]>>(); private readonly List<KeyValuePair<long, string>> cacheExpirations = new List<KeyValuePair<long, string>>(); private static long packageCounter; public bool IsLocked { get { bool? flag = forceConfigLocking; bool num; if (!flag.HasValue) { if (lockedConfig == null) { goto IL_0052; } num = ((IConvertible)lockedConfig.BaseConfig.BoxedValue).ToInt32(CultureInfo.InvariantCulture) != 0; } else { num = flag == true; } if (!num) { goto IL_0052; } int result = ((!lockExempt) ? 1 : 0); goto IL_0053; IL_0052: result = 0; goto IL_0053; IL_0053: return (byte)result != 0; } set { forceConfigLocking = value; } } public bool IsAdmin => lockExempt || isSourceOfTruth; public bool IsSourceOfTruth { get { return isSourceOfTruth; } private set { if (value != isSourceOfTruth) { isSourceOfTruth = value; this.SourceOfTruthChanged?.Invoke(value); } } } public bool InitialSyncDone { get; private set; } = false; public event Action<bool>? SourceOfTruthChanged; private event Action? lockedConfigChanged; static ConfigSync() { ProcessingServerUpdate = false; configSyncs = new HashSet<ConfigSync>(); lockExempt = false; packageCounter = 0L; RuntimeHelpers.RunClassConstructor(typeof(VersionCheck).TypeHandle); } public ConfigSync(string name) { Name = name; configSyncs.Add(this); new VersionCheck(this); } public SyncedConfigEntry<T> AddConfigEntry<T>(ConfigEntry<T> configEntry) { OwnConfigEntryBase ownConfigEntryBase = configData((ConfigEntryBase)(object)configEntry); SyncedConfigEntry<T> syncedEntry = ownConfigEntryBase as SyncedConfigEntry<T>; if (syncedEntry == null) { syncedEntry = new SyncedConfigEntry<T>(configEntry); AccessTools.DeclaredField(typeof(ConfigDescription), "<Tags>k__BackingField").SetValue(((ConfigEntryBase)configEntry).Description, new object[1] { new ConfigurationManagerAttributes() }.Concat(((ConfigEntryBase)configEntry).Description.Tags ?? Array.Empty<object>()).Concat(new SyncedConfigEntry<T>[1] { syncedEntry }).ToArray()); configEntry.SettingChanged += delegate { if (!ProcessingServerUpdate && syncedEntry.SynchronizedConfig) { Broadcast(0L, (ConfigEntryBase)configEntry); } }; allConfigs.Add(syncedEntry); } return syncedEntry; } public SyncedConfigEntry<T> AddLockingConfigEntry<T>(ConfigEntry<T> lockingConfig) where T : IConvertible { if (lockedConfig != null) { throw new Exception("Cannot initialize locking ConfigEntry twice"); } lockedConfig = AddConfigEntry<T>(lockingConfig); lockingConfig.SettingChanged += delegate { this.lockedConfigChanged?.Invoke(); }; return (SyncedConfigEntry<T>)lockedConfig; } internal void AddCustomValue(CustomSyncedValueBase customValue) { if (allCustomValues.Select((CustomSyncedValueBase v) => v.Identifier).Concat(new string[1] { "serverversion" }).Contains(customValue.Identifier)) { throw new Exception("Cannot have multiple settings with the same name or with a reserved name (serverversion)"); } allCustomValues.Add(customValue); allCustomValues = new HashSet<CustomSyncedValueBase>(allCustomValues.OrderByDescending((CustomSyncedValueBase v) => v.Priority)); customValue.ValueChanged += delegate { if (!ProcessingServerUpdate) { Broadcast(0L, customValue); } }; } private void RPC_FromServerConfigSync(ZRpc rpc, ZPackage package) { lockedConfigChanged += serverLockedSettingChanged; IsSourceOfTruth = false; if (HandleConfigSyncRPC(0L, package, clientUpdate: false)) { InitialSyncDone = true; } } private void RPC_FromOtherClientConfigSync(long sender, ZPackage package) { HandleConfigSyncRPC(sender, package, clientUpdate: true); } private bool HandleConfigSyncRPC(long sender, ZPackage package, bool clientUpdate) { //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Expected O, but got Unknown //IL_0250: Unknown result type (might be due to invalid IL or missing references) //IL_0257: Expected O, but got Unknown //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Expected O, but got Unknown try { if (isServer && IsLocked) { ZRpc? currentRpc = SnatchCurrentlyHandlingRPC.currentRpc; object obj; if (currentRpc == null) { obj = null; } else { ISocket socket = currentRpc.GetSocket(); obj = ((socket != null) ? socket.GetHostName() : null); } string text = (string)obj; if (text != null) { MethodInfo methodInfo = AccessTools.DeclaredMethod(typeof(ZNet), "ListContainsId", (Type[])null, (Type[])null); SyncedList val = (SyncedList)AccessTools.DeclaredField(typeof(ZNet), "m_adminList").GetValue(ZNet.instance); if (!(((object)methodInfo == null) ? val.Contains(text) : ((bool)methodInfo.Invoke(ZNet.instance, new object[2] { val, text })))) { return false; } } } cacheExpirations.RemoveAll(delegate(KeyValuePair<long, string> kv) { if (kv.Key < DateTimeOffset.Now.Ticks) { configValueCache.Remove(kv.Value); return true; } return false; }); byte b = package.ReadByte(); if ((b & 2) != 0) { long num = package.ReadLong(); string text2 = sender.ToString() + num; if (!configValueCache.TryGetValue(text2, out SortedDictionary<int, byte[]> value)) { value = new SortedDictionary<int, byte[]>(); configValueCache[text2] = value; cacheExpirations.Add(new KeyValuePair<long, string>(DateTimeOffset.Now.AddSeconds(60.0).Ticks, text2)); } int key = package.ReadInt(); int num2 = package.ReadInt(); value.Add(key, package.ReadByteArray()); if (value.Count < num2) { return false; } configValueCache.Remove(text2); package = new ZPackage(value.Values.SelectMany((byte[] a) => a).ToArray()); b = package.ReadByte(); } ProcessingServerUpdate = true; if ((b & 4) != 0) { byte[] buffer = package.ReadByteArray(); MemoryStream stream = new MemoryStream(buffer); MemoryStream memoryStream = new MemoryStream(); using (DeflateStream deflateStream = new DeflateStream(stream, CompressionMode.Decompress)) { deflateStream.CopyTo(memoryStream); } package = new ZPackage(memoryStream.ToArray()); b = package.ReadByte(); } if ((b & 1) == 0) { resetConfigsFromServer(); } ParsedConfigs parsedConfigs = ReadConfigsFromPackage(package); ConfigFile val2 = null; bool saveOnConfigSet = false; foreach (KeyValuePair<OwnConfigEntryBase, object> configValue in parsedConfigs.configValues) { if (!isServer && configValue.Key.LocalBaseValue == null) { configValue.Key.LocalBaseValue = configValue.Key.BaseConfig.BoxedValue; } if (val2 == null) { val2 = configValue.Key.BaseConfig.ConfigFile; saveOnConfigSet = val2.SaveOnConfigSet; val2.SaveOnConfigSet = false; } configValue.Key.BaseConfig.BoxedValue = configValue.Value; } if (val2 != null) { val2.SaveOnConfigSet = saveOnConfigSet; val2.Save(); } foreach (KeyValuePair<CustomSyncedValueBase, object> customValue in parsedConfigs.customValues) { if (!isServer) { CustomSyncedValueBase key2 = customValue.Key; if (key2.LocalBaseValue == null) { key2.LocalBaseValue = customValue.Key.BoxedValue; } } customValue.Key.BoxedValue = customValue.Value; } Debug.Log((object)string.Format("Received {0} configs and {1} custom values from {2} for mod {3}", parsedConfigs.configValues.Count, parsedConfigs.customValues.Count, (isServer || clientUpdate) ? $"client {sender}" : "the server", DisplayName ?? Name)); if (!isServer) { serverLockedSettingChanged(); } return true; } finally { ProcessingServerUpdate = false; } } private ParsedConfigs ReadConfigsFromPackage(ZPackage package) { ParsedConfigs parsedConfigs = new ParsedConfigs(); Dictionary<string, OwnConfigEntryBase> dictionary = allConfigs.Where((OwnConfigEntryBase c) => c.SynchronizedConfig).ToDictionary((OwnConfigEntryBase c) => c.BaseConfig.Definition.Section + "_" + c.BaseConfig.Definition.Key, (OwnConfigEntryBase c) => c); Dictionary<string, CustomSyncedValueBase> dictionary2 = allCustomValues.ToDictionary((CustomSyncedValueBase c) => c.Identifier, (CustomSyncedValueBase c) => c); int num = package.ReadInt(); for (int num2 = 0; num2 < num; num2++) { string text = package.ReadString(); string text2 = package.ReadString(); string text3 = package.ReadString(); Type type = Type.GetType(text3); if (text3 == "" || type != null) { object obj; try { obj = ((text3 == "") ? null : ReadValueWithTypeFromZPackage(package, type)); } catch (InvalidDeserializationTypeException ex) { Debug.LogWarning((object)("Got unexpected struct internal type " + ex.received + " for field " + ex.field + " struct " + text3 + " for " + text2 + " in section " + text + " for mod " + (DisplayName ?? Name) + ", expecting " + ex.expected)); continue; } OwnConfigEntryBase value2; if (text == "Internal") { CustomSyncedValueBase value; if (text2 == "serverversion") { if (obj?.ToString() != CurrentVersion) { Debug.LogWarning((object)("Received server version is not equal: server