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 ServersideQoL PrefabConfigurator v2.3.0
ServersideQoL.PrefabConfigurator.dll
Decompiled 2 weeks agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Linq.Expressions; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using BepInEx; using BepInEx.Configuration; using Microsoft.CodeAnalysis; using ServersideQoL.Utilities; using UnityEngine; using YamlDotNet.Serialization; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("ArgusMagnus")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyCopyright("ArgusMagnus")] [assembly: AssemblyDescription("Configure prefabs to your hearts content. Increase the range of workstations. Make fireplaces/light sources toggleable or have infinite fuel. Change plant grow time or required space. Etc. etc. etc.")] [assembly: AssemblyFileVersion("2.3.0.0")] [assembly: AssemblyInformationalVersion("2.3.0+2e3f9ec58eb6242e0f6159ce758d539a6d41fdf7")] [assembly: AssemblyProduct("ServersideQoL.PrefabConfigurator")] [assembly: AssemblyTitle("ServersideQoL.PrefabConfigurator")] [assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/ArgusMagnus/ValheimServersideQoL")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("2.3.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace ServersideQoL.PrefabConfigurator { [Processor("3a6fd652-03b4-4b37-b031-fba0f999a6e7", Priority = int.MinValue)] [RunBefore<PrefabProcessor>] public sealed class BuildPieceProcessor : Processor<BuildPieceProcessor.PrefabInfo> { public sealed record PrefabInfo(WearNTear WearNTear, Piece? Piece, PieceTable? PieceTable, ZSyncTransform? ZSyncTransform) : ProcessorPrefabInfo() { [CompilerGenerated] public override string ToString() { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append("PrefabInfo"); stringBuilder.Append(" { "); if (((ProcessorPrefabInfo)this).PrintMembers(stringBuilder)) { stringBuilder.Append(' '); } stringBuilder.Append('}'); return stringBuilder.ToString(); } [CompilerGenerated] protected override bool PrintMembers(StringBuilder builder) { if (((ProcessorPrefabInfo)this).PrintMembers(builder)) { builder.Append(", "); } builder.Append("WearNTear = "); builder.Append(WearNTear); builder.Append(", Piece = "); builder.Append(Piece); builder.Append(", PieceTable = "); builder.Append(PieceTable); builder.Append(", ZSyncTransform = "); builder.Append(ZSyncTransform); return true; } [CompilerGenerated] public override int GetHashCode() { return (((((ProcessorPrefabInfo)this).GetHashCode() * -1521134295 + EqualityComparer<WearNTear>.Default.GetHashCode(WearNTear)) * -1521134295 + EqualityComparer<Piece>.Default.GetHashCode(Piece)) * -1521134295 + EqualityComparer<PieceTable>.Default.GetHashCode(PieceTable)) * -1521134295 + EqualityComparer<ZSyncTransform>.Default.GetHashCode(ZSyncTransform); } [CompilerGenerated] public sealed override bool Equals(ProcessorPrefabInfo? other) { return ((object)this).Equals((object?)other); } [CompilerGenerated] public bool Equals(PrefabInfo? other) { if ((object)this != other) { if (((ProcessorPrefabInfo)this).Equals((ProcessorPrefabInfo)(object)other) && EqualityComparer<WearNTear>.Default.Equals(WearNTear, other.WearNTear) && EqualityComparer<Piece>.Default.Equals(Piece, other.Piece) && EqualityComparer<PieceTable>.Default.Equals(PieceTable, other.PieceTable)) { return EqualityComparer<ZSyncTransform>.Default.Equals(ZSyncTransform, other.ZSyncTransform); } return false; } return true; } [CompilerGenerated] private PrefabInfo(PrefabInfo original) : base((ProcessorPrefabInfo)(object)original) { WearNTear = original.WearNTear; Piece = original.Piece; PieceTable = original.PieceTable; ZSyncTransform = original.ZSyncTransform; } } public const string Id = "3a6fd652-03b4-4b37-b031-fba0f999a6e7"; protected override ProcessResult Process(ServersideQoLZDO zdo, IReadOnlyList<Peer> peers, PrefabInfo prefabInfo) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_02a1: Unknown result type (might be due to invalid IL or missing references) //IL_029d: Unknown result type (might be due to invalid IL or missing references) //IL_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011a: 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_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) if (zdo.IsModCreator()) { return (ProcessResult)2; } ProcessResult val = (ProcessResult)2; ComponentFieldAccessor<WearNTear> val2 = zdo.Fields<WearNTear>(); ZDOVars vars; int num; if ((object)prefabInfo != null && prefabInfo.Piece != null && prefabInfo.PieceTable != null) { vars = zdo.Vars; num = ((((ZDOVars)(ref vars)).GetCreator(default(PlayerID)) != default(PlayerID)) ? 1 : 0); } else { num = 0; } bool flag = (byte)num != 0; if (flag) { if (!ConfigBase<Config>.Instance.BuildPieces.DisableRainDamage.Value) { val2.Reset((Func<Expression<Func<WearNTear, bool>>>)(() => (WearNTear x) => x.m_noRoofWear), "C:\\repos\\Valheim.ServersideQoL\\ServersideQoL.PrefabConfigurator\\BuildPieceProcessor.cs", 24); } else if (val2.UpdateValue((Func<Expression<Func<WearNTear, bool>>>)(() => (WearNTear x) => x.m_noRoofWear), false, "C:\\repos\\Valheim.ServersideQoL\\ServersideQoL.PrefabConfigurator\\BuildPieceProcessor.cs", 25)) { val = (ProcessResult)(val | 8); } if (!ConfigBase<Config>.Instance.BuildPieces.MakeIndestructible.Value) { if (val2.UpdateResetValue((Func<Expression<Func<WearNTear, float>>>)(() => (WearNTear x) => x.m_health), "C:\\repos\\Valheim.ServersideQoL\\ServersideQoL.PrefabConfigurator\\BuildPieceProcessor.cs", 30)) { vars = zdo.Vars; ((ZDOVars)(ref vars)).RemoveHealth("C:\\repos\\Valheim.ServersideQoL\\ServersideQoL.PrefabConfigurator\\BuildPieceProcessor.cs", 31); } } else if (val2.UpdateValue((Func<Expression<Func<WearNTear, float>>>)(() => (WearNTear x) => x.m_health), -1f, "C:\\repos\\Valheim.ServersideQoL\\ServersideQoL.PrefabConfigurator\\BuildPieceProcessor.cs", 33)) { vars = zdo.Vars; ((ZDOVars)(ref vars)).SetHealth(-1f, "C:\\repos\\Valheim.ServersideQoL\\ServersideQoL.PrefabConfigurator\\BuildPieceProcessor.cs", 35); val = (ProcessResult)(val | 8); } if (prefabInfo.ZSyncTransform == null) { if (!ConfigBase<Config>.Instance.BuildPieces.EnableAsSupport.Value) { val2.Reset((Func<Expression<Func<WearNTear, bool>>>)(() => (WearNTear x) => x.m_supports), "C:\\repos\\Valheim.ServersideQoL\\ServersideQoL.PrefabConfigurator\\BuildPieceProcessor.cs", 42); } else if (val2.UpdateValue((Func<Expression<Func<WearNTear, bool>>>)(() => (WearNTear x) => x.m_supports), true, "C:\\repos\\Valheim.ServersideQoL\\ServersideQoL.PrefabConfigurator\\BuildPieceProcessor.cs", 43)) { val = (ProcessResult)(val | 8); } } } if ((flag ? (ConfigBase<Config>.Instance.BuildPieces.DisableSupportRequirements.Value & Config.BuildPiecesConfig.DisableSupportRequirementsOptions.PlayerBuilt) : (ConfigBase<Config>.Instance.BuildPieces.DisableSupportRequirements.Value & Config.BuildPiecesConfig.DisableSupportRequirementsOptions.World)) == Config.BuildPiecesConfig.DisableSupportRequirementsOptions.None) { val2.Reset((Func<Expression<Func<WearNTear, bool>>>)(() => (WearNTear x) => x.m_noSupportWear), "C:\\repos\\Valheim.ServersideQoL\\ServersideQoL.PrefabConfigurator\\BuildPieceProcessor.cs", 53); } else if (val2.UpdateValue((Func<Expression<Func<WearNTear, bool>>>)(() => (WearNTear x) => x.m_noSupportWear), false, "C:\\repos\\Valheim.ServersideQoL\\ServersideQoL.PrefabConfigurator\\BuildPieceProcessor.cs", 54)) { val = (ProcessResult)(val | 8); } return val; } } [Processor("53933a3a-e84b-44be-9ebf-3242d413f5fb", Priority = int.MinValue)] [RunBefore<PrefabProcessor>] public sealed class CartProcessor : Processor<CartProcessor.PrefabInfo> { public sealed record PrefabInfo(Vagon Vagon, Piece Piece, PieceTable PieceTable) : ProcessorPrefabInfo() { [CompilerGenerated] public override string ToString() { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append("PrefabInfo"); stringBuilder.Append(" { "); if (((ProcessorPrefabInfo)this).PrintMembers(stringBuilder)) { stringBuilder.Append(' '); } stringBuilder.Append('}'); return stringBuilder.ToString(); } [CompilerGenerated] protected override bool PrintMembers(StringBuilder builder) { if (((ProcessorPrefabInfo)this).PrintMembers(builder)) { builder.Append(", "); } builder.Append("Vagon = "); builder.Append(Vagon); builder.Append(", Piece = "); builder.Append(Piece); builder.Append(", PieceTable = "); builder.Append(PieceTable); return true; } [CompilerGenerated] public override int GetHashCode() { return ((((ProcessorPrefabInfo)this).GetHashCode() * -1521134295 + EqualityComparer<Vagon>.Default.GetHashCode(Vagon)) * -1521134295 + EqualityComparer<Piece>.Default.GetHashCode(Piece)) * -1521134295 + EqualityComparer<PieceTable>.Default.GetHashCode(PieceTable); } [CompilerGenerated] public sealed override bool Equals(ProcessorPrefabInfo? other) { return ((object)this).Equals((object?)other); } [CompilerGenerated] public bool Equals(PrefabInfo? other) { if ((object)this != other) { if (((ProcessorPrefabInfo)this).Equals((ProcessorPrefabInfo)(object)other) && EqualityComparer<Vagon>.Default.Equals(Vagon, other.Vagon) && EqualityComparer<Piece>.Default.Equals(Piece, other.Piece)) { return EqualityComparer<PieceTable>.Default.Equals(PieceTable, other.PieceTable); } return false; } return true; } [CompilerGenerated] private PrefabInfo(PrefabInfo original) : base((ProcessorPrefabInfo)(object)original) { Vagon = original.Vagon; Piece = original.Piece; PieceTable = original.PieceTable; } } public const string Id = "53933a3a-e84b-44be-9ebf-3242d413f5fb"; protected override ProcessResult Process(ServersideQoLZDO zdo, IReadOnlyList<Peer> peers, PrefabInfo prefabInfo) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) ProcessResult val = (ProcessResult)2; ZDOVars vars = zdo.Vars; if (((ZDOVars)(ref vars)).GetCreator(default(PlayerID)) == default(PlayerID)) { return val; } ComponentFieldAccessor<Vagon> val2 = zdo.Fields<Vagon>(); if (ConfigBase<Config>.Instance.Carts.ContentMassMultiplier.Value == 1f || float.IsNaN(ConfigBase<Config>.Instance.Carts.ContentMassMultiplier.Value)) { val2.Reset((Func<Expression<Func<Vagon, float>>>)(() => (Vagon x) => x.m_itemWeightMassFactor), "C:\\repos\\Valheim.ServersideQoL\\ServersideQoL.PrefabConfigurator\\CartProcessor.cs", 20); } else if (val2.UpdateValue((Func<Expression<Func<Vagon, float>>>)(() => (Vagon x) => x.m_itemWeightMassFactor), prefabInfo.Vagon.m_itemWeightMassFactor * ConfigBase<Config>.Instance.Carts.ContentMassMultiplier.Value, "C:\\repos\\Valheim.ServersideQoL\\ServersideQoL.PrefabConfigurator\\CartProcessor.cs", 21)) { val = (ProcessResult)(val | 8); } if (zdo.Fields<Piece>().UpdateValue((Func<Expression<Func<Piece, bool>>>)(() => (Piece x) => x.m_canBeRemoved), ConfigBase<Config>.Instance.Carts.DeconstructWithHammer.Value, "C:\\repos\\Valheim.ServersideQoL\\ServersideQoL.PrefabConfigurator\\CartProcessor.cs", 24)) { val = (ProcessResult)(val | 8); } return val; } } public sealed class Config : ConfigBase<Config> { public sealed class FireplacesConfig { public ConfigEntry<bool> MakeToggleable { get; } = ConfigBase<Config>.BindEx<bool>(cfg, section, false, "True to make all fireplaces/lightsources (including torches, braziers, etc.) toggleable.\r\nBEWARE: toggleable fireplaces/lightsources will be toggled off automatically by rain/heavy wind.", (IAcceptableValueBase<bool>)null, (Deprecated<Config>)null, "MakeToggleable"); public ConfigEntry<bool> InfiniteFuel { get; } = ConfigBase<Config>.BindEx<bool>(cfg, section, false, "True to make all fireplaces have infinite fuel", (IAcceptableValueBase<bool>)null, (Deprecated<Config>)null, "InfiniteFuel"); public FireplacesConfig(ConfigFile cfg, [CallerMemberName] string section = null) { } } public sealed class BuildPiecesConfig { [Flags] public enum DisableSupportRequirementsOptions { None = 0, PlayerBuilt = 1, World = 2 } public ConfigEntry<bool> DisableRainDamage { get; } = ConfigBase<Config>.BindEx<bool>(cfg, section, false, "True to prevent rain from damaging build pieces", (IAcceptableValueBase<bool>)null, (Deprecated<Config>)null, "DisableRainDamage"); public ConfigEntry<DisableSupportRequirementsOptions> DisableSupportRequirements { get; } = ConfigBase<Config>.BindEx<DisableSupportRequirementsOptions>(cfg, section, DisableSupportRequirementsOptions.None, "Ignore support requirements on build pieces", (IAcceptableValueBase<DisableSupportRequirementsOptions>)(object)AcceptableEnum<DisableSupportRequirementsOptions>.Default, (Deprecated<Config>)null, "DisableSupportRequirements"); public ConfigEntry<bool> MakeIndestructible { get; } = ConfigBase<Config>.BindEx<bool>(cfg, section, false, "True to make player-built pieces indestructible", (IAcceptableValueBase<bool>)null, (Deprecated<Config>)null, "MakeIndestructible"); public ConfigEntry<bool> EnableAsSupport { get; } = ConfigBase<Config>.BindEx<bool>(cfg, section, false, "True to make player-built pieces valid support.\r\nFor example, this will allow players to place chests or signs on other chests.", (IAcceptableValueBase<bool>)null, (Deprecated<Config>)null, "EnableAsSupport"); public BuildPiecesConfig(ConfigFile cfg, [CallerMemberName] string section = null) { } } public sealed class PlantsConfig { public ConfigEntry<float> GrowTimeMultiplier { get; } = ConfigBase<Config>.BindEx<float>(cfg, section, 1f, "Multiply plant grow time by this factor. 0 to make them grow almost instantly.", (IAcceptableValueBase<float>)null, (Deprecated<Config>)null, "GrowTimeMultiplier"); public ConfigEntry<float> SpaceRequirementMultiplier { get; } = ConfigBase<Config>.BindEx<float>(cfg, section, 1f, "Multiply plant space requirement by this factor. 0 to disable space requirements.", (IAcceptableValueBase<float>)null, (Deprecated<Config>)null, "SpaceRequirementMultiplier"); public ConfigEntry<bool> DontDestroyIfCantGrow { get; } = ConfigBase<Config>.BindEx<bool>(cfg, section, false, "True to keep plants that can't grow alive", (IAcceptableValueBase<bool>)null, (Deprecated<Config>)null, "DontDestroyIfCantGrow"); public PlantsConfig(ConfigFile cfg, [CallerMemberName] string section = null) { } } public sealed class CartsConfig { public ConfigEntry<float> ContentMassMultiplier { get; } = ConfigBase<Config>.BindEx<float>(cfg, section, 1f, "Multiplier for a carts content weight. E.g. set to 0 to ignore a cart's content weight", (IAcceptableValueBase<float>)null, (Deprecated<Config>)null, "ContentMassMultiplier"); public ConfigEntry<bool> DeconstructWithHammer { get; } = ConfigBase<Config>.BindEx<bool>(cfg, section, false, "If enabled, carts can be deconstructed with the build hammer", (IAcceptableValueBase<bool>)null, (Deprecated<Config>)null, "DeconstructWithHammer"); public CartsConfig(ConfigFile cfg, [CallerMemberName] string section = null) { } } public sealed class ShipsConfig { public ConfigEntry<bool> DeconstructWithHammer { get; } = ConfigBase<Config>.BindEx<bool>(cfg, section, false, "If enabled, ships can be deconstructed with the build hammer", (IAcceptableValueBase<bool>)null, (Deprecated<Config>)null, "DeconstructWithHammer"); public ShipsConfig(ConfigFile cfg, [CallerMemberName] string section = null) { } } public sealed class PrefabsConfig { public sealed class ComponentConfig { public required string Component { get; init; } public required bool Enabled { get; init; } = true; public required string[] PrefabNames { get; init; } = Array.Empty<string>(); public required Dictionary<string, object?> Fields { get; init; } } public sealed class Vector3Yaml { public float x { get; init; } public float y { get; init; } public float z { get; init; } } [CompilerGenerated] private List<ComponentConfig> <Entries>k__BackingField; private static readonly Dictionary<string, (Type Type, IReadOnlyDictionary<string, FieldInfo>)> __validComponents = new Dictionary<string, (Type, IReadOnlyDictionary<string, FieldInfo>)>(); public List<ComponentConfig> Entries { get { return <Entries>k__BackingField ?? (<Entries>k__BackingField = GetList()); } [CompilerGenerated] init { <Entries>k__BackingField = value; } } [YamlIgnore] public IReadOnlyDictionary<string, (Type Type, IReadOnlyDictionary<string, FieldInfo>)> ValidComponents => __validComponents; private static List<ComponentConfig> GetList() { HashSet<Type> validFieldTypes = new HashSet<Type> { typeof(int), typeof(float), typeof(bool), typeof(Vector3), typeof(string), typeof(GameObject), typeof(ItemDrop) }; List<ComponentConfig> list = new List<ComponentConfig>(); foreach (IGrouping<Type, (string, MonoBehaviour)> item in from x in Extensions[ZNetScene.instance].SelectMany((ZNetView x) => from c in ((Component)x).GetComponentsInChildren<MonoBehaviour>() where !(c is ZNetView) select (name: ((Object)x).name, component: c)) group x by ((object)x.component).GetType() into x orderby x.Key.Name select x) { Type key = item.Key; List<FieldInfo> list2 = (from x in key.GetFields(BindingFlags.Instance | BindingFlags.Public) where validFieldTypes.Contains(x.FieldType) select x).ToList(); if (list2.Count == 0) { continue; } if (!__validComponents.ContainsKey(key.Name)) { __validComponents.Add(key.Name, (key, list2.ToDictionary((FieldInfo x) => x.Name))); } foreach (var item2 in item) { var (text, component) = item2; list.Add(new ComponentConfig { Component = key.Name, Enabled = false, PrefabNames = new string[1] { text }, Fields = list2.ToDictionary((FieldInfo x) => x.Name, (FieldInfo x) => Serialize(x.GetValue(component))) }); } } return list; static object? Serialize(object? value) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) Object val = (Object)((value is Object) ? value : null); if (val != null) { return val.name; } if (value is Vector3 val2) { return new Vector3Yaml { x = val2.x, y = val2.y, z = val2.z }; } return value; } } } public override ConfigEntry<bool> Enabled { get; } = ConfigBase<Config>.BindEx<bool>(cfg, true, "Enables/disables the entire mod", (IAcceptableValueBase<bool>)null, (Deprecated<Config>)null, "Enabled"); public FireplacesConfig Fireplaces { get; } = new FireplacesConfig(cfg, "Fireplaces"); public BuildPiecesConfig BuildPieces { get; } = new BuildPiecesConfig(cfg, "BuildPieces"); public PlantsConfig Plants { get; } = new PlantsConfig(cfg, "Plants"); public CartsConfig Carts { get; } = new CartsConfig(cfg, "Carts"); public ShipsConfig Ships { get; } = new ShipsConfig(cfg, "Ships"); public YamlConfigEntry<PrefabsConfig> Prefabs { get; } = ConfigBase<Config>.BindYaml<PrefabsConfig>(cfg, "Prefabs"); public Config(ConfigFile cfg, Logger logger) : base(cfg, logger) { } } [Processor("8fbc8f94-481c-429a-b201-f4db85f772eb", Priority = int.MinValue)] [RunBefore<PrefabProcessor>] public sealed class FireplaceProcessor : Processor<ProcessorPrefabInfo<Fireplace>> { public const string Id = "8fbc8f94-481c-429a-b201-f4db85f772eb"; protected override ProcessResult Process(ServersideQoLZDO zdo, IReadOnlyList<Peer> peers, ProcessorPrefabInfo<Fireplace> prefabInfo) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) ZDOVars vars = zdo.Vars; if (((ZDOVars)(ref vars)).GetCreator(default(PlayerID)) == default(PlayerID)) { return (ProcessResult)2; } ProcessResult val = (ProcessResult)2; ComponentFieldAccessor<Fireplace> val2 = zdo.Fields<Fireplace>(); if (!ConfigBase<Config>.Instance.Fireplaces.MakeToggleable.Value) { val2.Reset((Func<Expression<Func<Fireplace, bool>>>)(() => (Fireplace x) => x.m_canTurnOff), "C:\\repos\\Valheim.ServersideQoL\\ServersideQoL.PrefabConfigurator\\FireplaceProcessor.cs", 18); } else if (val2.UpdateValue((Func<Expression<Func<Fireplace, bool>>>)(() => (Fireplace x) => x.m_canTurnOff), true, "C:\\repos\\Valheim.ServersideQoL\\ServersideQoL.PrefabConfigurator\\FireplaceProcessor.cs", 19)) { val = (ProcessResult)(val | 8); } if (!ConfigBase<Config>.Instance.Fireplaces.InfiniteFuel.Value) { val2.Reset((Func<Expression<Func<Fireplace, float>>>)(() => (Fireplace x) => x.m_secPerFuel), "C:\\repos\\Valheim.ServersideQoL\\ServersideQoL.PrefabConfigurator\\FireplaceProcessor.cs", 23).Reset((Func<Expression<Func<Fireplace, bool>>>)(() => (Fireplace x) => x.m_canRefill), "C:\\repos\\Valheim.ServersideQoL\\ServersideQoL.PrefabConfigurator\\FireplaceProcessor.cs", 23); } else { if (val2.UpdateValue((Func<Expression<Func<Fireplace, float>>>)(() => (Fireplace x) => x.m_secPerFuel), 0f, "C:\\repos\\Valheim.ServersideQoL\\ServersideQoL.PrefabConfigurator\\FireplaceProcessor.cs", 26)) { val = (ProcessResult)(val | 8); } if (val2.UpdateValue((Func<Expression<Func<Fireplace, bool>>>)(() => (Fireplace x) => x.m_canRefill), false, "C:\\repos\\Valheim.ServersideQoL\\ServersideQoL.PrefabConfigurator\\FireplaceProcessor.cs", 28)) { val = (ProcessResult)(val | 8); } vars = zdo.Vars; ((ZDOVars)(ref vars)).SetFuel(val2.GetFloat((Func<Expression<Func<Fireplace, float>>>)(() => (Fireplace x) => x.m_maxFuel), "C:\\repos\\Valheim.ServersideQoL\\ServersideQoL.PrefabConfigurator\\FireplaceProcessor.cs", 30), "C:\\repos\\Valheim.ServersideQoL\\ServersideQoL.PrefabConfigurator\\FireplaceProcessor.cs", 30); } return val; } } [Processor("74bb1f8b-b268-4264-b117-7ecae6957f74", Priority = int.MinValue)] [RunBefore<PrefabProcessor>] public sealed class PlantProcessor : Processor<ProcessorPrefabInfo<Plant>> { public const string Id = "74bb1f8b-b268-4264-b117-7ecae6957f74"; protected override ProcessResult Process(ServersideQoLZDO zdo, IReadOnlyList<Peer> peers, ProcessorPrefabInfo<Plant> prefabInfo) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0075: 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_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) ProcessResult val = (ProcessResult)2; ComponentFieldAccessor<Plant> val2 = zdo.Fields<Plant>(); if (ConfigBase<Config>.Instance.Plants.GrowTimeMultiplier.Value != 1f) { if (val2.UpdateValue((Func<Expression<Func<Plant, float>>>)(() => (Plant x) => x.m_growTime), prefabInfo.Component.m_growTime * ConfigBase<Config>.Instance.Plants.GrowTimeMultiplier.Value, "C:\\repos\\Valheim.ServersideQoL\\ServersideQoL.PrefabConfigurator\\PlantProcessor.cs", 16)) { val = (ProcessResult)(val | 8); } if (val2.UpdateValue((Func<Expression<Func<Plant, float>>>)(() => (Plant x) => x.m_growTimeMax), prefabInfo.Component.m_growTimeMax * ConfigBase<Config>.Instance.Plants.GrowTimeMultiplier.Value, "C:\\repos\\Valheim.ServersideQoL\\ServersideQoL.PrefabConfigurator\\PlantProcessor.cs", 18)) { val = (ProcessResult)(val | 8); } } if (ConfigBase<Config>.Instance.Plants.SpaceRequirementMultiplier.Value != 1f && val2.UpdateValue((Func<Expression<Func<Plant, float>>>)(() => (Plant x) => x.m_growRadius), prefabInfo.Component.m_growRadius * ConfigBase<Config>.Instance.Plants.SpaceRequirementMultiplier.Value, "C:\\repos\\Valheim.ServersideQoL\\ServersideQoL.PrefabConfigurator\\PlantProcessor.cs", 23)) { val = (ProcessResult)(val | 8); } if (!ConfigBase<Config>.Instance.Plants.DontDestroyIfCantGrow.Value) { val2.Reset((Func<Expression<Func<Plant, bool>>>)(() => (Plant x) => x.m_destroyIfCantGrow), "C:\\repos\\Valheim.ServersideQoL\\ServersideQoL.PrefabConfigurator\\PlantProcessor.cs", 30); } else if (val2.UpdateValue((Func<Expression<Func<Plant, bool>>>)(() => (Plant x) => x.m_destroyIfCantGrow), false, "C:\\repos\\Valheim.ServersideQoL\\ServersideQoL.PrefabConfigurator\\PlantProcessor.cs", 31)) { val = (ProcessResult)(val | 8); } return val; } } [BepInPlugin("ArgusMagnus.ServersideQoL.PrefabConfigurator", "ServersideQoL.PrefabConfigurator", "2.3.0")] public sealed class PrefabConfiguratorPlugin : ServersideQoLPluginBase<PrefabConfiguratorPlugin, Config> { public const string Author = "ArgusMagnus"; public const string PluginName = "ServersideQoL.PrefabConfigurator"; public const string PluginGuid = "ArgusMagnus.ServersideQoL.PrefabConfigurator"; public const string PluginVersion = "2.3.0"; public const string PluginInformationalVersion = "2.3.0"; private DateTimeOffset BuildTimestamp { get; } = new DateTimeOffset(639273810401337777L, default(TimeSpan)); protected override Config CreateConfigSingleton(ConfigFile configFile, Logger logger) { return new Config(configFile, logger); } protected override void RegisterProcessors(IProcessorCollection processors) { processors.Add<PrefabProcessor>().Add<FireplaceProcessor>().Add<BuildPieceProcessor>() .Add<PlantProcessor>() .Add<CartProcessor>() .Add<ShipProcessor>(); } private void Awake() { } } [Processor("d597c8f7-129e-4c43-901a-20cea6520f14", Priority = int.MinValue)] public sealed class PrefabProcessor : Processor<PrefabProcessor.PrefabInfo> { public sealed record PrefabInfo : ProcessorPrefabInfo { internal bool Initialized { get; set; } internal bool Skip { get; set; } internal IReadOnlyList<(int, int, bool)>? IntValues { get; set; } internal IReadOnlyList<(int, float, bool)>? FloatValues { get; set; } internal IReadOnlyList<(int, Vector3, bool)>? Vector3Values { get; set; } internal IReadOnlyList<(int, string, bool)>? StringValues { get; set; } [CompilerGenerated] public override string ToString() { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append("PrefabInfo"); stringBuilder.Append(" { "); if (((ProcessorPrefabInfo)this).PrintMembers(stringBuilder)) { stringBuilder.Append(' '); } stringBuilder.Append('}'); return stringBuilder.ToString(); } [CompilerGenerated] protected override bool PrintMembers(StringBuilder builder) { return ((ProcessorPrefabInfo)this).PrintMembers(builder); } [CompilerGenerated] public override int GetHashCode() { return (((((((ProcessorPrefabInfo)this).GetHashCode() * -1521134295 + EqualityComparer<bool>.Default.GetHashCode(Initialized)) * -1521134295 + EqualityComparer<bool>.Default.GetHashCode(Skip)) * -1521134295 + EqualityComparer<IReadOnlyList<(int, int, bool)>>.Default.GetHashCode(IntValues)) * -1521134295 + EqualityComparer<IReadOnlyList<(int, float, bool)>>.Default.GetHashCode(FloatValues)) * -1521134295 + EqualityComparer<IReadOnlyList<(int, Vector3, bool)>>.Default.GetHashCode(Vector3Values)) * -1521134295 + EqualityComparer<IReadOnlyList<(int, string, bool)>>.Default.GetHashCode(StringValues); } [CompilerGenerated] public sealed override bool Equals(ProcessorPrefabInfo? other) { return ((object)this).Equals((object?)other); } [CompilerGenerated] public bool Equals(PrefabInfo? other) { if ((object)this != other) { if (((ProcessorPrefabInfo)this).Equals((ProcessorPrefabInfo)(object)other) && EqualityComparer<bool>.Default.Equals(Initialized, other.Initialized) && EqualityComparer<bool>.Default.Equals(Skip, other.Skip) && EqualityComparer<IReadOnlyList<(int, int, bool)>>.Default.Equals(IntValues, other.IntValues) && EqualityComparer<IReadOnlyList<(int, float, bool)>>.Default.Equals(FloatValues, other.FloatValues) && EqualityComparer<IReadOnlyList<(int, Vector3, bool)>>.Default.Equals(Vector3Values, other.Vector3Values)) { return EqualityComparer<IReadOnlyList<(int, string, bool)>>.Default.Equals(StringValues, other.StringValues); } return false; } return true; } [CompilerGenerated] private PrefabInfo(PrefabInfo original) : base((ProcessorPrefabInfo)(object)original) { Initialized = original.Initialized; Skip = original.Skip; IntValues = original.IntValues; FloatValues = original.FloatValues; Vector3Values = original.Vector3Values; StringValues = original.StringValues; } public PrefabInfo() { } } public const string Id = "d597c8f7-129e-4c43-901a-20cea6520f14"; private readonly HashSet<PrefabInfo> _prefabInfos = new HashSet<PrefabInfo>(); protected override void Initialize() { ConfigBase<Config>.Instance.Prefabs.ValueChanged -= OnConfigChanged; ConfigBase<Config>.Instance.Prefabs.ValueChanged += OnConfigChanged; } protected override ProcessResult Process(ServersideQoLZDO zdo, IReadOnlyList<Peer> peers, PrefabInfo prefabInfo) { //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: 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_0214: 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_0217: Unknown result type (might be due to invalid IL or missing references) if (!prefabInfo.Initialized) { prefabInfo.Initialized = true; _prefabInfos.Add(prefabInfo); if (ConfigBase<Config>.Instance.Prefabs.IsDefault) { return (ProcessResult)2; } Initialize(zdo, prefabInfo); } if (prefabInfo.Skip || zdo.IsModCreator()) { return (ProcessResult)2; } zdo.SetComponentHasFields(); ProcessResult val = (ProcessResult)2; foreach (var item in prefabInfo.IntValues ?? Array.Empty<(int, int, bool)>()) { var (num, num2, _) = item; if (item.Item3 ? zdo.ZDO.RemoveInt(num) : ZDOExtraData.Set(zdo.ZDO.m_uid, num, num2)) { val = (ProcessResult)(val | 8); } } foreach (var item2 in prefabInfo.FloatValues ?? Array.Empty<(int, float, bool)>()) { var (num3, num4, _) = item2; if (item2.Item3 ? zdo.ZDO.RemoveFloat(num3) : ZDOExtraData.Set(zdo.ZDO.m_uid, num3, num4)) { val = (ProcessResult)(val | 8); } } foreach (var item3 in prefabInfo.Vector3Values ?? Array.Empty<(int, Vector3, bool)>()) { var (num5, val2, _) = item3; if (item3.Item3 ? zdo.ZDO.RemoveVec3(num5) : ZDOExtraData.Set(zdo.ZDO.m_uid, num5, val2)) { val = (ProcessResult)(val | 8); } } foreach (var item4 in prefabInfo.StringValues ?? Array.Empty<(int, string, bool)>()) { var (num6, text, _) = item4; if (item4.Item3 ? zdo.ZDO.RemoveString(num6) : ZDOExtraData.Set(zdo.ZDO.m_uid, num6, text)) { val = (ProcessResult)(val | 8); } } return val; } private void OnConfigChanged(YamlConfigEntry<Config.PrefabsConfig> obj) { foreach (PrefabInfo prefabInfo in _prefabInfos) { prefabInfo.Initialized = false; } } private void Initialize(ServersideQoLZDO zdo, PrefabInfo prefabInfo) { //IL_06eb: 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_07ac: Unknown result type (might be due to invalid IL or missing references) //IL_07b1: Unknown result type (might be due to invalid IL or missing references) //IL_05ba: Unknown result type (might be due to invalid IL or missing references) //IL_05bf: Unknown result type (might be due to invalid IL or missing references) //IL_05ce: Unknown result type (might be due to invalid IL or missing references) //IL_05d0: Unknown result type (might be due to invalid IL or missing references) //IL_0604: Unknown result type (might be due to invalid IL or missing references) List<(int, int, bool)> list = null; List<(int, float, bool)> list2 = null; List<(int, Vector3, bool)> list3 = null; List<(int, string, bool)> list4 = null; Vector3 val3 = default(Vector3); foreach (Config.PrefabsConfig.ComponentConfig entry in ConfigBase<Config>.Instance.Prefabs.Value.Entries) { if (!entry.Enabled) { continue; } if (!ConfigBase<Config>.Instance.Prefabs.Value.ValidComponents.TryGetValue(entry.Component, out (Type, IReadOnlyDictionary<string, FieldInfo>) value)) { ((Processor)this).Logger.LogWarning((object)("Invalid component: " + entry.Component)); continue; } IReadOnlyDictionary<string, FieldInfo> readOnlyDictionary; Type key; (key, readOnlyDictionary) = value; if (!Processor.GetPrefabInfo(zdo).Components.TryGetValue(key, out var value2)) { continue; } MonoBehaviour val = value2[0]; key = ((object)val).GetType(); string[] prefabNames = entry.PrefabNames; bool flag = prefabNames == null || prefabNames.Length <= 0; if (!flag) { string[] prefabNames2 = entry.PrefabNames; foreach (string text in prefabNames2) { int stableHashCode = StringExtensionMethods.GetStableHashCode(text.Trim()); if (stableHashCode != zdo.ZDO.GetPrefab()) { if (ZNetScene.instance.GetPrefab(stableHashCode) == null) { ((Processor)this).Logger.LogWarning((object)("Invalid prefab name '" + text + "' for component '" + entry.Component + "'")); } continue; } flag = true; break; } } if (!flag) { continue; } bool flag2 = false; foreach (var (text3, obj2) in entry.Fields) { if (!readOnlyDictionary.TryGetValue(text3, out var value3)) { ((Processor)this).Logger.LogWarning((object)("Invalid field: " + entry.Component + "." + text3)); continue; } bool flag3 = false; if (value3.FieldType == typeof(int)) { string text4 = (obj2 as string)?.Trim(); if (!string.IsNullOrEmpty(text4)) { char c = '\0'; int num = 0; bool flag4; switch (text4[0]) { case '*': case '+': case '-': case '/': flag4 = true; break; default: flag4 = false; break; } if (flag4) { c = text4[0]; } if (flag3 = int.TryParse(text4.AsSpan((c != '\0') ? 1 : 0), out var result)) { num = (int)value3.GetValue(val); result = c switch { '+' => num + result, '-' => num - result, '*' => num * result, '/' => num / result, _ => result, }; bool flag5 = result == num; if (!flag5) { flag2 = true; } (list ?? (list = new List<(int, int, bool)>())).Add((StringExtensionMethods.GetStableHashCode(key.Name + "." + text3), result, flag5)); } } } else if (value3.FieldType == typeof(float)) { string text5 = (obj2 as string)?.Trim(); if (!string.IsNullOrEmpty(text5)) { char c2 = '\0'; float num2 = 0f; bool flag4; switch (text5[0]) { case '*': case '+': case '-': case '/': flag4 = true; break; default: flag4 = false; break; } if (flag4) { c2 = text5[0]; } if (flag3 = float.TryParse(text5.AsSpan((c2 != '\0') ? 1 : 0), out var result2)) { num2 = (float)value3.GetValue(val); result2 = c2 switch { '+' => num2 + result2, '-' => num2 - result2, '*' => num2 * result2, '/' => num2 / result2, _ => result2, }; bool flag6 = result2 == num2; if (!flag6) { flag2 = true; } (list2 ?? (list2 = new List<(int, float, bool)>())).Add((StringExtensionMethods.GetStableHashCode(key.Name + "." + text3), result2, flag6)); } } } else if (value3.FieldType == typeof(bool)) { string value4 = (obj2 as string)?.Trim(); if (flag3 = bool.TryParse(value4, out var result3)) { bool flag7 = (bool)value3.GetValue(val); bool flag8 = result3 == flag7; if (!flag8) { flag2 = true; } (list ?? (list = new List<(int, int, bool)>())).Add((StringExtensionMethods.GetStableHashCode(key.Name + "." + text3), result3 ? 1 : 0, flag8)); } } else if (value3.FieldType == typeof(Vector3)) { if (obj2 is Dictionary<string, object> dictionary && dictionary.TryGetValue("x", out var value5) && float.TryParse(value5 as string, out var result4) && dictionary.TryGetValue("y", out value5) && float.TryParse(value5 as string, out var result5) && dictionary.TryGetValue("z", out value5) && float.TryParse(value5 as string, out var result6)) { flag3 = true; Vector3 val2 = (Vector3)value3.GetValue(val); ((Vector3)(ref val3))..ctor(result4, result5, result6); bool flag9 = val3 == val2; if (!flag9) { flag2 = true; } (list3 ?? (list3 = new List<(int, Vector3, bool)>())).Add((StringExtensionMethods.GetStableHashCode(key.Name + "." + text3), val3, flag9)); } } else if (value3.FieldType == typeof(string)) { if (obj2 is string text6) { flag3 = true; string text7 = (string)value3.GetValue(val); bool flag10 = text6 == text7; if (!flag10) { flag2 = true; } (list4 ?? (list4 = new List<(int, string, bool)>())).Add((StringExtensionMethods.GetStableHashCode(key.Name + "." + text3), text6, flag10)); } } else if (value3.FieldType == typeof(GameObject)) { string text9; if (obj2 is string text8 && ZNetScene.instance.GetPrefab(text9 = text8.Trim()) != null) { flag3 = true; GameObject val4 = (GameObject)value3.GetValue(val); string text10 = (((int)val4 != 0) ? ((Object)val4).name : null) ?? ""; bool flag11 = text9 == text10; if (!flag11) { flag2 = true; } (list4 ?? (list4 = new List<(int, string, bool)>())).Add((StringExtensionMethods.GetStableHashCode(key.Name + "." + text3), text9, flag11)); } } else if (value3.FieldType == typeof(ItemDrop)) { if (obj2 is string text11) { string text12; GameObject prefab = ZNetScene.instance.GetPrefab(text12 = text11.Trim()); if (((prefab != null) ? prefab.GetComponent<ItemDrop>() : null) != null) { flag3 = true; ItemDrop val5 = (ItemDrop)value3.GetValue(val); string text13 = (((int)val5 != 0) ? ((Object)val5).name : null) ?? ""; (list4 ?? (list4 = new List<(int, string, bool)>())).Add((StringExtensionMethods.GetStableHashCode(key.Name + "." + text3), text12, text12 == text13)); } } } else { ((Processor)this).Logger.LogWarning((object)("Unsupported field type: " + value3.FieldType.Name + " (" + entry.Component + "." + text3 + ")")); flag3 = false; } if (!flag3) { ((Processor)this).Logger.LogWarning((object)$"Failed to parse field value as {value3.FieldType.Name}: {entry.Component}.{text3} = {obj2}"); } } if (flag2) { if (list == null) { list = new List<(int, int, bool)>(); } list.Add((StringExtensionMethods.GetStableHashCode("HasFields" + key.Name), 1, false)); } } prefabInfo.IntValues = list; prefabInfo.FloatValues = list2; prefabInfo.Vector3Values = list3; prefabInfo.StringValues = list4; prefabInfo.Skip = list == null && list2 == null && list3 == null && list4 == null; if (!prefabInfo.Skip) { ((Processor)this).Logger.LogDiagnosticInfo((object)("Using config entries for " + ((ProcessorPrefabInfo)prefabInfo).PrefabInfo.PrefabName)); } } } [Processor("30b54643-5490-4e55-aca9-d9ad7b634398", Priority = int.MinValue)] [RunBefore<PrefabProcessor>] public sealed class ShipProcessor : Processor<ShipProcessor.PrefabInfo> { public sealed record PrefabInfo(Ship Ship, Piece Piece, PieceTable PieceTable) : ProcessorPrefabInfo() { [CompilerGenerated] public override string ToString() { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append("PrefabInfo"); stringBuilder.Append(" { "); if (((ProcessorPrefabInfo)this).PrintMembers(stringBuilder)) { stringBuilder.Append(' '); } stringBuilder.Append('}'); return stringBuilder.ToString(); } [CompilerGenerated] protected override bool PrintMembers(StringBuilder builder) { if (((ProcessorPrefabInfo)this).PrintMembers(builder)) { builder.Append(", "); } builder.Append("Ship = "); builder.Append(Ship); builder.Append(", Piece = "); builder.Append(Piece); builder.Append(", PieceTable = "); builder.Append(PieceTable); return true; } [CompilerGenerated] public override int GetHashCode() { return ((((ProcessorPrefabInfo)this).GetHashCode() * -1521134295 + EqualityComparer<Ship>.Default.GetHashCode(Ship)) * -1521134295 + EqualityComparer<Piece>.Default.GetHashCode(Piece)) * -1521134295 + EqualityComparer<PieceTable>.Default.GetHashCode(PieceTable); } [CompilerGenerated] public sealed override bool Equals(ProcessorPrefabInfo? other) { return ((object)this).Equals((object?)other); } [CompilerGenerated] public bool Equals(PrefabInfo? other) { if ((object)this != other) { if (((ProcessorPrefabInfo)this).Equals((ProcessorPrefabInfo)(object)other) && EqualityComparer<Ship>.Default.Equals(Ship, other.Ship) && EqualityComparer<Piece>.Default.Equals(Piece, other.Piece)) { return EqualityComparer<PieceTable>.Default.Equals(PieceTable, other.PieceTable); } return false; } return true; } [CompilerGenerated] private PrefabInfo(PrefabInfo original) : base((ProcessorPrefabInfo)(object)original) { Ship = original.Ship; Piece = original.Piece; PieceTable = original.PieceTable; } } public const string Id = "30b54643-5490-4e55-aca9-d9ad7b634398"; protected override ProcessResult Process(ServersideQoLZDO zdo, IReadOnlyList<Peer> peers, PrefabInfo prefabInfo) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) ProcessResult val = (ProcessResult)2; ZDOVars vars = zdo.Vars; if (((ZDOVars)(ref vars)).GetCreator(default(PlayerID)) == default(PlayerID)) { return val; } if (zdo.Fields<Piece>().UpdateValue((Func<Expression<Func<Piece, bool>>>)(() => (Piece x) => x.m_canBeRemoved), ConfigBase<Config>.Instance.Ships.DeconstructWithHammer.Value, "C:\\repos\\Valheim.ServersideQoL\\ServersideQoL.PrefabConfigurator\\ShipProcessor.cs", 17)) { val = (ProcessResult)(val | 8); } return val; } } }