using System; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BepInEx.Configuration; using Microsoft.CodeAnalysis; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyCompany("Nytra")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("3.0.1.0")] [assembly: AssemblyInformationalVersion("3.0.1+13cb696b14da8840cc9c79e41e9701df3b671dda")] [assembly: AssemblyProduct("InterprocessLib.BepInEx_Extensions")] [assembly: AssemblyTitle("InterprocessLib.BepInEx_Extensions")] [assembly: AssemblyVersion("3.0.1.0")] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class IsUnmanagedAttribute : Attribute { } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace InterprocessLib { public static class BepInExExtensions { private static Dictionary _syncStates = new Dictionary(); public static void SyncConfigEntry(this Messenger messenger, ConfigEntry configEntry) where T : unmanaged { ConfigEntry configEntry2 = configEntry; Messenger messenger2 = messenger; messenger2.ReceiveConfigEntry(configEntry2); _syncStates[(ConfigEntryBase)(object)configEntry2] = true; configEntry2.SettingChanged += delegate { if (_syncStates.TryGetValue((ConfigEntryBase)(object)configEntry2, out var value) && value) { messenger2.SendConfigEntry(configEntry2); } }; } public static void SyncConfigEntry(this Messenger messenger, ConfigEntry configEntry) { ConfigEntry configEntry2 = configEntry; Messenger messenger2 = messenger; messenger2.ReceiveConfigEntry(configEntry2); _syncStates[(ConfigEntryBase)(object)configEntry2] = true; configEntry2.SettingChanged += delegate { if (_syncStates.TryGetValue((ConfigEntryBase)(object)configEntry2, out var value) && value) { messenger2.SendConfigEntry(configEntry2); } }; } public static void SendConfigEntry(this Messenger messenger, ConfigEntry configEntry) where T : unmanaged { messenger.SendValue(((ConfigEntryBase)configEntry).Definition.Key, configEntry.Value); } public static void SendConfigEntry(this Messenger messenger, ConfigEntry configEntry) { messenger.SendString(((ConfigEntryBase)configEntry).Definition.Key, configEntry.Value); } public static void ReceiveConfigEntry(this Messenger messenger, ConfigEntry configEntry) where T : unmanaged { ConfigEntry configEntry2 = configEntry; messenger.ReceiveValue(((ConfigEntryBase)configEntry2).Definition.Key, (Action)delegate(T val) { _syncStates[(ConfigEntryBase)(object)configEntry2] = false; configEntry2.Value = val; _syncStates[(ConfigEntryBase)(object)configEntry2] = true; }); } public static void ReceiveConfigEntry(this Messenger messenger, ConfigEntry configEntry) { ConfigEntry configEntry2 = configEntry; messenger.ReceiveString(((ConfigEntryBase)configEntry2).Definition.Key, (Action)delegate(string? str) { _syncStates[(ConfigEntryBase)(object)configEntry2] = false; configEntry2.Value = str; _syncStates[(ConfigEntryBase)(object)configEntry2] = true; }); } } }