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 Mirage v81 v1.29.1
Mirage.Compatibility.dll
Decompiled 8 hours agousing System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security.Permissions; using <StartupCode$Mirage-Compatibility>.$Mirage.Compatibility; using BepInEx.Bootstrap; using BepInEx.Configuration; using LethalConfig; using LethalConfig.AutoConfig; using LethalConfig.ConfigItems; using LethalSettings; using LethalSettings.UI; using LethalSettings.UI.Components; using LobbyCompatibility.Enums; using LobbyCompatibility.Features; using Microsoft.FSharp.Collections; using Microsoft.FSharp.Control; using Microsoft.FSharp.Core; using On.LethalSettings.UI; using UnityEngine; [assembly: FSharpInterfaceDataVersion(2, 0, 0)] [assembly: IgnoresAccessChecksTo("AmazingAssets.TerrainToMesh")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp-firstpass")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: IgnoresAccessChecksTo("ClientNetworkTransform")] [assembly: IgnoresAccessChecksTo("DissonanceVoip")] [assembly: IgnoresAccessChecksTo("Facepunch Transport for Netcode for GameObjects")] [assembly: IgnoresAccessChecksTo("Facepunch.Steamworks.Win64")] [assembly: IgnoresAccessChecksTo("LethalConfig")] [assembly: IgnoresAccessChecksTo("LethalSettings")] [assembly: IgnoresAccessChecksTo("Unity.AI.Navigation")] [assembly: IgnoresAccessChecksTo("Unity.Animation.Rigging")] [assembly: IgnoresAccessChecksTo("Unity.Animation.Rigging.DocCodeExamples")] [assembly: IgnoresAccessChecksTo("Unity.Burst")] [assembly: IgnoresAccessChecksTo("Unity.Burst.Unsafe")] [assembly: IgnoresAccessChecksTo("Unity.Collections")] [assembly: IgnoresAccessChecksTo("Unity.Collections.LowLevel.ILSupport")] [assembly: IgnoresAccessChecksTo("Unity.InputSystem")] [assembly: IgnoresAccessChecksTo("Unity.InputSystem.ForUI")] [assembly: IgnoresAccessChecksTo("Unity.Jobs")] [assembly: IgnoresAccessChecksTo("Unity.Mathematics")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.Common")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.MetricTypes")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStats")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Component")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Configuration")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Implementation")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsReporting")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetworkProfiler.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetworkSolutionInterface")] [assembly: IgnoresAccessChecksTo("Unity.Netcode.Components")] [assembly: IgnoresAccessChecksTo("Unity.Netcode.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.Networking.Transport")] [assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Csg")] [assembly: IgnoresAccessChecksTo("Unity.ProBuilder")] [assembly: IgnoresAccessChecksTo("Unity.ProBuilder.KdTree")] [assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Poly2Tri")] [assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Stl")] [assembly: IgnoresAccessChecksTo("Unity.Profiling.Core")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.ShaderLibrary")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.HighDefinition.Config.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.HighDefinition.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary")] [assembly: IgnoresAccessChecksTo("Unity.Services.Authentication")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Analytics")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Configuration")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Device")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Environments")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Environments.Internal")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Internal")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Networking")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Registration")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Scheduler")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Telemetry")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Threading")] [assembly: IgnoresAccessChecksTo("Unity.Services.QoS")] [assembly: IgnoresAccessChecksTo("Unity.Services.Relay")] [assembly: IgnoresAccessChecksTo("Unity.TextMeshPro")] [assembly: IgnoresAccessChecksTo("Unity.Timeline")] [assembly: IgnoresAccessChecksTo("Unity.VisualEffectGraph.Runtime")] [assembly: IgnoresAccessChecksTo("UnityEngine.ARModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.NVIDIAModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.UI")] [assembly: AssemblyCompany("Mirage.Compatibility")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+7a8d94cfcb6c39f5419fcc3491e37e5605b1284b")] [assembly: AssemblyProduct("Mirage.Compatibility")] [assembly: AssemblyTitle("Mirage.Compatibility")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [CompilationMapping(/*Could not decode attribute arguments.*/)] public static class AssemblyInfo { } namespace <StartupCode$Mirage-Compatibility> { internal static class $AssemblyInfo { } } namespace Mirage.Compatibility { [CompilationMapping(/*Could not decode attribute arguments.*/)] public static class Main { [Serializable] internal sealed class initGeneralLethalConfig@27 : FSharpFunc<Unit, Unit> { public Assembly assembly; public ConfigFile configFile; [CompilerGenerated] [DebuggerNonUserCode] internal initGeneralLethalConfig@27(Assembly assembly, ConfigFile configFile) { this.assembly = assembly; this.configFile = configFile; } public override Unit Invoke(Unit unitVar) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) List<ConfigFileAssemblyPair> customConfigFiles = LethalConfigManager.CustomConfigFiles; ConfigFileAssemblyPair item = default(ConfigFileAssemblyPair); ((ConfigFileAssemblyPair)(ref item)).ConfigFile = configFile; ((ConfigFileAssemblyPair)(ref item)).Assembly = assembly; customConfigFiles.Add(item); return null; } } [Serializable] internal sealed class initEnemiesLethalConfig@38 : FSharpFunc<Unit, Unit> { public Assembly assembly; public FSharpList<ConfigEntry<bool>> enemies; [CompilerGenerated] [DebuggerNonUserCode] internal initEnemiesLethalConfig@38(Assembly assembly, FSharpList<ConfigEntry<bool>> enemies) { this.assembly = assembly; this.enemies = enemies; } public override Unit Invoke(Unit unitVar) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown enemiesInitialized = enemies.TailOrNull != null; FSharpList<ConfigEntry<bool>> val = enemies; for (FSharpList<ConfigEntry<bool>> tailOrNull = val.TailOrNull; tailOrNull != null; tailOrNull = val.TailOrNull) { ConfigEntry<bool> headOrDefault = val.HeadOrDefault; BoolCheckBoxConfigItem val2 = new BoolCheckBoxConfigItem(headOrDefault); bool flag = LethalConfigManager.AddConfigItemForAssembly((BaseConfigItem)(object)val2, assembly); val = tailOrNull; } return null; } } [Serializable] internal sealed class initLobbyCompatibility@47 : FSharpFunc<Unit, Unit> { public string pluginName; public string pluginVersion; [CompilerGenerated] [DebuggerNonUserCode] internal initLobbyCompatibility@47(string pluginName, string pluginVersion) { this.pluginName = pluginName; this.pluginVersion = pluginVersion; } public override Unit Invoke(Unit unitVar) { PluginHelper.RegisterPlugin(pluginName, Version.Parse(pluginVersion), (CompatibilityLevel)2, (VersionStrictness)2); return null; } } [Serializable] [CompilationMapping(/*Could not decode attribute arguments.*/)] public sealed class LethalSettingsArgs { [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal string pluginName@; [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal string pluginId@; [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal string pluginVersion@; [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal FSharpFunc<Unit, float> getLocalPlayerVolume@; [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal FSharpFunc<float, Unit> setLocalPlayerVolume@; [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal FSharpFunc<Unit, bool> getNeverDeleteRecordings@; [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal FSharpFunc<bool, Unit> setNeverDeleteRecordings@; [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal FSharpFunc<Unit, bool> getAllowRecordVoice@; [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal FSharpFunc<bool, Unit> setAllowRecordVoice@; [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal FSharpFunc<Unit, bool> getMuteVoiceMimic@; [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal FSharpFunc<bool, Unit> setMuteVoiceMimic@; [CompilationMapping(/*Could not decode attribute arguments.*/)] public string pluginName { [CompilerGenerated] [DebuggerNonUserCode] get { return pluginName@; } } [CompilationMapping(/*Could not decode attribute arguments.*/)] public string pluginId { [CompilerGenerated] [DebuggerNonUserCode] get { return pluginId@; } } [CompilationMapping(/*Could not decode attribute arguments.*/)] public string pluginVersion { [CompilerGenerated] [DebuggerNonUserCode] get { return pluginVersion@; } } [CompilationMapping(/*Could not decode attribute arguments.*/)] public FSharpFunc<Unit, float> getLocalPlayerVolume { [CompilerGenerated] [DebuggerNonUserCode] get { return getLocalPlayerVolume@; } } [CompilationMapping(/*Could not decode attribute arguments.*/)] public FSharpFunc<float, Unit> setLocalPlayerVolume { [CompilerGenerated] [DebuggerNonUserCode] get { return setLocalPlayerVolume@; } } [CompilationMapping(/*Could not decode attribute arguments.*/)] public FSharpFunc<Unit, bool> getNeverDeleteRecordings { [CompilerGenerated] [DebuggerNonUserCode] get { return getNeverDeleteRecordings@; } } [CompilationMapping(/*Could not decode attribute arguments.*/)] public FSharpFunc<bool, Unit> setNeverDeleteRecordings { [CompilerGenerated] [DebuggerNonUserCode] get { return setNeverDeleteRecordings@; } } [CompilationMapping(/*Could not decode attribute arguments.*/)] public FSharpFunc<Unit, bool> getAllowRecordVoice { [CompilerGenerated] [DebuggerNonUserCode] get { return getAllowRecordVoice@; } } [CompilationMapping(/*Could not decode attribute arguments.*/)] public FSharpFunc<bool, Unit> setAllowRecordVoice { [CompilerGenerated] [DebuggerNonUserCode] get { return setAllowRecordVoice@; } } [CompilationMapping(/*Could not decode attribute arguments.*/)] public FSharpFunc<Unit, bool> getMuteVoiceMimic { [CompilerGenerated] [DebuggerNonUserCode] get { return getMuteVoiceMimic@; } } [CompilationMapping(/*Could not decode attribute arguments.*/)] public FSharpFunc<bool, Unit> setMuteVoiceMimic { [CompilerGenerated] [DebuggerNonUserCode] get { return setMuteVoiceMimic@; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(LethalSettingsArgs))] public LethalSettingsArgs(string pluginName, string pluginId, string pluginVersion, FSharpFunc<Unit, float> getLocalPlayerVolume, FSharpFunc<float, Unit> setLocalPlayerVolume, FSharpFunc<Unit, bool> getNeverDeleteRecordings, FSharpFunc<bool, Unit> setNeverDeleteRecordings, FSharpFunc<Unit, bool> getAllowRecordVoice, FSharpFunc<bool, Unit> setAllowRecordVoice, FSharpFunc<Unit, bool> getMuteVoiceMimic, FSharpFunc<bool, Unit> setMuteVoiceMimic) { pluginName@ = pluginName; pluginId@ = pluginId; pluginVersion@ = pluginVersion; getLocalPlayerVolume@ = getLocalPlayerVolume; setLocalPlayerVolume@ = setLocalPlayerVolume; getNeverDeleteRecordings@ = getNeverDeleteRecordings; setNeverDeleteRecordings@ = setNeverDeleteRecordings; getAllowRecordVoice@ = getAllowRecordVoice; setAllowRecordVoice@ = setAllowRecordVoice; getMuteVoiceMimic@ = getMuteVoiceMimic; setMuteVoiceMimic@ = setMuteVoiceMimic; } [CompilerGenerated] public override string ToString() { return ExtraTopLevelOperators.PrintFormatToString<FSharpFunc<LethalSettingsArgs, string>>((PrintfFormat<FSharpFunc<LethalSettingsArgs, string>, Unit, string, string>)(object)new PrintfFormat<FSharpFunc<LethalSettingsArgs, string>, Unit, string, string, LethalSettingsArgs>("%+A")).Invoke(this); } } [Serializable] [SpecialName] [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] [CompilationMapping(/*Could not decode attribute arguments.*/)] internal sealed class initLethalSettings@85-1 { public LethalSettingsArgs settings; public initLethalSettings@85-1(LethalSettingsArgs settings) { this.settings = settings; base..ctor(); } internal void Invoke(SliderComponent _arg1, float value) { settings.setLocalPlayerVolume@.Invoke(value); } } [Serializable] [SpecialName] [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] [CompilationMapping(/*Could not decode attribute arguments.*/)] internal sealed class initLethalSettings@90-2 { public LethalSettingsArgs settings; public initLethalSettings@90-2(LethalSettingsArgs settings) { this.settings = settings; base..ctor(); } internal void Invoke(ToggleComponent _arg2, bool value) { settings.setNeverDeleteRecordings@.Invoke(value); } } [Serializable] [SpecialName] [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] [CompilationMapping(/*Could not decode attribute arguments.*/)] internal sealed class initLethalSettings@95-3 { public LethalSettingsArgs settings; public initLethalSettings@95-3(LethalSettingsArgs settings) { this.settings = settings; base..ctor(); } internal void Invoke(ToggleComponent _arg3, bool value) { settings.setAllowRecordVoice@.Invoke(value); } } [Serializable] [SpecialName] [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] [CompilationMapping(/*Could not decode attribute arguments.*/)] internal sealed class initLethalSettings@100-4 { public LethalSettingsArgs settings; public initLethalSettings@100-4(LethalSettingsArgs settings) { this.settings = settings; base..ctor(); } internal void Invoke(ToggleComponent _arg4, bool value) { settings.setMuteVoiceMimic@.Invoke(value); } } [Serializable] internal sealed class initLethalSettings@72 : FSharpFunc<Unit, Unit> { public LethalSettingsArgs settings; [CompilerGenerated] [DebuggerNonUserCode] internal initLethalSettings@72(LethalSettingsArgs settings) { this.settings = settings; } public override Unit Invoke(Unit unitVar) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Expected O, but got Unknown //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Expected O, but got Unknown //IL_00fa: 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_0107: Expected O, but got Unknown //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Expected O, but got Unknown //IL_0192: Unknown result type (might be due to invalid IL or missing references) LethalSettings.fixLethalSettings(); ModSettingsConfig val = new ModSettingsConfig(); val.Name = settings.pluginName@; val.Id = settings.pluginId@; val.Version = settings.pluginVersion@; val.Description = "The preferences below only affect yourself. These values are not synced from the host."; MenuComponent[] array = new MenuComponent[4]; SliderComponent val2 = new SliderComponent(); val2.Value = settings.getLocalPlayerVolume@.Invoke((Unit)null); val2.MinValue = 0f; val2.MaxValue = 100f; val2.Text = "Volume when a monster is mimicking your own voice:"; val2.OnValueChanged = new initLethalSettings@85-1(settings).Invoke; array[0] = (MenuComponent)val2; ToggleComponent val3 = new ToggleComponent(); val3.Text = "Never delete recordings"; val3.Value = settings.getNeverDeleteRecordings@.Invoke((Unit)null); val3.OnValueChanged = new initLethalSettings@90-2(settings).Invoke; array[1] = (MenuComponent)val3; val3 = new ToggleComponent(); val3.Text = "Allow record voice"; val3.Value = settings.getAllowRecordVoice@.Invoke((Unit)null); val3.OnValueChanged = new initLethalSettings@95-3(settings).Invoke; array[2] = (MenuComponent)val3; val3 = new ToggleComponent(); val3.Text = "Mute voice mimic"; val3.Value = settings.getMuteVoiceMimic@.Invoke((Unit)null); val3.OnValueChanged = new initLethalSettings@100-4(settings).Invoke; array[3] = (MenuComponent)val3; val.MenuComponents = (MenuComponent[])(object)array; ModMenu.RegisterMod(val, true, true); return null; } } [Literal] [DebuggerBrowsable(DebuggerBrowsableState.Never)] public const string LethalIntelligenceModId = "VirusTLNR.LethalIntelligence"; [CompilationMapping(/*Could not decode attribute arguments.*/)] internal static bool enemiesInitialized { get { return <StartupCode$Mirage-Compatibility>.$Mirage.Compatibility.Main.enemiesInitialized@35; } set { <StartupCode$Mirage-Compatibility>.$Mirage.Compatibility.Main.enemiesInitialized@35 = value; } } public static bool isLethalIntelligenceLoaded() { return Chainloader.PluginInfos.ContainsKey("VirusTLNR.LethalIntelligence"); } [CompilationArgumentCounts(new int[] { 1, 1 })] public static void initGeneralLethalConfig(Assembly assembly, ConfigFile configFile) { if (Chainloader.PluginInfos.ContainsKey("ainavt.lc.lethalconfig")) { _ = LazyExtensions.Create<Unit>((FSharpFunc<Unit, Unit>)new initGeneralLethalConfig@27(assembly, configFile)).Value; } } [CompilationArgumentCounts(new int[] { 1, 1 })] public static void initEnemiesLethalConfig(Assembly assembly, FSharpList<ConfigEntry<bool>> enemies) { if (Chainloader.PluginInfos.ContainsKey("ainavt.lc.lethalconfig") && !enemiesInitialized) { _ = LazyExtensions.Create<Unit>((FSharpFunc<Unit, Unit>)new initEnemiesLethalConfig@38(assembly, enemies)).Value; } } [CompilationArgumentCounts(new int[] { 1, 1 })] public static void initLobbyCompatibility(string pluginName, string pluginVersion) { if (Chainloader.PluginInfos.ContainsKey("BMX.LobbyCompatibility")) { _ = LazyExtensions.Create<Unit>((FSharpFunc<Unit, Unit>)new initLobbyCompatibility@47(pluginName, pluginVersion)).Value; } } public static void initLethalSettings(LethalSettingsArgs settings) { if (Chainloader.PluginInfos.ContainsKey("com.willis.lc.lethalsettings")) { _ = LazyExtensions.Create<Unit>((FSharpFunc<Unit, Unit>)new initLethalSettings@72(settings)).Value; } } static Main() { <StartupCode$Mirage-Compatibility>.$Mirage.Compatibility.Main.init@ = 0; _ = <StartupCode$Mirage-Compatibility>.$Mirage.Compatibility.Main.init@; } } } namespace <StartupCode$Mirage-Compatibility>.$Mirage.Compatibility { internal static class Main { [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal static bool enemiesInitialized@35; [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal static int init@; static Main() { enemiesInitialized@35 = false; } } } namespace Mirage.Compatibility { [CompilationMapping(/*Could not decode attribute arguments.*/)] public static class LethalSettings { [Serializable] [SpecialName] [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] [CompilationMapping(/*Could not decode attribute arguments.*/)] internal static class fixLethalSettings@14 { internal static void Invoke(orig_BuildMod orig, ModMenu self, ModSettingsConfig config) { try { orig.Invoke(self, config); } catch (object obj) { Exception ex = (Exception)obj; LethalSettingsPlugin.Log.LogWarning((object)("Failed to run ModMenu.BuildMod(). Please contact the mod author to have it fixed.\n" + "Mod name: " + config.Name + "\n" + "Id: " + config.Id + "\n" + "Version: " + config.Version + "\n")); } } } [Serializable] [SpecialName] [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] [CompilationMapping(/*Could not decode attribute arguments.*/)] internal static class fixLethalSettings@27-1 { internal static void Invoke(orig_ShowModSettings orig, ModSettingsConfig activeConfig, List<ModSettingsConfig> availableConfigs) { foreach (ModSettingsConfig availableConfig in availableConfigs) { if ((object)availableConfig == null) { continue; } GameObject viewport = availableConfig.Viewport; if ((object)viewport != null && 0 == 0) { bool flag = object.ReferenceEquals(availableConfig, activeConfig); if (availableConfig.Viewport.activeSelf && !flag) { onMenu@31(availableConfig, availableConfig.OnMenuClose); } availableConfig.Viewport.SetActive(flag); availableConfig.ShowSettingsButton.ShowCaret = flag; if (!availableConfig.Viewport.activeSelf && flag) { onMenu@31(availableConfig, availableConfig.OnMenuOpen); } } } } } internal static void onMenu@31<a>(ModSettingsConfig config, a listener) where a : class { if (listener != null) { config.OnMenuClose(config.Viewport, new ReadOnlyCollection<MenuComponent>(config.MenuComponents)); } } public static void fixLethalSettings() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown ModMenu.BuildMod += new hook_BuildMod(fixLethalSettings@14.Invoke); ModMenu.ShowModSettings += new hook_ShowModSettings(fixLethalSettings@27-1.Invoke); } } } namespace <StartupCode$Mirage-Compatibility>.$Mirage.Compatibility { internal static class LethalSettings { } } namespace <StartupCode$Mirage-Compatibility>.$.NETStandard,Version=v2.1 { internal static class AssemblyAttributes { } } namespace <StartupCode$Mirage-Compatibility>.$Compatibility { internal static class AssemblyInfo { } } namespace System.Diagnostics.CodeAnalysis { [Serializable] [Flags] [CompilerGenerated] [DebuggerNonUserCode] internal enum DynamicallyAccessedMemberTypes { All = -1, None = 0, PublicParameterlessConstructor = 1, PublicConstructors = 3, NonPublicConstructors = 4, PublicMethods = 8, NonPublicMethods = 0x10, PublicFields = 0x20, NonPublicFields = 0x40, PublicNestedTypes = 0x80, NonPublicNestedTypes = 0x100, PublicProperties = 0x200, NonPublicProperties = 0x400, PublicEvents = 0x800, NonPublicEvents = 0x1000, Interfaces = 0x2000 } [CompilerGenerated] internal class DynamicDependencyAttribute : Attribute { [CompilerGenerated] [DebuggerNonUserCode] private DynamicallyAccessedMemberTypes MemberType@; [CompilerGenerated] [DebuggerNonUserCode] private Type Type@; [CompilerGenerated] [DebuggerNonUserCode] public DynamicallyAccessedMemberTypes MemberType { [CompilerGenerated] [DebuggerNonUserCode] get { return MemberType@; } } [CompilerGenerated] [DebuggerNonUserCode] public Type Type { [CompilerGenerated] [DebuggerNonUserCode] get { return Type@; } } [CompilerGenerated] [DebuggerNonUserCode] public DynamicDependencyAttribute(DynamicallyAccessedMemberTypes MemberType, Type Type) { MemberType@ = MemberType; Type@ = Type; } } }
Mirage.Core.dll
Decompiled 8 hours ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Buffers; using System.Collections; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security.Permissions; using System.Threading; using System.Threading.Channels; using System.Threading.Tasks; using <StartupCode$Mirage-Core>.$Mirage.Core.Audio.Microphone; using Collections.Pooled; using Concentus; using Concentus.Enums; using Concentus.Oggfile; using Concentus.Structs; using FSharpPlus; using FSharpPlus.Control; using IcedTasks; using Microsoft.FSharp.Core; using Microsoft.FSharp.Core.CompilerServices; using Mirage.Core.Audio; using Mirage.Core.Audio.Opus; using Mirage.Core.Task; using NAudio.Dsp; using OpusDotNet; [assembly: FSharpInterfaceDataVersion(2, 0, 0)] [assembly: IgnoresAccessChecksTo("NAudio.Core")] [assembly: IgnoresAccessChecksTo("NAudio")] [assembly: IgnoresAccessChecksTo("OpusDotNet")] [assembly: AssemblyCompany("Mirage.Core")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+7a8d94cfcb6c39f5419fcc3491e37e5605b1284b")] [assembly: AssemblyProduct("Mirage.Core")] [assembly: AssemblyTitle("Mirage.Core")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [CompilationMapping(/*Could not decode attribute arguments.*/)] public static class AssemblyInfo { } namespace <StartupCode$Mirage-Core> { internal static class $AssemblyInfo { } } namespace Mirage.Core.Audio.Microphone { [CompilationMapping(/*Could not decode attribute arguments.*/)] public static class Recognition { } } namespace <StartupCode$Mirage-Core>.$Mirage.Core.Audio.Microphone { internal static class Recognition { } } namespace Mirage.Core.Audio.Microphone { [CompilationMapping(/*Could not decode attribute arguments.*/)] public static class Recorder { [Serializable] [CompilationMapping(/*Could not decode attribute arguments.*/)] public sealed class Recorder<State> : IEquatable<Recorder<State>>, IStructuralEquatable { [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal Mirage.Core.Task.Channel.Channel<(State, Detection.DetectAction)> channel@; [CompilationMapping(/*Could not decode attribute arguments.*/)] public Mirage.Core.Task.Channel.Channel<(State, Detection.DetectAction)> channel { [CompilerGenerated] [DebuggerNonUserCode] get { return channel@; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(Recorder<>))] public Recorder(Mirage.Core.Task.Channel.Channel<(State, Detection.DetectAction)> channel) { channel@ = channel; } [CompilerGenerated] public override string ToString() { return ((FSharpFunc<Recorder<Recorder<State>>, string>)(object)ExtraTopLevelOperators.PrintFormatToString<FSharpFunc<Recorder<State>, string>>((PrintfFormat<FSharpFunc<Recorder<State>, string>, Unit, string, string>)(object)new PrintfFormat<FSharpFunc<Recorder<FSharpFunc<Recorder<State>, string>>, string>, Unit, string, string, Recorder<FSharpFunc<Recorder<State>, string>>>("%+A"))).Invoke((Recorder<Recorder<State>>)(object)this); } [CompilerGenerated] public sealed int GetHashCode(IEqualityComparer comp) { if (this != null) { int num = 0; return -1640531527 + (channel@.GetHashCode(comp) + ((num << 6) + (num >> 2))); } return 0; } [CompilerGenerated] public sealed override int GetHashCode() { return GetHashCode(LanguagePrimitives.GenericEqualityComparer); } [CompilerGenerated] public bool Equals(Recorder<State> obj, IEqualityComparer comp) { if (this != null) { if (obj != null) { Mirage.Core.Task.Channel.Channel<(State, Detection.DetectAction)> channel = channel@; Mirage.Core.Task.Channel.Channel<(State, Detection.DetectAction)> obj2 = obj.channel@; return channel.Equals(obj2, comp); } return false; } return obj == null; } [CompilerGenerated] public sealed bool Equals(object obj, IEqualityComparer comp) { if (obj is Recorder<State> obj2) { return Equals(obj2, comp); } return false; } [CompilerGenerated] public sealed bool Equals(Recorder<State> obj) { if (this != null) { if (obj != null) { return channel@.Equals(obj.channel@); } return false; } return obj == null; } [CompilerGenerated] public sealed override bool Equals(object obj) { if (obj is Recorder<State> obj2) { return Equals(obj2); } return false; } } [Serializable] [CompilationMapping(/*Could not decode attribute arguments.*/)] public sealed class RecorderArgs<State> { [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal int minAudioDurationMs@; [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal string directory@; [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal FSharpFunc<State, bool> allowRecordVoice@; [CompilationMapping(/*Could not decode attribute arguments.*/)] public int minAudioDurationMs { [CompilerGenerated] [DebuggerNonUserCode] get { return minAudioDurationMs@; } } [CompilationMapping(/*Could not decode attribute arguments.*/)] public string directory { [CompilerGenerated] [DebuggerNonUserCode] get { return directory@; } } [CompilationMapping(/*Could not decode attribute arguments.*/)] public FSharpFunc<State, bool> allowRecordVoice { [CompilerGenerated] [DebuggerNonUserCode] get { return allowRecordVoice@; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(RecorderArgs<>))] public RecorderArgs(int minAudioDurationMs, string directory, FSharpFunc<State, bool> allowRecordVoice) { minAudioDurationMs@ = minAudioDurationMs; directory@ = directory; allowRecordVoice@ = allowRecordVoice; } [CompilerGenerated] public override string ToString() { return ((FSharpFunc<RecorderArgs<RecorderArgs<State>>, string>)(object)ExtraTopLevelOperators.PrintFormatToString<FSharpFunc<RecorderArgs<State>, string>>((PrintfFormat<FSharpFunc<RecorderArgs<State>, string>, Unit, string, string>)(object)new PrintfFormat<FSharpFunc<RecorderArgs<FSharpFunc<RecorderArgs<State>, string>>, string>, Unit, string, string, RecorderArgs<FSharpFunc<RecorderArgs<State>, string>>>("%+A"))).Invoke((RecorderArgs<RecorderArgs<State>>)(object)this); } } [SpecialName] [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] [CompilerGenerated] [CompilationMapping(/*Could not decode attribute arguments.*/)] internal struct consumer@31-7<a> : IAsyncStateMachine, IResumableStateMachine<TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>>> { public TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>> Data; public int ResumptionPoint; public RecorderArgs<a> args; public Mirage.Core.Task.Channel.Channel<(a, Detection.DetectAction)> channel; public ValueTaskAwaiter<(a, Detection.DetectAction)> awaiter; public override void MoveNext() { int resumptionPoint = ResumptionPoint; switch (resumptionPoint) { } Exception ex2 = default(Exception); Exception ex; try { bool flag; int num; bool flag2; switch (resumptionPoint) { default: awaiter = channel.reader@.ReadAsync(channel.cancellationToken@).GetAwaiter(); flag = true; if (awaiter.IsCompleted) { break; } if (false) { goto case 1; } ResumptionPoint = 1; num = 0; goto IL_0076; case 1: { num = 1; goto IL_0076; } IL_0076: flag2 = (byte)num != 0; flag = flag2; break; } int num2; if (!flag) { ICriticalNotifyCompletion criticalNotifyCompletion = (ICriticalNotifyCompletion)(object)awaiter; Data.MethodBuilder.AwaitUnsafeOnCompleted(ref criticalNotifyCompletion, ref this); num2 = 0; goto IL_01f9; } var (val, detectAction) = awaiter.GetResult(); if (detectAction.Tag == 1) { Detection.DetectEnd detectEnd = detectAction.detectEnd; if (detectEnd.audioDurationMs@ >= args.minAudioDurationMs@ && args.allowRecordVoice@.Invoke(val)) { Guid guid = Guid.NewGuid(); Writer.OpusWriter opusWriter = Writer.OpusWriter(new Writer.OpusWriterArgs(Path.Join((ReadOnlySpan<char>)args.directory@, (ReadOnlySpan<char>)(string?)PrintfModule.PrintFormatToStringThen<object>((PrintfFormat<object, Unit, string, string>)(object)new PrintfFormat<object, object, object, object, Guid>("%P().opus", new object[1] { guid }, (Type[])null))), detectEnd.fullAudio@.original@.format@)); flag2 = false; flag2 = flag2 || flag2; try { Writer.writeOpusSamples(opusWriter, detectEnd.fullAudio@.original@.samples@); Writer.closeOpusWriter(opusWriter); bool flag3 = true; flag2 = flag3; } catch (object obj) { ex = (Exception)obj; compensation@1-1(detectEnd, opusWriter, null); bool flag3 = true; throw; } if (flag2) { compensation@1-1(detectEnd, opusWriter, null); bool flag3 = true; } num2 = (flag2 ? 1 : 0); goto IL_01f9; } } goto IL_01fb; IL_01f9: if (num2 != 0) { goto IL_01fb; } goto end_IL_0019; IL_01fb: ValueTaskAwaiter<(a, Detection.DetectAction)> valueTaskAwaiter = default(ValueTaskAwaiter<(a, Detection.DetectAction)>); awaiter = valueTaskAwaiter; if (true) { Data.MethodBuilder.SetResult(Data.Result); } end_IL_0019:; } catch (object obj2) { ex = (Exception)obj2; ex2 = ex; } ex = ex2; if (ex != null) { Data.MethodBuilder.SetException(ex); } } void IAsyncStateMachine.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext this.MoveNext(); } public override void SetStateMachine(IAsyncStateMachine state) { Data.MethodBuilder.SetStateMachine(state); } void IAsyncStateMachine.SetStateMachine(IAsyncStateMachine state) { //ILSpy generated this explicit interface implementation from .override directive in SetStateMachine this.SetStateMachine(state); } public override int get_ResumptionPoint() { return ResumptionPoint; } public override TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>> get_Data() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return Data; } public override void set_Data(TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>> value) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) Data = value; } } [SpecialName] [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] [CompilerGenerated] [CompilationMapping(/*Could not decode attribute arguments.*/)] internal struct consumer@31-8<a> : IAsyncStateMachine, IResumableStateMachine<TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>>> { public TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>> Data; public int ResumptionPoint; public RecorderArgs<a> args; public Mirage.Core.Task.Channel.Channel<(a, Detection.DetectAction)> channel; public ValueTaskAwaiter<Unit> awaiter; public override void MoveNext() { int resumptionPoint = ResumptionPoint; switch (resumptionPoint) { } Exception ex2 = default(Exception); Exception ex; try { bool flag; int num; bool flag2; bool flag3; int num2; int num3; bool flag4; switch (resumptionPoint) { default: flag = true; goto IL_00db; case 1: { num = 1; goto IL_0075; } IL_00db: if (flag) { awaiter = program@7-3(args, channel, null).GetAwaiter(); flag2 = true; if (awaiter.IsCompleted) { goto IL_007f; } if (false) { goto case 1; } ResumptionPoint = 1; num = 0; goto IL_0075; } if (flag) { Data.MethodBuilder.SetResult(Data.Result); } break; IL_0075: flag3 = (byte)num != 0; flag2 = flag3; goto IL_007f; IL_007f: if (flag2) { awaiter.GetResult(); _ = null; num2 = 1; } else { ICriticalNotifyCompletion criticalNotifyCompletion = (ICriticalNotifyCompletion)(object)awaiter; Data.MethodBuilder.AwaitUnsafeOnCompleted(ref criticalNotifyCompletion, ref this); num2 = 0; } if (num2 != 0) { awaiter = default(ValueTaskAwaiter<Unit>); num3 = 1; } else { num3 = 0; } flag4 = (byte)num3 != 0; flag = flag4; resumptionPoint = 0; goto IL_00db; } } catch (object obj) { ex = (Exception)obj; ex2 = ex; } ex = ex2; if (ex != null) { Data.MethodBuilder.SetException(ex); } } void IAsyncStateMachine.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext this.MoveNext(); } public override void SetStateMachine(IAsyncStateMachine state) { Data.MethodBuilder.SetStateMachine(state); } void IAsyncStateMachine.SetStateMachine(IAsyncStateMachine state) { //ILSpy generated this explicit interface implementation from .override directive in SetStateMachine this.SetStateMachine(state); } public override int get_ResumptionPoint() { return ResumptionPoint; } public override TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>> get_Data() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return Data; } public override void set_Data(TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>> value) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) Data = value; } } [Serializable] internal sealed class consumer@31-6<a> : FSharpFunc<Unit, ValueTask<Unit>> { public RecorderArgs<a> args; public Mirage.Core.Task.Channel.Channel<(a, Detection.DetectAction)> channel; [CompilerGenerated] [DebuggerNonUserCode] internal consumer@31-6(RecorderArgs<a> args, Mirage.Core.Task.Channel.Channel<(a, Detection.DetectAction)> channel) { this.args = args; this.channel = channel; } public override ValueTask<Unit> Invoke(Unit unitVar0) { consumer@31-8<a> stateMachine = default(consumer@31-8<a>); stateMachine.args = args; stateMachine.channel = channel; stateMachine.Data.MethodBuilder = AsyncValueTaskMethodBuilder<Unit>.Create(); stateMachine.Data.MethodBuilder.Start(ref stateMachine); return stateMachine.Data.MethodBuilder.Task; } } [SpecialName] [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] [CompilerGenerated] [CompilationMapping(/*Could not decode attribute arguments.*/)] internal struct Recorder@51-2 : IAsyncStateMachine, IResumableStateMachine<TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>>> { public TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>> Data; public int ResumptionPoint; public FSharpFunc<Unit, ValueTask<Unit>> program; public Mirage.Core.Task.Channel.Channel<FSharpResult<Unit, Exception>> channel; public ValueTaskAwaiter<Unit> awaiter; public override void MoveNext() { //IL_012b: 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_013d: 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_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) int resumptionPoint = ResumptionPoint; switch (resumptionPoint) { } Exception ex3 = default(Exception); Exception ex = default(Exception); try { bool flag2 = default(bool); bool flag = default(bool); switch (resumptionPoint) { default: flag = false; flag2 = false; ex = null; flag = flag || flag; break; case 1: break; } try { bool flag3; int num; bool flag4; switch (resumptionPoint) { default: awaiter = program.Invoke((Unit)null).GetAwaiter(); flag3 = true; if (awaiter.IsCompleted) { break; } if (false) { goto case 1; } ResumptionPoint = 1; num = 0; goto IL_008c; case 1: { num = 1; goto IL_008c; } IL_008c: flag4 = (byte)num != 0; flag3 = flag4; break; } int num2; if (flag3) { awaiter.GetResult(); _ = null; FSharpResult<Unit, Exception> item = FSharpResult<Unit, Exception>.NewOk((Unit)null); ValueTask valueTask = channel.writer@.WriteAsync(item, channel.cancellationToken@); num2 = 1; } else { ICriticalNotifyCompletion criticalNotifyCompletion = (ICriticalNotifyCompletion)(object)awaiter; Data.MethodBuilder.AwaitUnsafeOnCompleted(ref criticalNotifyCompletion, ref this); num2 = 0; } int num3; if (num2 != 0) { ValueTaskAwaiter<Unit> valueTaskAwaiter = default(ValueTaskAwaiter<Unit>); awaiter = valueTaskAwaiter; num3 = 1; } else { num3 = 0; } bool flag5 = (byte)num3 != 0; flag = flag5; } catch (object obj) { Exception ex2 = (Exception)obj; flag2 = true; ex = ex2; } int num4; if (flag2) { Exception ex2 = ex; FSharpResult<Unit, Exception> item = FSharpResult<Unit, Exception>.NewError(ex2); ValueTask valueTask = channel.writer@.WriteAsync(item, channel.cancellationToken@); num4 = 1; } else { num4 = (flag ? 1 : 0); } if (num4 != 0) { Data.MethodBuilder.SetResult(Data.Result); } } catch (object obj2) { ex = (Exception)obj2; ex3 = ex; } ex = ex3; if (ex != null) { Data.MethodBuilder.SetException(ex); } } void IAsyncStateMachine.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext this.MoveNext(); } public override void SetStateMachine(IAsyncStateMachine state) { Data.MethodBuilder.SetStateMachine(state); } void IAsyncStateMachine.SetStateMachine(IAsyncStateMachine state) { //ILSpy generated this explicit interface implementation from .override directive in SetStateMachine this.SetStateMachine(state); } public override int get_ResumptionPoint() { return ResumptionPoint; } public override TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>> get_Data() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return Data; } public override void set_Data(TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>> value) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) Data = value; } } [Serializable] [SpecialName] [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] [CompilationMapping(/*Could not decode attribute arguments.*/)] internal sealed class Recorder@51-3 { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] public FSharpFunc<Unit, ValueTask<Unit>> program; [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] public Mirage.Core.Task.Channel.Channel<FSharpResult<Unit, Exception>> channel; public Recorder@51-3(FSharpFunc<Unit, ValueTask<Unit>> program, Mirage.Core.Task.Channel.Channel<FSharpResult<Unit, Exception>> channel) { this.program = program; this.channel = channel; base..ctor(); } internal ValueTask<Unit> Invoke() { return thread@12-5(program, channel, null); } } [SpecialName] [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] [CompilerGenerated] [CompilationMapping(/*Could not decode attribute arguments.*/)] internal struct Recorder@51-1 : IAsyncStateMachine, IResumableStateMachine<TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>>> { public TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>> Data; public int ResumptionPoint; public CancellationToken cancellationToken; public FSharpFunc<Unit, ValueTask<Unit>> program; public ValueTaskAwaiter<FSharpResult<Unit, Exception>> awaiter; public override void MoveNext() { //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) int resumptionPoint = ResumptionPoint; switch (resumptionPoint) { } Exception ex2 = default(Exception); Exception ex; try { bool flag; int num; bool flag2; switch (resumptionPoint) { default: { Mirage.Core.Task.Channel.Channel<FSharpResult<Unit, Exception>> channel = Mirage.Core.Task.Channel.Channel<FSharpResult<Unit, Exception>>(cancellationToken); Task<ValueTask<Unit>> task = System.Threading.Tasks.Task.Run((Func<ValueTask<Unit>>)new Recorder@51-3(program, channel).Invoke, cancellationToken); awaiter = channel.reader@.ReadAsync(channel.cancellationToken@).GetAwaiter(); flag = true; if (awaiter.IsCompleted) { break; } if (false) { goto case 1; } ResumptionPoint = 1; num = 0; goto IL_009d; } case 1: { num = 1; goto IL_009d; } IL_009d: flag2 = (byte)num != 0; flag = flag2; break; } int num2; if (flag) { FSharpResult<Unit, Exception> result = awaiter.GetResult(); FSharpResult<Unit, Exception> val = result; if (val.Tag != 0) { throw val.ErrorValue; } _ = val.ResultValue; Data.Result = null; num2 = 1; } else { ICriticalNotifyCompletion criticalNotifyCompletion = (ICriticalNotifyCompletion)(object)awaiter; Data.MethodBuilder.AwaitUnsafeOnCompleted(ref criticalNotifyCompletion, ref this); num2 = 0; } if (num2 != 0) { ValueTaskAwaiter<FSharpResult<Unit, Exception>> valueTaskAwaiter = default(ValueTaskAwaiter<FSharpResult<Unit, Exception>>); awaiter = valueTaskAwaiter; if (true) { Data.MethodBuilder.SetResult(Data.Result); } } } catch (object obj) { ex = (Exception)obj; ex2 = ex; } ex = ex2; if (ex != null) { Data.MethodBuilder.SetException(ex); } } void IAsyncStateMachine.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext this.MoveNext(); } public override void SetStateMachine(IAsyncStateMachine state) { Data.MethodBuilder.SetStateMachine(state); } void IAsyncStateMachine.SetStateMachine(IAsyncStateMachine state) { //ILSpy generated this explicit interface implementation from .override directive in SetStateMachine this.SetStateMachine(state); } public override int get_ResumptionPoint() { return ResumptionPoint; } public override TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>> get_Data() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return Data; } public override void set_Data(TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>> value) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) Data = value; } } [Serializable] internal sealed class Recorder@51-4 : FSharpFunc<FSharpFunc<Unit, ValueTask<Unit>>, Unit> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] public CancellationToken cancellationToken; [CompilerGenerated] [DebuggerNonUserCode] internal Recorder@51-4(CancellationToken cancellationToken) { this.cancellationToken = cancellationToken; } public override Unit Invoke(FSharpFunc<Unit, ValueTask<Unit>> x) { ValueTask<Unit> valueTask = func1@1-2(cancellationToken, x); return null; } } [Serializable] internal sealed class Recorder@51 : FSharpFunc<CancellationToken, FSharpFunc<FSharpFunc<Unit, ValueTask<Unit>>, Unit>> { internal static readonly Recorder@51 @_instance = new Recorder@51(); [CompilerGenerated] [DebuggerNonUserCode] internal Recorder@51() { } public override FSharpFunc<FSharpFunc<Unit, ValueTask<Unit>>, Unit> Invoke(CancellationToken cancellationToken) { return new Recorder@51-4(cancellationToken); } } [Serializable] internal sealed class writeRecorder@54<a> : FSharpFunc<(a, Detection.DetectAction), Unit> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] public Mirage.Core.Task.Channel.Channel<(a, Detection.DetectAction)> channel; [CompilerGenerated] [DebuggerNonUserCode] internal writeRecorder@54(Mirage.Core.Task.Channel.Channel<(a, Detection.DetectAction)> channel) { ((FSharpFunc<((a, Detection.DetectAction), Detection.DetectAction), Unit>)(object)this)..ctor(); this.channel = channel; } public override Unit Invoke((a, Detection.DetectAction) element) { ValueTask valueTask = channel.writer@.WriteAsync(element, channel.cancellationToken@); return null; } } [CompilerGenerated] internal static void compensation@1-1(Detection.DetectEnd payload, Writer.OpusWriter opusWriter, Unit unitVar) { ArrayPool<float>.Shared.Return(payload.fullAudio@.original@.samples@.data@); ArrayPool<float>.Shared.Return(payload.fullAudio@.resampled@.samples@.data@); Operators.dispose((IDisposable)opusWriter); } [CompilerGenerated] internal static ValueTask<Unit> program@7-3<a>(RecorderArgs<a> args, Mirage.Core.Task.Channel.Channel<(a, Detection.DetectAction)> channel, Unit unitVar0) { consumer@31-7<a> stateMachine = default(consumer@31-7<a>); stateMachine.args = args; stateMachine.channel = channel; stateMachine.Data.MethodBuilder = AsyncValueTaskMethodBuilder<Unit>.Create(); stateMachine.Data.MethodBuilder.Start(ref stateMachine); return stateMachine.Data.MethodBuilder.Task; } [CompilerGenerated] internal static ValueTask<Unit> thread@12-5(FSharpFunc<Unit, ValueTask<Unit>> program, Mirage.Core.Task.Channel.Channel<FSharpResult<Unit, Exception>> channel, Unit unitVar0) { Recorder@51-2 stateMachine = default(Recorder@51-2); stateMachine.program = program; stateMachine.channel = channel; stateMachine.Data.MethodBuilder = AsyncValueTaskMethodBuilder<Unit>.Create(); stateMachine.Data.MethodBuilder.Start(ref stateMachine); return stateMachine.Data.MethodBuilder.Task; } [CompilerGenerated] internal static ValueTask<Unit> func1@1-2(CancellationToken cancellationToken, FSharpFunc<Unit, ValueTask<Unit>> program) { Recorder@51-1 stateMachine = default(Recorder@51-1); stateMachine.cancellationToken = cancellationToken; stateMachine.program = program; stateMachine.Data.MethodBuilder = AsyncValueTaskMethodBuilder<Unit>.Create(); stateMachine.Data.MethodBuilder.Start(ref stateMachine); return stateMachine.Data.MethodBuilder.Task; } public static Recorder<a> Recorder<a>(RecorderArgs<a> args) { Mirage.Core.Task.Channel.Channel<(a, Detection.DetectAction)> channel = Mirage.Core.Task.Channel.Channel<(a, Detection.DetectAction)>(CancellationToken.None); FSharpFunc<Unit, ValueTask<Unit>> val = new consumer@31-6<a>(args, channel); FSharpFunc<CancellationToken, FSharpFunc<Unit, ValueTask<Unit>>>.InvokeFast<Unit>((FSharpFunc<CancellationToken, FSharpFunc<FSharpFunc<Unit, ValueTask<Unit>>, Unit>>)Recorder@51.@_instance, CancellationToken.None, val); return new Recorder<a>(channel); } public static FSharpFunc<(a, Detection.DetectAction), Unit> writeRecorder<a>(Recorder<a> recorder) { Mirage.Core.Task.Channel.Channel<(a, Detection.DetectAction)> channel@ = recorder.channel@; return new writeRecorder@54<a>(channel@); } } } namespace <StartupCode$Mirage-Core>.$Mirage.Core.Audio.Microphone { internal static class Recorder { } } namespace Mirage.Core.Audio.Microphone { [CompilationMapping(/*Could not decode attribute arguments.*/)] public static class Detection { [Serializable] [Struct] [CompilationMapping(/*Could not decode attribute arguments.*/)] public struct VADFrame : IEquatable<VADFrame>, IStructuralEquatable, IComparable<VADFrame>, IComparable, IStructuralComparable { [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal int elapsedTime@; [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal float probability@; [CompilationMapping(/*Could not decode attribute arguments.*/)] public readonly int elapsedTime { [CompilerGenerated] [DebuggerNonUserCode] get { return elapsedTime@; } } [CompilationMapping(/*Could not decode attribute arguments.*/)] public readonly float probability { [CompilerGenerated] [DebuggerNonUserCode] get { return probability@; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(VADFrame))] public VADFrame(int elapsedTime, float probability) { elapsedTime@ = elapsedTime; probability@ = probability; } [CompilerGenerated] public override string ToString() { return ExtraTopLevelOperators.PrintFormatToString<FSharpFunc<VADFrame, string>>((PrintfFormat<FSharpFunc<VADFrame, string>, Unit, string, string>)(object)new PrintfFormat<FSharpFunc<VADFrame, string>, Unit, string, string, VADFrame>("%+A")).Invoke(this); } [CompilerGenerated] public sealed int CompareTo(VADFrame obj) { IComparer genericComparer = LanguagePrimitives.GenericComparer; int num = elapsedTime@; int num2 = obj.elapsedTime@; int num3 = ((num > num2) ? 1 : 0) - ((num < num2) ? 1 : 0); if (num3 < 0) { return num3; } if (num3 > 0) { return num3; } genericComparer = LanguagePrimitives.GenericComparer; float num4 = probability@; float num5 = obj.probability@; if (num4 < num5) { return -1; } if (num4 > num5) { return 1; } if (num4 == num5) { return 0; } return HashCompare.GenericComparisonWithComparerIntrinsic<float>(genericComparer, num4, num5); } [CompilerGenerated] public sealed int CompareTo(object obj) { return CompareTo((VADFrame)obj); } [CompilerGenerated] public sealed int CompareTo(object obj, IComparer comp) { VADFrame vADFrame = (VADFrame)obj; int num = elapsedTime@; int num2 = vADFrame.elapsedTime@; int num3 = ((num > num2) ? 1 : 0) - ((num < num2) ? 1 : 0); if (num3 < 0) { return num3; } if (num3 > 0) { return num3; } float num4 = probability@; float num5 = vADFrame.probability@; if (num4 < num5) { return -1; } if (num4 > num5) { return 1; } if (num4 == num5) { return 0; } return HashCompare.GenericComparisonWithComparerIntrinsic<float>(comp, num4, num5); } [CompilerGenerated] public sealed int GetHashCode(IEqualityComparer comp) { int num = 0; num = -1640531527 + (HashCompare.GenericHashWithComparerIntrinsic<float>(comp, probability@) + ((num << 6) + (num >> 2))); return -1640531527 + (elapsedTime@ + ((num << 6) + (num >> 2))); } [CompilerGenerated] public sealed override int GetHashCode() { return GetHashCode(LanguagePrimitives.GenericEqualityComparer); } [CompilerGenerated] public bool Equals(VADFrame obj, IEqualityComparer comp) { if (elapsedTime@ == obj.elapsedTime@) { return probability@ == obj.probability@; } return false; } [CompilerGenerated] public sealed bool Equals(object obj, IEqualityComparer comp) { if (obj is VADFrame obj2) { return Equals(obj2, comp); } return false; } [CompilerGenerated] public sealed bool Equals(VADFrame obj) { if (elapsedTime@ == obj.elapsedTime@) { float num = probability@; float num2 = obj.probability@; if (num == num2) { return true; } if (num != num) { return num2 != num2; } return false; } return false; } [CompilerGenerated] public sealed override bool Equals(object obj) { if (obj is VADFrame) { return Equals((VADFrame)obj); } return false; } } [Serializable] [Struct] [CompilationMapping(/*Could not decode attribute arguments.*/)] public struct DetectStart : IEquatable<DetectStart>, IStructuralEquatable, IComparable<DetectStart>, IComparable, IStructuralComparable { [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal PCM.WaveFormat originalFormat@; [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal PCM.WaveFormat resampledFormat@; [CompilationMapping(/*Could not decode attribute arguments.*/)] public readonly PCM.WaveFormat originalFormat { [CompilerGenerated] [DebuggerNonUserCode] get { return originalFormat@; } } [CompilationMapping(/*Could not decode attribute arguments.*/)] public readonly PCM.WaveFormat resampledFormat { [CompilerGenerated] [DebuggerNonUserCode] get { return resampledFormat@; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(DetectStart))] public DetectStart(PCM.WaveFormat originalFormat, PCM.WaveFormat resampledFormat) { originalFormat@ = originalFormat; resampledFormat@ = resampledFormat; } [CompilerGenerated] public override string ToString() { return ExtraTopLevelOperators.PrintFormatToString<FSharpFunc<DetectStart, string>>((PrintfFormat<FSharpFunc<DetectStart, string>, Unit, string, string>)(object)new PrintfFormat<FSharpFunc<DetectStart, string>, Unit, string, string, DetectStart>("%+A")).Invoke(this); } [CompilerGenerated] public sealed int CompareTo(DetectStart obj) { IComparer genericComparer = LanguagePrimitives.GenericComparer; PCM.WaveFormat waveFormat = originalFormat@; PCM.WaveFormat waveFormat2 = obj.originalFormat@; int num = waveFormat.CompareTo(waveFormat2, genericComparer); if (num < 0) { return num; } if (num > 0) { return num; } genericComparer = LanguagePrimitives.GenericComparer; waveFormat = resampledFormat@; waveFormat2 = obj.resampledFormat@; return waveFormat.CompareTo(waveFormat2, genericComparer); } [CompilerGenerated] public sealed int CompareTo(object obj) { return CompareTo((DetectStart)obj); } [CompilerGenerated] public sealed int CompareTo(object obj, IComparer comp) { DetectStart detectStart = (DetectStart)obj; PCM.WaveFormat waveFormat = originalFormat@; PCM.WaveFormat waveFormat2 = detectStart.originalFormat@; int num = waveFormat.CompareTo(waveFormat2, comp); if (num < 0) { return num; } if (num > 0) { return num; } waveFormat = resampledFormat@; waveFormat2 = detectStart.resampledFormat@; return waveFormat.CompareTo(waveFormat2, comp); } [CompilerGenerated] public sealed int GetHashCode(IEqualityComparer comp) { int num = 0; PCM.WaveFormat waveFormat = resampledFormat@; num = -1640531527 + (waveFormat.GetHashCode(comp) + ((num << 6) + (num >> 2))); waveFormat = originalFormat@; return -1640531527 + (waveFormat.GetHashCode(comp) + ((num << 6) + (num >> 2))); } [CompilerGenerated] public sealed override int GetHashCode() { return GetHashCode(LanguagePrimitives.GenericEqualityComparer); } [CompilerGenerated] public bool Equals(DetectStart obj, IEqualityComparer comp) { PCM.WaveFormat waveFormat = originalFormat@; PCM.WaveFormat obj2 = obj.originalFormat@; if (waveFormat.Equals(obj2, comp)) { waveFormat = resampledFormat@; obj2 = obj.resampledFormat@; return waveFormat.Equals(obj2, comp); } return false; } [CompilerGenerated] public sealed bool Equals(object obj, IEqualityComparer comp) { if (obj is DetectStart obj2) { return Equals(obj2, comp); } return false; } [CompilerGenerated] public sealed bool Equals(DetectStart obj) { PCM.WaveFormat waveFormat = originalFormat@; if (waveFormat.Equals(obj.originalFormat@)) { waveFormat = resampledFormat@; return waveFormat.Equals(obj.resampledFormat@); } return false; } [CompilerGenerated] public sealed override bool Equals(object obj) { if (obj is DetectStart) { return Equals((DetectStart)obj); } return false; } } [Serializable] [Struct] [CompilationMapping(/*Could not decode attribute arguments.*/)] public struct DetectEnd : IEquatable<DetectEnd>, IStructuralEquatable, IComparable<DetectEnd>, IComparable, IStructuralComparable { [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal int audioDurationMs@; [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal Resampler.ResampledAudio fullAudio@; [CompilationMapping(/*Could not decode attribute arguments.*/)] public readonly int audioDurationMs { [CompilerGenerated] [DebuggerNonUserCode] get { return audioDurationMs@; } } [CompilationMapping(/*Could not decode attribute arguments.*/)] public readonly Resampler.ResampledAudio fullAudio { [CompilerGenerated] [DebuggerNonUserCode] get { return fullAudio@; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(DetectEnd))] public DetectEnd(int audioDurationMs, Resampler.ResampledAudio fullAudio) { audioDurationMs@ = audioDurationMs; fullAudio@ = fullAudio; } [CompilerGenerated] public override string ToString() { return ExtraTopLevelOperators.PrintFormatToString<FSharpFunc<DetectEnd, string>>((PrintfFormat<FSharpFunc<DetectEnd, string>, Unit, string, string>)(object)new PrintfFormat<FSharpFunc<DetectEnd, string>, Unit, string, string, DetectEnd>("%+A")).Invoke(this); } [CompilerGenerated] public sealed int CompareTo(DetectEnd obj) { IComparer genericComparer = LanguagePrimitives.GenericComparer; int num = audioDurationMs@; int num2 = obj.audioDurationMs@; int num3 = ((num > num2) ? 1 : 0) - ((num < num2) ? 1 : 0); if (num3 < 0) { return num3; } if (num3 > 0) { return num3; } genericComparer = LanguagePrimitives.GenericComparer; Resampler.ResampledAudio resampledAudio = fullAudio@; Resampler.ResampledAudio resampledAudio2 = obj.fullAudio@; return resampledAudio.CompareTo(resampledAudio2, genericComparer); } [CompilerGenerated] public sealed int CompareTo(object obj) { return CompareTo((DetectEnd)obj); } [CompilerGenerated] public sealed int CompareTo(object obj, IComparer comp) { DetectEnd detectEnd = (DetectEnd)obj; int num = audioDurationMs@; int num2 = detectEnd.audioDurationMs@; int num3 = ((num > num2) ? 1 : 0) - ((num < num2) ? 1 : 0); if (num3 < 0) { return num3; } if (num3 > 0) { return num3; } Resampler.ResampledAudio resampledAudio = fullAudio@; Resampler.ResampledAudio resampledAudio2 = detectEnd.fullAudio@; return resampledAudio.CompareTo(resampledAudio2, comp); } [CompilerGenerated] public sealed int GetHashCode(IEqualityComparer comp) { int num = 0; Resampler.ResampledAudio resampledAudio = fullAudio@; num = -1640531527 + (resampledAudio.GetHashCode(comp) + ((num << 6) + (num >> 2))); return -1640531527 + (audioDurationMs@ + ((num << 6) + (num >> 2))); } [CompilerGenerated] public sealed override int GetHashCode() { return GetHashCode(LanguagePrimitives.GenericEqualityComparer); } [CompilerGenerated] public bool Equals(DetectEnd obj, IEqualityComparer comp) { if (audioDurationMs@ == obj.audioDurationMs@) { Resampler.ResampledAudio resampledAudio = fullAudio@; Resampler.ResampledAudio obj2 = obj.fullAudio@; return resampledAudio.Equals(obj2, comp); } return false; } [CompilerGenerated] public sealed bool Equals(object obj, IEqualityComparer comp) { if (obj is DetectEnd obj2) { return Equals(obj2, comp); } return false; } [CompilerGenerated] public sealed bool Equals(DetectEnd obj) { if (audioDurationMs@ == obj.audioDurationMs@) { Resampler.ResampledAudio resampledAudio = fullAudio@; return resampledAudio.Equals(obj.fullAudio@); } return false; } [CompilerGenerated] public sealed override bool Equals(object obj) { if (obj is DetectEnd) { return Equals((DetectEnd)obj); } return false; } } [Serializable] [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)] [Struct] [DebuggerDisplay("{__DebugDisplay(),nq}")] [CompilationMapping(/*Could not decode attribute arguments.*/)] public struct DetectAction : IEquatable<DetectAction>, IStructuralEquatable, IComparable<DetectAction>, IComparable, IStructuralComparable { public static class Tags { public const int DetectStart = 0; public const int DetectEnd = 1; } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] [field: DebuggerNonUserCode] public int Tag { [DebuggerNonUserCode] get; } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] public bool IsDetectStart { [CompilerGenerated] [DebuggerNonUserCode] get { return Tag == 0; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] public bool IsDetectEnd { [CompilerGenerated] [DebuggerNonUserCode] get { return Tag == 1; } } [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] [field: DebuggerNonUserCode] public DetectStart detectStart { [DebuggerNonUserCode] get; } [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] [field: DebuggerNonUserCode] public DetectEnd detectEnd { [DebuggerNonUserCode] get; } [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] public static DetectAction NewDetectStart(DetectStart _detectStart) { DetectAction result = default(DetectAction); result.detectStart = _detectStart; return result; } [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] public static DetectAction NewDetectEnd(DetectEnd _detectEnd) { DetectAction result = default(DetectAction); result._tag = 1; result.detectEnd = _detectEnd; return result; } [SpecialName] [CompilerGenerated] [DebuggerNonUserCode] internal object __DebugDisplay() { return ExtraTopLevelOperators.PrintFormatToString<FSharpFunc<DetectAction, string>>((PrintfFormat<FSharpFunc<DetectAction, string>, Unit, string, string>)(object)new PrintfFormat<FSharpFunc<DetectAction, string>, Unit, string, string, string>("%+0.8A")).Invoke(this); } [CompilerGenerated] public override string ToString() { return ExtraTopLevelOperators.PrintFormatToString<FSharpFunc<DetectAction, string>>((PrintfFormat<FSharpFunc<DetectAction, string>, Unit, string, string>)(object)new PrintfFormat<FSharpFunc<DetectAction, string>, Unit, string, string, DetectAction>("%+A")).Invoke(this); } [CompilerGenerated] public sealed int CompareTo(DetectAction obj) { int tag = _tag; int tag2 = obj._tag; if (tag == tag2) { IComparer genericComparer; if (Tag == 0) { genericComparer = LanguagePrimitives.GenericComparer; DetectStart detectStart = this.detectStart; DetectStart detectStart2 = obj.detectStart; return detectStart.CompareTo(detectStart2, genericComparer); } genericComparer = LanguagePrimitives.GenericComparer; DetectEnd detectEnd = this.detectEnd; DetectEnd detectEnd2 = obj.detectEnd; return detectEnd.CompareTo(detectEnd2, genericComparer); } return tag - tag2; } [CompilerGenerated] public sealed int CompareTo(object obj) { return CompareTo((DetectAction)obj); } [CompilerGenerated] public sealed int CompareTo(object obj, IComparer comp) { DetectAction detectAction = (DetectAction)obj; int tag = _tag; int tag2 = detectAction._tag; if (tag == tag2) { if (Tag == 0) { DetectStart detectStart = this.detectStart; DetectStart detectStart2 = detectAction.detectStart; return detectStart.CompareTo(detectStart2, comp); } DetectEnd detectEnd = this.detectEnd; DetectEnd detectEnd2 = detectAction.detectEnd; return detectEnd.CompareTo(detectEnd2, comp); } return tag - tag2; } [CompilerGenerated] public sealed int GetHashCode(IEqualityComparer comp) { int num = 0; if (Tag == 0) { num = 0; DetectStart detectStart = this.detectStart; return -1640531527 + (detectStart.GetHashCode(comp) + ((num << 6) + (num >> 2))); } num = 1; DetectEnd detectEnd = this.detectEnd; return -1640531527 + (detectEnd.GetHashCode(comp) + ((num << 6) + (num >> 2))); } [CompilerGenerated] public sealed override int GetHashCode() { return GetHashCode(LanguagePrimitives.GenericEqualityComparer); } [CompilerGenerated] public bool Equals(DetectAction obj, IEqualityComparer comp) { int tag = _tag; int tag2 = obj._tag; if (tag == tag2) { if (Tag == 0) { DetectStart detectStart = this.detectStart; DetectStart obj2 = obj.detectStart; return detectStart.Equals(obj2, comp); } DetectEnd detectEnd = this.detectEnd; DetectEnd obj3 = obj.detectEnd; return detectEnd.Equals(obj3, comp); } return false; } [CompilerGenerated] public sealed bool Equals(object obj, IEqualityComparer comp) { if (obj is DetectAction obj2) { return Equals(obj2, comp); } return false; } [CompilerGenerated] public sealed bool Equals(DetectAction obj) { int tag = _tag; int tag2 = obj._tag; if (tag == tag2) { if (Tag == 0) { DetectStart detectStart = this.detectStart; return detectStart.Equals(obj.detectStart); } DetectEnd detectEnd = this.detectEnd; return detectEnd.Equals(obj.detectEnd); } return false; } [CompilerGenerated] public sealed override bool Equals(object obj) { if (obj is DetectAction) { return Equals((DetectAction)obj); } return false; } } [Serializable] [CompilationMapping(/*Could not decode attribute arguments.*/)] public sealed class VoiceDetector<State> : IEquatable<VoiceDetector<State>>, IStructuralEquatable { [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal Mirage.Core.Task.Channel.Channel<Resampler.ResamplerOutput<State>> channel@; [CompilationMapping(/*Could not decode attribute arguments.*/)] public Mirage.Core.Task.Channel.Channel<Resampler.ResamplerOutput<State>> channel { [CompilerGenerated] [DebuggerNonUserCode] get { return channel@; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(VoiceDetector<>))] public VoiceDetector(Mirage.Core.Task.Channel.Channel<Resampler.ResamplerOutput<State>> channel) { channel@ = channel; } [CompilerGenerated] public override string ToString() { return ((FSharpFunc<VoiceDetector<VoiceDetector<State>>, string>)(object)ExtraTopLevelOperators.PrintFormatToString<FSharpFunc<VoiceDetector<State>, string>>((PrintfFormat<FSharpFunc<VoiceDetector<State>, string>, Unit, string, string>)(object)new PrintfFormat<FSharpFunc<VoiceDetector<FSharpFunc<VoiceDetector<State>, string>>, string>, Unit, string, string, VoiceDetector<FSharpFunc<VoiceDetector<State>, string>>>("%+A"))).Invoke((VoiceDetector<VoiceDetector<State>>)(object)this); } [CompilerGenerated] public sealed int GetHashCode(IEqualityComparer comp) { if (this != null) { int num = 0; return -1640531527 + (channel@.GetHashCode(comp) + ((num << 6) + (num >> 2))); } return 0; } [CompilerGenerated] public sealed override int GetHashCode() { return GetHashCode(LanguagePrimitives.GenericEqualityComparer); } [CompilerGenerated] public bool Equals(VoiceDetector<State> obj, IEqualityComparer comp) { if (this != null) { if (obj != null) { Mirage.Core.Task.Channel.Channel<Resampler.ResamplerOutput<State>> channel = channel@; Mirage.Core.Task.Channel.Channel<Resampler.ResamplerOutput<State>> obj2 = obj.channel@; return channel.Equals(obj2, comp); } return false; } return obj == null; } [CompilerGenerated] public sealed bool Equals(object obj, IEqualityComparer comp) { if (obj is VoiceDetector<State> obj2) { return Equals(obj2, comp); } return false; } [CompilerGenerated] public sealed bool Equals(VoiceDetector<State> obj) { if (this != null) { if (obj != null) { return channel@.Equals(obj.channel@); } return false; } return obj == null; } [CompilerGenerated] public sealed override bool Equals(object obj) { if (obj is VoiceDetector<State> obj2) { return Equals(obj2); } return false; } } [Serializable] [CompilationMapping(/*Could not decode attribute arguments.*/)] public sealed class VoiceDetectorArgs<State> { [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal int minSilenceDurationMs@; [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal FSharpFunc<State, FSharpValueOption<float>> forcedProbability@; [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal float startThreshold@; [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal float endThreshold@; [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal FSharpFunc<PCM.Samples, FSharpFunc<int, float>> detectSpeech@; [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal FSharpFunc<State, FSharpFunc<DetectAction, Unit>> onVoiceDetected@; [CompilationMapping(/*Could not decode attribute arguments.*/)] public int minSilenceDurationMs { [CompilerGenerated] [DebuggerNonUserCode] get { return minSilenceDurationMs@; } } [CompilationMapping(/*Could not decode attribute arguments.*/)] public FSharpFunc<State, FSharpValueOption<float>> forcedProbability { [CompilerGenerated] [DebuggerNonUserCode] get { return forcedProbability@; } } [CompilationMapping(/*Could not decode attribute arguments.*/)] public float startThreshold { [CompilerGenerated] [DebuggerNonUserCode] get { return startThreshold@; } } [CompilationMapping(/*Could not decode attribute arguments.*/)] public float endThreshold { [CompilerGenerated] [DebuggerNonUserCode] get { return endThreshold@; } } [CompilationMapping(/*Could not decode attribute arguments.*/)] public FSharpFunc<PCM.Samples, FSharpFunc<int, float>> detectSpeech { [CompilerGenerated] [DebuggerNonUserCode] get { return detectSpeech@; } } [CompilationMapping(/*Could not decode attribute arguments.*/)] public FSharpFunc<State, FSharpFunc<DetectAction, Unit>> onVoiceDetected { [CompilerGenerated] [DebuggerNonUserCode] get { return onVoiceDetected@; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(VoiceDetectorArgs<>))] public VoiceDetectorArgs(int minSilenceDurationMs, FSharpFunc<State, FSharpValueOption<float>> forcedProbability, float startThreshold, float endThreshold, FSharpFunc<PCM.Samples, FSharpFunc<int, float>> detectSpeech, FSharpFunc<State, FSharpFunc<DetectAction, Unit>> onVoiceDetected) { minSilenceDurationMs@ = minSilenceDurationMs; forcedProbability@ = forcedProbability; startThreshold@ = startThreshold; endThreshold@ = endThreshold; detectSpeech@ = detectSpeech; onVoiceDetected@ = onVoiceDetected; } [CompilerGenerated] public override string ToString() { return ((FSharpFunc<VoiceDetectorArgs<VoiceDetectorArgs<State>>, string>)(object)ExtraTopLevelOperators.PrintFormatToString<FSharpFunc<VoiceDetectorArgs<State>, string>>((PrintfFormat<FSharpFunc<VoiceDetectorArgs<State>, string>, Unit, string, string>)(object)new PrintfFormat<FSharpFunc<VoiceDetectorArgs<FSharpFunc<VoiceDetectorArgs<State>, string>>, string>, Unit, string, string, VoiceDetectorArgs<FSharpFunc<VoiceDetectorArgs<State>, string>>>("%+A"))).Invoke((VoiceDetectorArgs<VoiceDetectorArgs<State>>)(object)this); } } [SpecialName] [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] [CompilerGenerated] [CompilationMapping(/*Could not decode attribute arguments.*/)] internal struct consumer@83-4<a> : IAsyncStateMachine, IResumableStateMachine<TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>>> { public TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>> Data; public int ResumptionPoint; public VoiceDetectorArgs<a> args; public float minSilenceSamples; public Mirage.Core.Task.Channel.Channel<Resampler.ResamplerOutput<a>> channel; public <>f__AnonymousType2762740774<PooledList<float>, PooledList<float>> samples; public FSharpRef<int> currentIndex; public FSharpRef<int> endIndex; public FSharpRef<bool> voiceDetected; public ValueTaskAwaiter<Resampler.ResamplerOutput<a>> awaiter; public override void MoveNext() { //IL_0231: Unknown result type (might be due to invalid IL or missing references) //IL_0236: Unknown result type (might be due to invalid IL or missing references) int resumptionPoint = ResumptionPoint; switch (resumptionPoint) { } Exception ex2 = default(Exception); Exception ex; try { bool flag; int num; bool flag2; switch (resumptionPoint) { default: awaiter = channel.reader@.ReadAsync(channel.cancellationToken@).GetAwaiter(); flag = true; if (awaiter.IsCompleted) { break; } if (false) { goto case 1; } ResumptionPoint = 1; num = 0; goto IL_0076; case 1: { num = 1; goto IL_0076; } IL_0076: flag2 = (byte)num != 0; flag = flag2; break; } int num2; if (flag) { Resampler.ResamplerOutput<a> result = awaiter.GetResult(); Resampler.ResamplerOutput<a> resamplerOutput = result; if (resamplerOutput.Tag != 0) { samples.original.Clear(); samples.resampled.Clear(); currentIndex.contents = 0; endIndex.contents = 0; voiceDetected.contents = false; num2 = 1; } else { a item = resamplerOutput.item.Item1; Resampler.ResampledAudio item2 = resamplerOutput.item.Item2; flag2 = false; flag2 = flag2 || flag2; try { ref int contents@ = ref currentIndex.contents@; int length@ = item2.original@.samples@.length@; contents@ += length@; PooledList<float> original = samples.original; ArraySegment<float> arraySegment = new ArraySegment<float>(item2.original@.samples@.data@, 0, item2.original@.samples@.length@); int num3 = 0; length@ = arraySegment.Count - 1; if (length@ >= num3) { do { original.Add(arraySegment[num3]); resumptionPoint = 0; num3++; } while (num3 != length@ + 1); } original = samples.resampled; arraySegment = new ArraySegment<float>(item2.resampled@.samples@.data@, 0, item2.resampled@.samples@.length@); num3 = 0; length@ = arraySegment.Count - 1; if (length@ >= num3) { do { original.Add(arraySegment[num3]); resumptionPoint = 0; num3++; } while (num3 != length@ + 1); } FSharpValueOption<float> val = args.forcedProbability@.Invoke(item); float num4 = ((val.Tag == 0) ? FSharpFunc<PCM.Samples, int>.InvokeFast<float>(args.detectSpeech@, item2.resampled@.samples@, item2.resampled@.samples@.length@) : val.Item); int num5; if (num4 >= args.startThreshold@) { if (endIndex.contents != 0) { endIndex.contents = 0; if (1 == 0) { num5 = 0; goto IL_05c7; } } if (!voiceDetected.contents) { voiceDetected.contents = true; FSharpFunc<DetectAction, Unit> val2 = args.onVoiceDetected@.Invoke(item); DetectStart detectStart = new DetectStart(item2.original@.format@, item2.resampled@.format@); val2.Invoke(DetectAction.NewDetectStart(detectStart)); num5 = 1; } else { num5 = 1; } } else if (num4 < args.endThreshold@ && voiceDetected.contents) { if (endIndex.contents == 0) { endIndex.contents = currentIndex.contents; if (1 == 0) { num5 = 0; goto IL_05c7; } } if ((float)(currentIndex.contents - endIndex.contents) >= minSilenceSamples) { float[] array = ArrayPool<float>.Shared.Rent(samples.original.Count); original = samples.original; length@ = samples.original.Count; int num6 = 0; num3 = length@ - 1; if (num3 >= num6) { do { array[num6] = original[num6]; num6++; } while (num6 != num3 + 1); } float[] data = array; float[] array2 = ArrayPool<float>.Shared.Rent(samples.resampled.Count); original = samples.resampled; length@ = samples.resampled.Count; num6 = 0; num3 = length@ - 1; if (num3 >= num6) { do { array2[num6] = original[num6]; num6++; } while (num6 != num3 + 1); } array = array2; PCM.WaveFormat format@ = item2.original@.format@; Resampler.ResampledAudio fullAudio = new Resampler.ResampledAudio(new Resampler.AudioFrame(new PCM.Samples(data, samples.original.Count), format@), new Resampler.AudioFrame(format: item2.resampled@.format@, samples: new PCM.Samples(array, samples.resampled.Count))); endIndex.contents = 0; voiceDetected.contents = false; FSharpFunc<DetectAction, Unit> val2 = args.onVoiceDetected@.Invoke(item); format@ = fullAudio.original@.format@; length@ = samples.original.Count; DetectEnd detectEnd = new DetectEnd((int)((double)length@ / (double)format@.sampleRate@ / (double)format@.channels@ * 1000.0), fullAudio); val2.Invoke(DetectAction.NewDetectEnd(detectEnd)); samples.original.Clear(); samples.resampled.Clear(); num5 = 1; } else { num5 = 1; } } else if (!voiceDetected.contents) { samples.original.Clear(); samples.resampled.Clear(); num5 = 1; } else { num5 = 1; } goto IL_05c7; IL_05c7: bool flag3 = (byte)num5 != 0; flag2 = flag3; } catch (object obj) { ex = (Exception)obj; compensation@1(item2, null); bool flag3 = true; throw; } if (flag2) { compensation@1(item2, null); bool flag3 = true; } num2 = (flag2 ? 1 : 0); } } else { ICriticalNotifyCompletion criticalNotifyCompletion = (ICriticalNotifyCompletion)(object)awaiter; Data.MethodBuilder.AwaitUnsafeOnCompleted(ref criticalNotifyCompletion, ref this); num2 = 0; } if (num2 != 0) { ValueTaskAwaiter<Resampler.ResamplerOutput<a>> valueTaskAwaiter = default(ValueTaskAwaiter<Resampler.ResamplerOutput<a>>); awaiter = valueTaskAwaiter; if (true) { Data.MethodBuilder.SetResult(Data.Result); } } } catch (object obj2) { ex = (Exception)obj2; ex2 = ex; } ex = ex2; if (ex != null) { Data.MethodBuilder.SetException(ex); } } void IAsyncStateMachine.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext this.MoveNext(); } public override void SetStateMachine(IAsyncStateMachine state) { Data.MethodBuilder.SetStateMachine(state); } void IAsyncStateMachine.SetStateMachine(IAsyncStateMachine state) { //ILSpy generated this explicit interface implementation from .override directive in SetStateMachine this.SetStateMachine(state); } public override int get_ResumptionPoint() { return ResumptionPoint; } public override TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>> get_Data() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return Data; } public override void set_Data(TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>> value) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) Data = value; } } [SpecialName] [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] [CompilerGenerated] [CompilationMapping(/*Could not decode attribute arguments.*/)] internal struct consumer@83-5<a> : IAsyncStateMachine, IResumableStateMachine<TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>>> { public TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>> Data; public int ResumptionPoint; public VoiceDetectorArgs<a> args; public float minSilenceSamples; public Mirage.Core.Task.Channel.Channel<Resampler.ResamplerOutput<a>> channel; public <>f__AnonymousType2762740774<PooledList<float>, PooledList<float>> samples; public FSharpRef<int> currentIndex; public FSharpRef<int> endIndex; public FSharpRef<bool> voiceDetected; public ValueTaskAwaiter<Unit> awaiter; public override void MoveNext() { int resumptionPoint = ResumptionPoint; switch (resumptionPoint) { } Exception ex2 = default(Exception); Exception ex; try { bool flag; int num; bool flag2; bool flag3; int num2; int num3; bool flag4; switch (resumptionPoint) { default: flag = true; goto IL_00f9; case 1: { num = 1; goto IL_0093; } IL_00f9: if (flag) { awaiter = program@7-2(args, minSilenceSamples, channel, samples, currentIndex, endIndex, voiceDetected, null).GetAwaiter(); flag2 = true; if (awaiter.IsCompleted) { goto IL_009d; } if (false) { goto case 1; } ResumptionPoint = 1; num = 0; goto IL_0093; } if (flag) { Data.MethodBuilder.SetResult(Data.Result); } break; IL_0093: flag3 = (byte)num != 0; flag2 = flag3; goto IL_009d; IL_009d: if (flag2) { awaiter.GetResult(); _ = null; num2 = 1; } else { ICriticalNotifyCompletion criticalNotifyCompletion = (ICriticalNotifyCompletion)(object)awaiter; Data.MethodBuilder.AwaitUnsafeOnCompleted(ref criticalNotifyCompletion, ref this); num2 = 0; } if (num2 != 0) { awaiter = default(ValueTaskAwaiter<Unit>); num3 = 1; } else { num3 = 0; } flag4 = (byte)num3 != 0; flag = flag4; resumptionPoint = 0; goto IL_00f9; } } catch (object obj) { ex = (Exception)obj; ex2 = ex; } ex = ex2; if (ex != null) { Data.MethodBuilder.SetException(ex); } } void IAsyncStateMachine.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext this.MoveNext(); } public override void SetStateMachine(IAsyncStateMachine state) { Data.MethodBuilder.SetStateMachine(state); } void IAsyncStateMachine.SetStateMachine(IAsyncStateMachine state) { //ILSpy generated this explicit interface implementation from .override directive in SetStateMachine this.SetStateMachine(state); } public override int get_ResumptionPoint() { return ResumptionPoint; } public override TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>> get_Data() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return Data; } public override void set_Data(TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>> value) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) Data = value; } } [Serializable] internal sealed class consumer@83-3<a> : FSharpFunc<Unit, ValueTask<Unit>> { public VoiceDetectorArgs<a> args; public float minSilenceSamples; public Mirage.Core.Task.Channel.Channel<Resampler.ResamplerOutput<a>> channel; public <>f__AnonymousType2762740774<PooledList<float>, PooledList<float>> samples; public FSharpRef<int> currentIndex; public FSharpRef<int> endIndex; public FSharpRef<bool> voiceDetected; [CompilerGenerated] [DebuggerNonUserCode] internal consumer@83-3(VoiceDetectorArgs<a> args, float minSilenceSamples, Mirage.Core.Task.Channel.Channel<Resampler.ResamplerOutput<a>> channel, <>f__AnonymousType2762740774<PooledList<float>, PooledList<float>> samples, FSharpRef<int> currentIndex, FSharpRef<int> endIndex, FSharpRef<bool> voiceDetected) { this.args = args; this.minSilenceSamples = minSilenceSamples; this.channel = channel; this.samples = samples; this.currentIndex = currentIndex; this.endIndex = endIndex; this.voiceDetected = voiceDetected; } public override ValueTask<Unit> Invoke(Unit unitVar0) { consumer@83-5<a> stateMachine = default(consumer@83-5<a>); stateMachine.args = args; stateMachine.minSilenceSamples = minSilenceSamples; stateMachine.channel = channel; stateMachine.samples = samples; stateMachine.currentIndex = currentIndex; stateMachine.endIndex = endIndex; stateMachine.voiceDetected = voiceDetected; stateMachine.Data.MethodBuilder = AsyncValueTaskMethodBuilder<Unit>.Create(); stateMachine.Data.MethodBuilder.Start(ref stateMachine); return stateMachine.Data.MethodBuilder.Task; } } [SpecialName] [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] [CompilerGenerated] [CompilationMapping(/*Could not decode attribute arguments.*/)] internal struct VoiceDetector@147-2 : IAsyncStateMachine, IResumableStateMachine<TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>>> { public TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>> Data; public int ResumptionPoint; public FSharpFunc<Unit, ValueTask<Unit>> program; public Mirage.Core.Task.Channel.Channel<FSharpResult<Unit, Exception>> channel; public ValueTaskAwaiter<Unit> awaiter; public override void MoveNext() { //IL_012b: 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_013d: 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_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) int resumptionPoint = ResumptionPoint; switch (resumptionPoint) { } Exception ex3 = default(Exception); Exception ex = default(Exception); try { bool flag2 = default(bool); bool flag = default(bool); switch (resumptionPoint) { default: flag = false; flag2 = false; ex = null; flag = flag || flag; break; case 1: break; } try { bool flag3; int num; bool flag4; switch (resumptionPoint) { default: awaiter = program.Invoke((Unit)null).GetAwaiter(); flag3 = true; if (awaiter.IsCompleted) { break; } if (false) { goto case 1; } ResumptionPoint = 1; num = 0; goto IL_008c; case 1: { num = 1; goto IL_008c; } IL_008c: flag4 = (byte)num != 0; flag3 = flag4; break; } int num2; if (flag3) { awaiter.GetResult(); _ = null; FSharpResult<Unit, Exception> item = FSharpResult<Unit, Exception>.NewOk((Unit)null); ValueTask valueTask = channel.writer@.WriteAsync(item, channel.cancellationToken@); num2 = 1; } else { ICriticalNotifyCompletion criticalNotifyCompletion = (ICriticalNotifyCompletion)(object)awaiter; Data.MethodBuilder.AwaitUnsafeOnCompleted(ref criticalNotifyCompletion, ref this); num2 = 0; } int num3; if (num2 != 0) { ValueTaskAwaiter<Unit> valueTaskAwaiter = default(ValueTaskAwaiter<Unit>); awaiter = valueTaskAwaiter; num3 = 1; } else { num3 = 0; } bool flag5 = (byte)num3 != 0; flag = flag5; } catch (object obj) { Exception ex2 = (Exception)obj; flag2 = true; ex = ex2; } int num4; if (flag2) { Exception ex2 = ex; FSharpResult<Unit, Exception> item = FSharpResult<Unit, Exception>.NewError(ex2); ValueTask valueTask = channel.writer@.WriteAsync(item, channel.cancellationToken@); num4 = 1; } else { num4 = (flag ? 1 : 0); } if (num4 != 0) { Data.MethodBuilder.SetResult(Data.Result); } } catch (object obj2) { ex = (Exception)obj2; ex3 = ex; } ex = ex3; if (ex != null) { Data.MethodBuilder.SetException(ex); } } void IAsyncStateMachine.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext this.MoveNext(); } public override void SetStateMachine(IAsyncStateMachine state) { Data.MethodBuilder.SetStateMachine(state); } void IAsyncStateMachine.SetStateMachine(IAsyncStateMachine state) { //ILSpy generated this explicit interface implementation from .override directive in SetStateMachine this.SetStateMachine(state); } public override int get_ResumptionPoint() { return ResumptionPoint; } public override TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>> get_Data() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return Data; } public override void set_Data(TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>> value) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) Data = value; } } [Serializable] [SpecialName] [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] [CompilationMapping(/*Could not decode attribute arguments.*/)] internal sealed class VoiceDetector@147-3 { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] public FSharpFunc<Unit, ValueTask<Unit>> program; [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] public Mirage.Core.Task.Channel.Channel<FSharpResult<Unit, Exception>> channel; public VoiceDetector@147-3(FSharpFunc<Unit, ValueTask<Unit>> program, Mirage.Core.Task.Channel.Channel<FSharpResult<Unit, Exception>> channel) { this.program = program; this.channel = channel; base..ctor(); } internal ValueTask<Unit> Invoke() { return thread@12-4(program, channel, null); } } [SpecialName] [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] [CompilerGenerated] [CompilationMapping(/*Could not decode attribute arguments.*/)] internal struct VoiceDetector@147-1 : IAsyncStateMachine, IResumableStateMachine<TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>>> { public TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>> Data; public int ResumptionPoint; public CancellationToken cancellationToken; public FSharpFunc<Unit, ValueTask<Unit>> program; public ValueTaskAwaiter<FSharpResult<Unit, Exception>> awaiter; public override void MoveNext() { //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) int resumptionPoint = ResumptionPoint; switch (resumptionPoint) { } Exception ex2 = default(Exception); Exception ex; try { bool flag; int num; bool flag2; switch (resumptionPoint) { default: { Mirage.Core.Task.Channel.Channel<FSharpResult<Unit, Exception>> channel = Mirage.Core.Task.Channel.Channel<FSharpResult<Unit, Exception>>(cancellationToken); Task<ValueTask<Unit>> task = System.Threading.Tasks.Task.Run((Func<ValueTask<Unit>>)new VoiceDetector@147-3(program, channel).Invoke, cancellationToken); awaiter = channel.reader@.ReadAsync(channel.cancellationToken@).GetAwaiter(); flag = true; if (awaiter.IsCompleted) { break; } if (false) { goto case 1; } ResumptionPoint = 1; num = 0; goto IL_009d; } case 1: { num = 1; goto IL_009d; } IL_009d: flag2 = (byte)num != 0; flag = flag2; break; } int num2; if (flag) { FSharpResult<Unit, Exception> result = awaiter.GetResult(); FSharpResult<Unit, Exception> val = result; if (val.Tag != 0) { throw val.ErrorValue; } _ = val.ResultValue; Data.Result = null; num2 = 1; } else { ICriticalNotifyCompletion criticalNotifyCompletion = (ICriticalNotifyCompletion)(object)awaiter; Data.MethodBuilder.AwaitUnsafeOnCompleted(ref criticalNotifyCompletion, ref this); num2 = 0; } if (num2 != 0) { ValueTaskAwaiter<FSharpResult<Unit, Exception>> valueTaskAwaiter = default(ValueTaskAwaiter<FSharpResult<Unit, Exception>>); awaiter = valueTaskAwaiter; if (true) { Data.MethodBuilder.SetResult(Data.Result); } } } catch (object obj) { ex = (Exception)obj; ex2 = ex; } ex = ex2; if (ex != null) { Data.MethodBuilder.SetException(ex); } } void IAsyncStateMachine.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext this.MoveNext(); } public override void SetStateMachine(IAsyncStateMachine state) { Data.MethodBuilder.SetStateMachine(state); } void IAsyncStateMachine.SetStateMachine(IAsyncStateMachine state) { //ILSpy generated this explicit interface implementation from .override directive in SetStateMachine this.SetStateMachine(state); } public override int get_ResumptionPoint() { return ResumptionPoint; } public override TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>> get_Data() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return Data; } public override void set_Data(TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>> value) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) Data = value; } } [Serializable] internal sealed class VoiceDetector@147-4 : FSharpFunc<FSharpFunc<Unit, ValueTask<Unit>>, Unit> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] public CancellationToken cancellationToken; [CompilerGenerated] [DebuggerNonUserCode] internal VoiceDetector@147-4(CancellationToken cancellationToken) { this.cancellationToken = cancellationToken; } public override Unit Invoke(FSharpFunc<Unit, ValueTask<Unit>> x) { ValueTask<Unit> valueTask = func1@1-1(cancellationToken, x); return null; } } [Serializable] internal sealed class VoiceDetector@147 : FSharpFunc<CancellationToken, FSharpFunc<FSharpFunc<Unit, ValueTask<Unit>>, Unit>> { internal static readonly VoiceDetector@147 @_instance = new VoiceDetector@147(); [CompilerGenerated] [DebuggerNonUserCode] internal VoiceDetector@147() { } public override FSharpFunc<FSharpFunc<Unit, ValueTask<Unit>>, Unit> Invoke(CancellationToken cancellationToken) { return new VoiceDetector@147-4(cancellationToken); } } [Serializable] internal sealed class writeDetector@151<a> : FSharpFunc<Resampler.ResamplerOutput<a>, Unit> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] public Mirage.Core.Task.Channel.Channel<Resampler.ResamplerOutput<a>> channel; [CompilerGenerated] [DebuggerNonUserCode] internal writeDetector@151(Mirage.Core.Task.Channel.Channel<Resampler.ResamplerOutput<a>> channel) { ((FSharpFunc<Resampler.ResamplerOutput<Resampler.ResamplerOutput<a>>, Unit>)(object)this)..ctor(); this.channel = channel; } public override Unit Invoke(Resampler.ResamplerOutput<a> element) { ValueTask valueTask = channel.writer@.WriteAsync(element, channel.cancellationToken@); return null; } } [Literal] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal const int SamplingRate = 16000; [CompilerGenerated] internal static void compensation@1(Resampler.ResampledAudio currentAudio, Unit unitVar) { ArrayPool<float>.Shared.Return(currentAudio.original@.samples@.data@); ArrayPool<float>.Shared.Return(currentAudio.resampled@.samples@.data@); } [CompilerGenerated] internal static ValueTask<Unit> program@7-2<a>(VoiceDetectorArgs<a> args, float minSilenceSamples, Mirage.Core.Task.Channel.Channel<Resampler.ResamplerOutput<a>> channel, <>f__AnonymousType2762740774<PooledList<float>, PooledList<float>> samples, FSharpRef<int> currentIndex, FSharpRef<int> endIndex, FSharpRef<bool> voiceDetected, Unit unitVar0) { consumer@83-4<a> stateMachine = default(consumer@83-4<a>); stateMachine.args = args; stateMachine.minSilenceSamples = minSilenceSamples; stateMachine.channel = channel; stateMachine.samples = samples; stateMachine.currentIndex = currentIndex; stateMachine.endIndex = endIndex; stateMachine.voiceDetected = voiceDetected; stateMachine.Data.MethodBuilder = AsyncValueTaskMethodBuilder<Unit>.Create(); stateMachine.Data.MethodBuilder.Start(ref stateMachine); return stateMachine.Data.MethodBuilder.Task; } [CompilerGenerated] internal static ValueTask<Unit> thread@12-4(FSharpFunc<Unit, ValueTask<Unit>> program, Mirage.Core.Task.Channel.Channel<FSharpResult<Unit, Exception>> channel, Unit unitVar0) { VoiceDetector@147-2 stateMachine = default(VoiceDetector@147-2); stateMachine.program = program; stateMachine.channel = channel; stateMachine.Data.MethodBuilder = AsyncValueTaskMethodBuilder<Unit>.Create(); stateMachine.Data.MethodBuilder.Start(ref stateMachine); return stateMachine.Data.MethodBuilder.Task; } [CompilerGenerated] internal static ValueTask<Unit> func1@1-1(CancellationToken cancellationToken, FSharpFunc<Unit, ValueTask<Unit>> program) { VoiceDetector@147-1 stateMachine = default(VoiceDetector@147-1); stateMachine.cancellationToken = cancellationToken; stateMachine.program = program; stateMachine.Data.MethodBuilder = AsyncValueTaskMethodBuilder<Unit>.Create(); stateMachine.Data.MethodBuilder.Start(ref stateMachine); return stateMachine.Data.MethodBuilder.Task; } public static VoiceDetector<a> VoiceDetector<a>(VoiceDetectorArgs<a> args) { float minSilenceSamples = 16000f * (float)args.minSilenceDurationMs@ / 1000f; Mirage.Core.Task.Channel.Channel<Resampler.ResamplerOutput<a>> channel = Mirage.Core.Task.Channel.Channel<Resampler.ResamplerOutput<a>>(CancellationToken.None); var samples = new { original = new PooledList<float>((ClearMode)2), resampled = new PooledList<float>((ClearMode)2) }; FSharpRef<int> currentIndex = new FSharpRef<int>(0); FSharpRef<int> endIndex = new FSharpRef<int>(0); FSharpRef<bool> voiceDetected = new FSharpRef<bool>(false); FSharpFunc<Unit, ValueTask<Unit>> val = new consumer@83-3<a>(args, minSilenceSamples, channel, samples, currentIndex, endIndex, voiceDetected); FSharpFunc<CancellationToken, FSharpFunc<Unit, ValueTask<Unit>>>.InvokeFast<Unit>((FSharpFunc<CancellationToken, FSharpFunc<FSharpFunc<Unit, ValueTask<Unit>>, Unit>>)VoiceDetector@147.@_instance, CancellationToken.None, val); return new VoiceDetector<a>(channel); } public static FSharpFunc<Resampler.ResamplerOutput<a>, Unit> writeDetector<a>(VoiceDetector<a> detector) { Mirage.Core.Task.Channel.Channel<Resampler.ResamplerOutput<a>> channel@ = detector.channel@; return new writeDetector@151<a>(channel@); } } } namespace <StartupCode$Mirage-Core>.$Mirage.Core.Audio.Microphone { internal static class Detection { } } namespace Mirage.Core.Audio.Microphone { [CompilationMapping(/*Could not decode attribute arguments.*/)] public static class Resampler { [Serializable] [Struct] [CompilationMapping(/*Could not decode attribute arguments.*/)] public struct AudioFrame : IEquatable<AudioFrame>, IStructuralEquatable, IComparable<AudioFrame>, IComparable, IStructuralComparable { [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal PCM.Samples samples@; [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal PCM.WaveFormat format@; [CompilationMapping(/*Could not decode attribute arguments.*/)] public readonly PCM.Samples samples { [CompilerGenerated] [DebuggerNonUserCode] get { return samples@; } } [CompilationMapping(/*Could not decode attribute arguments.*/)] public readonly PCM.WaveFormat format { [CompilerGenerated] [DebuggerNonUserCode] get { return format@; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(AudioFrame))] public AudioFrame(PCM.Samples samples, PCM.WaveFormat format) { samples@ = samples; format@ = format; } [CompilerGenerated] public override string ToString() { return ExtraTopLevelOperators.PrintFormatToString<FSharpFunc<AudioFrame, string>>((PrintfFormat<FSharpFunc<AudioFrame, string>, Unit, string, string>)(object)new PrintfFormat<FSharpFunc<AudioFrame, string>, Unit, string, string, AudioFrame>("%+A")).Invoke(this); } [CompilerGenerated] public sealed int CompareTo(AudioFrame obj) { IComparer genericComparer = LanguagePrimitives.GenericComparer; PCM.Samples samples = samples@; PCM.Samples samples2 = obj.samples@; int num = samples.CompareTo(samples2, genericComparer); if (num < 0) { return num; } if (num > 0) { return num; } genericComparer = LanguagePrimitives.GenericComparer; PCM.WaveFormat waveFormat = format@; PCM.WaveFormat waveFormat2 = obj.format@; return waveFormat.CompareTo(waveFormat2, genericComparer); } [CompilerGenerated] public sealed int CompareTo(object obj) { return CompareTo((AudioFrame)obj); } [CompilerGenerated] public sealed int CompareTo(object obj, IComparer comp) { AudioFrame audioFrame = (AudioFrame)obj; PCM.Samples samples = samples@; PCM.Samples samples2 = audioFrame.samples@; int num = samples.CompareTo(samples2, comp); if (num < 0) { return num; } if (num > 0) { return num; } PCM.WaveFormat waveFormat = format@; PCM.WaveFormat waveFormat2 = audioFrame.format@; return waveFormat.CompareTo(waveFormat2, comp); } [CompilerGenerated] public sealed int GetHashCode(IEqualityComparer comp) { int num = 0; PCM.WaveFormat waveFormat = format@; num = -1640531527 + (waveFormat.GetHashCode(comp) + ((num << 6) + (num >> 2))); PCM.Samples samples = samples@; return -1640531527 + (samples.GetHashCode(comp) + ((num << 6) + (num >> 2))); } [CompilerGenerated] public sealed override int GetHashCode() { return GetHashCode(LanguagePrimitives.GenericEqualityComparer); } [CompilerGenerated] public bool Equals(AudioFrame obj, IEqualityComparer comp) { PCM.Samples samples = samples@; PCM.Samples obj2 = obj.samples@; if (samples.Equals(obj2, comp)) { PCM.WaveFormat waveFormat = format@; PCM.WaveFormat obj3 = obj.format@; return waveFormat.Equals(obj3, comp); } return false; } [CompilerGenerated] public sealed bool Equals(object obj, IEqualityComparer comp) { if (obj is AudioFrame obj2) { return Equals(obj2, comp); } return false; } [CompilerGenerated] public sealed bool Equals(AudioFrame obj) { PCM.Samples samples = samples@; if (samples.Equals(obj.samples@)) { PCM.WaveFormat waveFormat = format@; return waveFormat.Equals(obj.format@); } return false; } [CompilerGenerated] public sealed override bool Equals(object obj) { if (obj is AudioFrame) { return Equals((AudioFrame)obj); } return false; } } [Serializable] [Struct] [CompilationMapping(/*Could not decode attribute arguments.*/)] public struct ResampledAudio : IEquatable<ResampledAudio>, IStructuralEquatable, IComparable<ResampledAudio>, IComparable, IStructuralComparable { [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal AudioFrame original@; [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal AudioFrame resampled@; [CompilationMapping(/*Could not decode attribute arguments.*/)] public readonly AudioFrame original { [CompilerGenerated] [DebuggerNonUserCode] get { return original@; } } [CompilationMapping(/*Could not decode attribute arguments.*/)] public readonly AudioFrame resampled { [CompilerGenerated] [DebuggerNonUserCode] get { return resampled@; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(ResampledAudio))] public ResampledAudio(AudioFrame original, AudioFrame resampled) { original@ = original; resampled@ = resampled; } [CompilerGenerated] public override string ToString() { return ExtraTopLevelOperators.PrintFormatToString<FSharpFunc<ResampledAudio, string>>((PrintfFormat<FSharpFunc<ResampledAudio, string>, Unit, string, string>)(object)new PrintfFormat<FSharpFunc<ResampledAudio, string>, Unit, string, string, ResampledAudio>("%+A")).Invoke(this); } [CompilerGenerated] public sealed int CompareTo(ResampledAudio obj) { IComparer genericComparer = LanguagePrimitives.GenericComparer; AudioFrame audioFrame = original@; AudioFrame audioFrame2 = obj.original@; int num = audioFrame.CompareTo(audioFrame2, genericComparer); if (num < 0) { return num; } if (num > 0) { return num; } genericComparer = LanguagePrimitives.GenericComparer; audioFrame = resampled@; audioFrame2 = obj.resampled@; return audioFrame.CompareTo(audioFrame2, genericComparer); } [CompilerGenerated] public sealed int CompareTo(object obj) { return CompareTo((ResampledAudio)obj); } [CompilerGenerated] public sealed int CompareTo(object obj, IComparer comp) { ResampledAudio resampledAudio = (ResampledAudio)obj; AudioFrame audioFrame = original@; AudioFrame audioFrame2 = resampledAudio.original@; int num = audioFrame.CompareTo(audioFrame2, comp); if (num < 0) { return num; } if (num > 0) { return num; } audioFrame = resampled@; audioFrame2 = resampledAudio.resampled@; return audioFrame.CompareTo(audioFrame2, comp); } [CompilerGenerated] public sealed int GetHashCode(IEqualityComparer comp) { int num = 0; AudioFrame audioFrame = resampled@; num = -1640531527 + (audioFrame.GetHashCode(comp) + ((num << 6) + (num >> 2))); audioFrame = original@; return -1640531527 + (audioFrame.GetHashCode(comp) + ((num << 6) + (num >> 2))); } [CompilerGenerated] public sealed override int GetHashCode() { return GetHashCode(LanguagePrimitives.GenericEqualityComparer); } [CompilerGenerated] public bool Equals(ResampledAudio obj, IEqualityComparer comp) { AudioFrame audioFrame = original@; AudioFrame obj2 = obj.original@; if (audioFrame.Equals(obj2, comp)) { audioFrame = resampled@; obj2 = obj.resampled@; return audioFrame.Equals(obj2, comp); } return false; } [CompilerGenerated] public sealed bool Equals(object obj, IEqualityComparer comp) { if (obj is ResampledAudio obj2) { return Equals(obj2, comp); } return false; } [CompilerGenerated] public sealed bool Equals(ResampledAudio obj) { AudioFrame audioFrame = original@; if (audioFrame.Equals(obj.original@)) { audioFrame = resampled@; return audioFrame.Equals(obj.resampled@); } return false; } [CompilerGenerated] public sealed override bool Equals(object obj) { if (obj is ResampledAudio) { return Equals((ResampledAudio)obj); } return false; } } [Serializable] [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)] [Struct] [DebuggerDisplay("{__DebugDisplay(),nq}")] [CompilationMapping(/*Could not decode attribute arguments.*/)] public struct ResamplerInput<State> : IEquatable<ResamplerInput<State>>, IStructuralEquatable, IComparable<ResamplerInput<State>>, IComparable, IStructuralComparable { public static class Tags { public const int ResamplerInput = 0; public const int Reset = 1; } [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal (State, AudioFrame) item; [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] public int Tag { [DebuggerNonUserCode] get; } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] public bool IsResamplerInput { [CompilerGenerated] [DebuggerNonUserCode] get { return Tag == 0; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] public static ResamplerInput<State> Reset { [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] get { return new ResamplerInput<State>(1); } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] public bool IsReset { [CompilerGenerated] [DebuggerNonUserCode] get { return Tag == 1; } } [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] public (State, AudioFrame) Item { [CompilerGenerated] [DebuggerNonUserCode] get { return item; } } [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] public static ResamplerInput<State> NewResamplerInput((State, AudioFrame) item) { ResamplerInput<State> result = default(ResamplerInput<State>); result.item = item; return result; } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(ResamplerInput<>))] [CompilerGenerated] [DebuggerNonUserCode] internal ResamplerInput(int _tag) { this._tag = _tag; } [SpecialName] [CompilerGenerated] [DebuggerNonUserCode] internal object __DebugDisplay() { return ((FSharpFunc<ResamplerInput<ResamplerInput<State>>, string>)(object)ExtraTopLevelOperators.PrintFormatToString<FSharpFunc<ResamplerInput<State>, string>>((PrintfFormat<FSharpFunc<ResamplerInput<State>, string>, Unit, string, string>)(object)new PrintfFormat<FSharpFunc<ResamplerInput<FSharpFunc<ResamplerInput<State>, string>>, string>, Unit, string, string, string>("%+0.8A"))).Invoke((ResamplerInput<ResamplerInput<State>>)this); } [CompilerGenerated] public override string ToString() { return ((FSharpFunc<ResamplerInput<ResamplerInput<State>>, string>)(object)ExtraTopLevelOperators.PrintFormatToString<FSharpFunc<ResamplerInput<State>, string>>((PrintfFormat<FSharpFunc<ResamplerInput<State>, string>, Unit, string, string>)(object)new PrintfFormat<FSharpFunc<ResamplerInput<FSharpFunc<ResamplerInput<State>, string>>, string>, Unit, string, string, ResamplerInput<FSharpFunc<ResamplerInput<State>, string>>>("%+A"))).Invoke((ResamplerInput<ResamplerInput<State>>)this); } [CompilerGenerated] public sealed int CompareTo(ResamplerInput<State> obj) { int tag = _tag; int tag2 = obj._tag; if (tag == tag2) { if (Tag == 0) { IComparer genericComparer = LanguagePrimitives.GenericComparer; (State, AudioFrame) tuple = item; (State, AudioFrame) tuple2 = obj.item; return HashCompare.GenericComparisonWithComparerIntrinsic<(State, AudioFrame)>(genericComparer, tuple, tuple2); } return 0; } return tag - tag2; } [CompilerGenerated] public sealed int CompareTo(object obj) { return CompareTo((ResamplerInput<State>)obj); } [CompilerGenerated] public sealed int CompareTo(object obj, IComparer comp) { ResamplerInput<State> resamplerInput = (ResamplerInput<State>)obj; int tag = _tag; int tag2 = resamplerInput._tag; if (tag == tag2) { if (Tag == 0) { (State, AudioFrame) tuple = item; (State, AudioFrame) tuple2 = resamplerInput.item; return HashCompare.GenericComparisonWithComparerIntrinsic<(State, AudioFrame)>(comp, tuple, tuple2); } return 0; } return tag - tag2; } [CompilerGenerated] public sealed int GetHashCode(IEqualityComparer comp) { int num = 0; if (Tag == 0) { num = 0; (State, AudioFrame) tuple = item; return -1640531527 + (HashCompare.GenericHashWithComparerIntrinsic<(State, AudioFrame)>(comp, tuple) + ((num << 6) + (num >> 2))); } return _tag; } [CompilerGenerated] public sealed override int GetHashCode() { return GetHashCode(LanguagePrimitives.GenericEqualityComparer); } [CompilerGenerated] public bool Equals(ResamplerInput<State> obj, IEqualityComparer comp) { int tag = _tag; int tag2 = obj._tag; if (tag == tag2) { if (Tag == 0) { (State, AudioFrame) tuple = item; (State, AudioFrame) tuple2 = obj.item; return HashCompare.GenericEqualityWithComparerIntrinsic<(State, AudioFrame)>(comp, tuple, tuple2); } return true; } return false; } [CompilerGenerated] public sealed bool Equals(object obj, IEqualityComparer comp) { if (obj is ResamplerInput<State> obj2) { return Equals(obj2, comp); } return false; } [CompilerGenerated] public sealed bool Equals(ResamplerInput<State> obj) { int tag = _tag; int tag2 = obj._tag; if (tag == tag2) { if (Tag == 0) { (State, AudioFrame) tuple = item; (State, AudioFrame) tuple2 = obj.item; return HashCompare.GenericEqualityERIntrinsic<(State, AudioFrame)>(tuple, tuple2); } return true; } return false; } [CompilerGenerated] public sealed override bool Equals(object obj) { if (obj is ResamplerInput<State>) { return Equals((ResamplerInput<State>)obj); } return false; } } [Serializable] [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)] [Struct] [DebuggerDisplay("{__DebugDisplay(),nq}")] [CompilationM
Mirage.dll
Decompiled 8 hours ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Buffers; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Serialization; using System.Runtime.Versioning; using System.Security.Permissions; using System.Threading; using System.Threading.Tasks; using <StartupCode$Mirage>.$Mirage.Domain; using <StartupCode$Mirage>.$Mirage.Domain.Audio; using <StartupCode$Mirage>.$Mirage.Hook; using <StartupCode$Mirage>.$Mirage.Unity; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using Concentus.Oggfile; using Dissonance; using Dissonance.Audio.Capture; using Dissonance.Audio.Playback; using FSharpPlus; using FSharpPlus.Control; using FSharpPlus.Internals; using GameNetcodeStuff; using IcedTasks; using Microsoft.FSharp.Collections; using Microsoft.FSharp.Control; using Microsoft.FSharp.Core; using Microsoft.FSharp.Core.CompilerServices; using Mirage.Compatibility; using Mirage.Core.Audio; using Mirage.Core.Audio.Microphone; using Mirage.Core.Audio.Opus; using Mirage.Core.Task; using Mirage.Domain; using Mirage.Domain.Audio; using Mirage.Hook; using Mirage.NetcodePatcher; using Mirage.Unity; using NAudio.Wave; using Newtonsoft.Json; using On; using On.Dissonance; using On.GameNetcodeStuff; using On.Unity.Netcode; using OpusDotNet; using Silero; using Unity.Collections; using Unity.Netcode; using UnityEngine; [assembly: FSharpInterfaceDataVersion(2, 0, 0)] [assembly: IgnoresAccessChecksTo("AmazingAssets.TerrainToMesh")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp-firstpass")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: IgnoresAccessChecksTo("ClientNetworkTransform")] [assembly: IgnoresAccessChecksTo("com.olegknyazev.softmask")] [assembly: IgnoresAccessChecksTo("DissonanceVoip")] [assembly: IgnoresAccessChecksTo("DunGen")] [assembly: IgnoresAccessChecksTo("DunGen.Integration.ASPP")] [assembly: IgnoresAccessChecksTo("DunGen.Integration.UnityNav")] [assembly: IgnoresAccessChecksTo("EasyTextEffects")] [assembly: IgnoresAccessChecksTo("Facepunch Transport for Netcode for GameObjects")] [assembly: IgnoresAccessChecksTo("Facepunch.Steamworks.Win64")] [assembly: IgnoresAccessChecksTo("LethalConfig")] [assembly: IgnoresAccessChecksTo("LethalSettings")] [assembly: IgnoresAccessChecksTo("NAudio.Core")] [assembly: IgnoresAccessChecksTo("NAudio")] [assembly: IgnoresAccessChecksTo("NAudio.WinMM")] [assembly: IgnoresAccessChecksTo("Unity.AI.Navigation")] [assembly: IgnoresAccessChecksTo("Unity.Animation.Rigging")] [assembly: IgnoresAccessChecksTo("Unity.Animation.Rigging.DocCodeExamples")] [assembly: IgnoresAccessChecksTo("Unity.Burst")] [assembly: IgnoresAccessChecksTo("Unity.Burst.Unsafe")] [assembly: IgnoresAccessChecksTo("Unity.Collections")] [assembly: IgnoresAccessChecksTo("Unity.Collections.LowLevel.ILSupport")] [assembly: IgnoresAccessChecksTo("Unity.InputSystem")] [assembly: IgnoresAccessChecksTo("Unity.InputSystem.ForUI")] [assembly: IgnoresAccessChecksTo("Unity.Jobs")] [assembly: IgnoresAccessChecksTo("Unity.Mathematics")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.Common")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.MetricTypes")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStats")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Component")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Configuration")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Implementation")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsReporting")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetworkProfiler.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetworkSolutionInterface")] [assembly: IgnoresAccessChecksTo("Unity.Netcode.Components")] [assembly: IgnoresAccessChecksTo("Unity.Netcode.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.Networking.Transport")] [assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Csg")] [assembly: IgnoresAccessChecksTo("Unity.ProBuilder")] [assembly: IgnoresAccessChecksTo("Unity.ProBuilder.KdTree")] [assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Poly2Tri")] [assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Stl")] [assembly: IgnoresAccessChecksTo("Unity.Profiling.Core")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.ShaderLibrary")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.HighDefinition.Config.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.HighDefinition.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary")] [assembly: IgnoresAccessChecksTo("Unity.Services.Authentication")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Analytics")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Components")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Configuration")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Device")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Environments")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Environments.Internal")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Internal")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Networking")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Registration")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Scheduler")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Telemetry")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Threading")] [assembly: IgnoresAccessChecksTo("Unity.Services.QoS")] [assembly: IgnoresAccessChecksTo("Unity.Services.Relay")] [assembly: IgnoresAccessChecksTo("Unity.TextMeshPro")] [assembly: IgnoresAccessChecksTo("Unity.Timeline")] [assembly: IgnoresAccessChecksTo("Unity.VisualEffectGraph.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.XR.CoreUtils")] [assembly: IgnoresAccessChecksTo("Unity.XR.Management")] [assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR")] [assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR.Features.ConformanceAutomation")] [assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR.Features.MetaQuestSupport")] [assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR.Features.MockRuntime")] [assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR.Features.OculusQuestSupport")] [assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR.Features.RuntimeDebugger")] [assembly: IgnoresAccessChecksTo("UnityEngine.ARModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.NVIDIAModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.SpatialTracking")] [assembly: IgnoresAccessChecksTo("UnityEngine.UI")] [assembly: IgnoresAccessChecksTo("UnityEngine.XR.LegacyInputHelpers")] [assembly: AssemblyCompany("Mirage")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+7a8d94cfcb6c39f5419fcc3491e37e5605b1284b")] [assembly: AssemblyProduct("Mirage")] [assembly: AssemblyTitle("Mirage")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: NetcodePatchedAssembly] namespace Mirage { [CompilationMapping(/*Could not decode attribute arguments.*/)] public static class Main { [SpecialName] [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] [CompilerGenerated] [CompilationMapping(/*Could not decode attribute arguments.*/)] internal struct main@52-2 : IAsyncStateMachine, IResumableStateMachine<TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>>> { public TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>> Data; public int ResumptionPoint; public FSharpFunc<Unit, ValueTask<Unit>> program; public Channel<FSharpResult<Unit, Exception>> channel; public ValueTaskAwaiter<Unit> awaiter; public override void MoveNext() { //IL_012b: 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_013d: 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_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) int resumptionPoint = ResumptionPoint; switch (resumptionPoint) { } Exception ex3 = default(Exception); Exception ex = default(Exception); try { bool flag2 = default(bool); bool flag = default(bool); switch (resumptionPoint) { default: flag = false; flag2 = false; ex = null; flag = flag || flag; break; case 1: break; } try { bool flag3; int num; bool flag4; switch (resumptionPoint) { default: awaiter = program.Invoke((Unit)null).GetAwaiter(); flag3 = true; if (awaiter.IsCompleted) { break; } if (false) { goto case 1; } ResumptionPoint = 1; num = 0; goto IL_008c; case 1: { num = 1; goto IL_008c; } IL_008c: flag4 = (byte)num != 0; flag3 = flag4; break; } int num2; if (flag3) { awaiter.GetResult(); _ = null; FSharpResult<Unit, Exception> item = FSharpResult<Unit, Exception>.NewOk((Unit)null); ValueTask valueTask = channel.writer.WriteAsync(item, channel.cancellationToken); num2 = 1; } else { ICriticalNotifyCompletion criticalNotifyCompletion = (ICriticalNotifyCompletion)(object)awaiter; Data.MethodBuilder.AwaitUnsafeOnCompleted(ref criticalNotifyCompletion, ref this); num2 = 0; } int num3; if (num2 != 0) { ValueTaskAwaiter<Unit> valueTaskAwaiter = default(ValueTaskAwaiter<Unit>); awaiter = valueTaskAwaiter; num3 = 1; } else { num3 = 0; } bool flag5 = (byte)num3 != 0; flag = flag5; } catch (object obj) { Exception ex2 = (Exception)obj; flag2 = true; ex = ex2; } int num4; if (flag2) { Exception ex2 = ex; FSharpResult<Unit, Exception> item = FSharpResult<Unit, Exception>.NewError(ex2); ValueTask valueTask = channel.writer.WriteAsync(item, channel.cancellationToken); num4 = 1; } else { num4 = (flag ? 1 : 0); } if (num4 != 0) { Data.MethodBuilder.SetResult(Data.Result); } } catch (object obj2) { ex = (Exception)obj2; ex3 = ex; } ex = ex3; if (ex != null) { Data.MethodBuilder.SetException(ex); } } void IAsyncStateMachine.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext this.MoveNext(); } public override void SetStateMachine(IAsyncStateMachine state) { Data.MethodBuilder.SetStateMachine(state); } void IAsyncStateMachine.SetStateMachine(IAsyncStateMachine state) { //ILSpy generated this explicit interface implementation from .override directive in SetStateMachine this.SetStateMachine(state); } public override int get_ResumptionPoint() { return ResumptionPoint; } public override TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>> get_Data() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return Data; } public override void set_Data(TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>> value) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) Data = value; } } [Serializable] [SpecialName] [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] [CompilationMapping(/*Could not decode attribute arguments.*/)] internal sealed class main@52-3 { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] public FSharpFunc<Unit, ValueTask<Unit>> program; [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] public Channel<FSharpResult<Unit, Exception>> channel; public main@52-3(FSharpFunc<Unit, ValueTask<Unit>> program, Channel<FSharpResult<Unit, Exception>> channel) { this.program = program; this.channel = channel; base..ctor(); } internal ValueTask<Unit> Invoke() { return thread@1-9(program, channel, null); } } [SpecialName] [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] [CompilerGenerated] [CompilationMapping(/*Could not decode attribute arguments.*/)] internal struct main@52-1 : IAsyncStateMachine, IResumableStateMachine<TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>>> { public TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>> Data; public int ResumptionPoint; public CancellationToken cancellationToken; public FSharpFunc<Unit, ValueTask<Unit>> program; public ValueTaskAwaiter<FSharpResult<Unit, Exception>> awaiter; public override void MoveNext() { //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) int resumptionPoint = ResumptionPoint; switch (resumptionPoint) { } Exception ex2 = default(Exception); Exception ex; try { bool flag; int num; bool flag2; switch (resumptionPoint) { default: { Channel<FSharpResult<Unit, Exception>> val = Channel.Channel<FSharpResult<Unit, Exception>>(cancellationToken); Task<ValueTask<Unit>> task = Task.Run((Func<ValueTask<Unit>>)new main@52-3(program, val).Invoke, cancellationToken); awaiter = val.reader.ReadAsync(val.cancellationToken).GetAwaiter(); flag = true; if (awaiter.IsCompleted) { break; } if (false) { goto case 1; } ResumptionPoint = 1; num = 0; goto IL_009d; } case 1: { num = 1; goto IL_009d; } IL_009d: flag2 = (byte)num != 0; flag = flag2; break; } int num2; if (flag) { FSharpResult<Unit, Exception> result = awaiter.GetResult(); FSharpResult<Unit, Exception> val2 = result; if (val2.Tag != 0) { throw val2.ErrorValue; } _ = val2.ResultValue; Data.Result = null; num2 = 1; } else { ICriticalNotifyCompletion criticalNotifyCompletion = (ICriticalNotifyCompletion)(object)awaiter; Data.MethodBuilder.AwaitUnsafeOnCompleted(ref criticalNotifyCompletion, ref this); num2 = 0; } if (num2 != 0) { ValueTaskAwaiter<FSharpResult<Unit, Exception>> valueTaskAwaiter = default(ValueTaskAwaiter<FSharpResult<Unit, Exception>>); awaiter = valueTaskAwaiter; if (true) { Data.MethodBuilder.SetResult(Data.Result); } } } catch (object obj) { ex = (Exception)obj; ex2 = ex; } ex = ex2; if (ex != null) { Data.MethodBuilder.SetException(ex); } } void IAsyncStateMachine.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext this.MoveNext(); } public override void SetStateMachine(IAsyncStateMachine state) { Data.MethodBuilder.SetStateMachine(state); } void IAsyncStateMachine.SetStateMachine(IAsyncStateMachine state) { //ILSpy generated this explicit interface implementation from .override directive in SetStateMachine this.SetStateMachine(state); } public override int get_ResumptionPoint() { return ResumptionPoint; } public override TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>> get_Data() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return Data; } public override void set_Data(TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>> value) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) Data = value; } } [Serializable] [SpecialName] [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] [CompilationMapping(/*Could not decode attribute arguments.*/)] internal static class main@67-6 { internal static void Invoke() { Mirage.Domain.Setting.Settings settings = Mirage.Domain.Setting.getSettings(); ValueTask<Unit> valueTask = Mirage.Domain.Audio.Recording.deleteRecordings(settings); } } [SpecialName] [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] [CompilerGenerated] [CompilationMapping(/*Could not decode attribute arguments.*/)] internal struct main@52-5 : IAsyncStateMachine, IResumableStateMachine<TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>>> { public TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>> Data; public int ResumptionPoint; public string pluginId; public string pluginName; public string pluginVersion; public Assembly assembly; public RuntimeAnimatorController maskedAnimatorController; public ValueTaskAwaiter<Mirage.Domain.Setting.Settings> awaiter; public override void MoveNext() { int resumptionPoint = ResumptionPoint; switch (resumptionPoint) { } Exception ex2 = default(Exception); Exception ex; try { bool flag; int num; bool flag2; switch (resumptionPoint) { default: { Main.initLobbyCompatibility(pluginName, pluginVersion); Main.initGeneralLethalConfig(assembly, Mirage.Domain.Config.localConfig.General@); Mirage.Domain.Netcode.initNetcodePatcher(assembly); DirectoryInfo directoryInfo = System.IO.Directory.CreateDirectory(Mirage.Domain.Directory.mirageDirectory); awaiter = Mirage.Domain.Setting.initSettings(Path.Join((ReadOnlySpan<char>)Mirage.Domain.Directory.mirageDirectory, (ReadOnlySpan<char>)"settings.json"), pluginId, pluginName, pluginVersion).GetAwaiter(); flag = true; if (awaiter.IsCompleted) { break; } if (false) { goto case 1; } ResumptionPoint = 1; num = 0; goto IL_00ce; } case 1: { num = 1; goto IL_00ce; } IL_00ce: flag2 = (byte)num != 0; flag = flag2; break; } int num2; if (flag) { Mirage.Domain.Setting.Settings result = awaiter.GetResult(); Mirage.Domain.Setting.Settings settings = result; Mirage.Domain.Logger.logInfo.Invoke("Loaded settings: " + JsonConvert.SerializeObject((object)settings, (Formatting)1)); ValueTask<Unit> valueTask = Mirage.Domain.Audio.Recording.deleteRecordings(settings); Application.quitting += main@67-6.Invoke; Mirage.Hook.Dissonance.cacheDissonance(); Mirage.Hook.Microphone.readMicrophone(Mirage.Domain.Directory.recordingDirectory); Mirage.Hook.Item.populateItems(); Mirage.Hook.AudioSpatializer.disableAudioSpatializer(); Mirage.Hook.Prefab.registerPrefab(); Mirage.Hook.Config.syncConfig(); Mirage.Hook.MaskedPlayerEnemy.hookMaskedEnemy(maskedAnimatorController); Mirage.Hook.PlayerControllerB.hookPlayerControllerB(); num2 = 1; } else { ICriticalNotifyCompletion criticalNotifyCompletion = (ICriticalNotifyCompletion)(object)awaiter; Data.MethodBuilder.AwaitUnsafeOnCompleted(ref criticalNotifyCompletion, ref this); num2 = 0; } if (num2 != 0) { ValueTaskAwaiter<Mirage.Domain.Setting.Settings> valueTaskAwaiter = default(ValueTaskAwaiter<Mirage.Domain.Setting.Settings>); awaiter = valueTaskAwaiter; if (true) { Data.MethodBuilder.SetResult(Data.Result); } } } catch (object obj) { ex = (Exception)obj; ex2 = ex; } ex = ex2; if (ex != null) { Data.MethodBuilder.SetException(ex); } } void IAsyncStateMachine.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext this.MoveNext(); } public override void SetStateMachine(IAsyncStateMachine state) { Data.MethodBuilder.SetStateMachine(state); } void IAsyncStateMachine.SetStateMachine(IAsyncStateMachine state) { //ILSpy generated this explicit interface implementation from .override directive in SetStateMachine this.SetStateMachine(state); } public override int get_ResumptionPoint() { return ResumptionPoint; } public override TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>> get_Data() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return Data; } public override void set_Data(TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>> value) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) Data = value; } } [Serializable] internal sealed class main@52-4 : FSharpFunc<Unit, ValueTask<Unit>> { public string pluginId; public string pluginName; public string pluginVersion; public Assembly assembly; public RuntimeAnimatorController maskedAnimatorController; [CompilerGenerated] [DebuggerNonUserCode] internal main@52-4(string pluginId, string pluginName, string pluginVersion, Assembly assembly, RuntimeAnimatorController maskedAnimatorController) { this.pluginId = pluginId; this.pluginName = pluginName; this.pluginVersion = pluginVersion; this.assembly = assembly; this.maskedAnimatorController = maskedAnimatorController; } public override ValueTask<Unit> Invoke(Unit unitVar0) { main@52-5 stateMachine = default(main@52-5); stateMachine.pluginId = pluginId; stateMachine.pluginName = pluginName; stateMachine.pluginVersion = pluginVersion; stateMachine.assembly = assembly; stateMachine.maskedAnimatorController = maskedAnimatorController; stateMachine.Data.MethodBuilder = AsyncValueTaskMethodBuilder<Unit>.Create(); stateMachine.Data.MethodBuilder.Start(ref stateMachine); return stateMachine.Data.MethodBuilder.Task; } } [Serializable] [SpecialName] [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] [CompilationMapping(/*Could not decode attribute arguments.*/)] internal sealed class main@34 : GeneratedSequenceBase<object> { public string pluginLocation; public string pluginId; public string pluginName; public string pluginVersion; public Assembly assembly; public AssetBundleCreateRequest bundleRequest; public AssetBundleRequest assetRequest; public RuntimeAnimatorController maskedAnimatorController; [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] public IEnumerator<LogCategory> @enum; [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] public int pc; [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] public object current; public main@34(string pluginLocation, string pluginId, string pluginName, string pluginVersion, Assembly assembly, AssetBundleCreateRequest bundleRequest, AssetBundleRequest assetRequest, RuntimeAnimatorController maskedAnimatorController, IEnumerator<LogCategory> @enum, int pc, object current) { this.pluginLocation = pluginLocation; this.pluginId = pluginId; this.pluginName = pluginName; this.pluginVersion = pluginVersion; this.assembly = assembly; this.bundleRequest = bundleRequest; this.assetRequest = assetRequest; this.maskedAnimatorController = maskedAnimatorController; this.@enum = @enum; this.pc = pc; this.current = current; base..ctor(); } public override int GenerateNext(ref IEnumerable<object> next) { //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Expected O, but got Unknown //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Expected O, but got Unknown //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) switch (pc) { default: Mirage.Domain.Logger.initLogger(pluginId); assembly = Assembly.GetExecutingAssembly(); bundleRequest = AssetBundle.LoadFromFileAsync(Path.Combine(pluginLocation, "Mirage.unity3d")); pc = 1; current = bundleRequest; return 1; case 1: { AssetBundle assetBundle = bundleRequest.assetBundle; object obj = assetBundle; if (obj == null || (obj is Object && !Object.op_Implicit((Object)obj))) { InvalidProgramException ex = new InvalidProgramException("Failed to load Mirage due to missing asset bundle: " + "Mirage.unity3d" + "."); if (0 == 0) { throw ex; } _ = (Unit)(object)null; } assetRequest = assetBundle.LoadAssetAsync<RuntimeAnimatorController>("metarig_0.controller"); pc = 2; current = assetRequest; return 1; } case 2: { maskedAnimatorController = (RuntimeAnimatorController)(object)assetRequest.asset; Array values = Enum.GetValues(typeof(LogCategory)); @enum = SeqModule.Cast<LogCategory>((IEnumerable)values).GetEnumerator(); pc = 3; while (@enum.MoveNext()) { LogCategory val = @enum.Current; Logs.SetLogLevel(val, (LogLevel)4); } goto case 3; } case 3: { pc = 4; IntrinsicFunctions.Dispose<IEnumerator<LogCategory>>(@enum); @enum = null; CancellationToken none = CancellationToken.None; FSharpFunc<Unit, ValueTask<Unit>> program = new main@52-4(pluginId, pluginName, pluginVersion, assembly, maskedAnimatorController); ValueTask<Unit> valueTask = func1@1-6(none, program); maskedAnimatorController = null; assetRequest = null; bundleRequest = null; assembly = null; pc = 4; break; } case 4: break; } current = null; return 0; } public override void Close() { Exception ex = default(Exception); while (true) { switch (pc) { case 4: if (ex != null) { throw ex; } return; } try { switch (pc) { case 3: pc = 4; IntrinsicFunctions.Dispose<IEnumerator<LogCategory>>(@enum); break; } pc = 4; current = null; } catch (object obj) { Exception ex2 = (Exception)obj; ex = ex2; } } } public override bool get_CheckClose() { return pc switch { 3 => true, 2 => false, 1 => false, _ => false, }; } [CompilerGenerated] [DebuggerNonUserCode] public override object get_LastGenerated() { return current; } [CompilerGenerated] [DebuggerNonUserCode] public override IEnumerator<object> GetFreshEnumerator() { return (IEnumerator<object>)(object)new main@34(pluginLocation, pluginId, pluginName, pluginVersion, null, null, null, null, null, 0, null); } } [Literal] [DebuggerBrowsable(DebuggerBrowsableState.Never)] public const string bundleName = "Mirage.unity3d"; [CompilerGenerated] internal static ValueTask<Unit> thread@1-9(FSharpFunc<Unit, ValueTask<Unit>> program, Channel<FSharpResult<Unit, Exception>> channel, Unit unitVar0) { main@52-2 stateMachine = default(main@52-2); stateMachine.program = program; stateMachine.channel = channel; stateMachine.Data.MethodBuilder = AsyncValueTaskMethodBuilder<Unit>.Create(); stateMachine.Data.MethodBuilder.Start(ref stateMachine); return stateMachine.Data.MethodBuilder.Task; } [CompilerGenerated] internal static ValueTask<Unit> func1@1-6(CancellationToken cancellationToken, FSharpFunc<Unit, ValueTask<Unit>> program) { main@52-1 stateMachine = default(main@52-1); stateMachine.cancellationToken = cancellationToken; stateMachine.program = program; stateMachine.Data.MethodBuilder = AsyncValueTaskMethodBuilder<Unit>.Create(); stateMachine.Data.MethodBuilder.Start(ref stateMachine); return stateMachine.Data.MethodBuilder.Task; } [CompilationArgumentCounts(new int[] { 1, 1, 1, 1 })] public static IEnumerator main(string pluginLocation, string pluginId, string pluginName, string pluginVersion) { return (IEnumerator)(object)new main@34(pluginLocation, pluginId, pluginName, pluginVersion, null, null, null, null, null, 0, null); } } } namespace <StartupCode$Mirage>.$Mirage { internal static class Main { } } [CompilationMapping(/*Could not decode attribute arguments.*/)] public static class AssemblyInfo { } namespace <StartupCode$Mirage> { internal static class $AssemblyInfo { } } namespace Mirage.Hook { [CompilationMapping(/*Could not decode attribute arguments.*/)] public static class Microphone { [Serializable] [Struct] [CompilationMapping(/*Could not decode attribute arguments.*/)] public struct ProcessingInput : IEquatable<ProcessingInput>, IStructuralEquatable, IComparable<ProcessingInput>, IComparable, IStructuralComparable { [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal Samples samples@; [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal WaveFormat format@; [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal bool isReady@; [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal bool isPlayerDead@; [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal bool pushToTalkEnabled@; [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal bool isMuted@; [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal bool allowRecordVoice@; [CompilationMapping(/*Could not decode attribute arguments.*/)] public readonly Samples samples { [CompilerGenerated] [DebuggerNonUserCode] get { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return samples@; } } [CompilationMapping(/*Could not decode attribute arguments.*/)] public readonly WaveFormat format { [CompilerGenerated] [DebuggerNonUserCode] get { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return format@; } } [CompilationMapping(/*Could not decode attribute arguments.*/)] public readonly bool isReady { [CompilerGenerated] [DebuggerNonUserCode] get { return isReady@; } } [CompilationMapping(/*Could not decode attribute arguments.*/)] public readonly bool isPlayerDead { [CompilerGenerated] [DebuggerNonUserCode] get { return isPlayerDead@; } } [CompilationMapping(/*Could not decode attribute arguments.*/)] public readonly bool pushToTalkEnabled { [CompilerGenerated] [DebuggerNonUserCode] get { return pushToTalkEnabled@; } } [CompilationMapping(/*Could not decode attribute arguments.*/)] public readonly bool isMuted { [CompilerGenerated] [DebuggerNonUserCode] get { return isMuted@; } } [CompilationMapping(/*Could not decode attribute arguments.*/)] public readonly bool allowRecordVoice { [CompilerGenerated] [DebuggerNonUserCode] get { return allowRecordVoice@; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(ProcessingInput))] public ProcessingInput(Samples samples, WaveFormat format, bool isReady, bool isPlayerDead, bool pushToTalkEnabled, bool isMuted, bool allowRecordVoice) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) samples@ = samples; format@ = format; isReady@ = isReady; isPlayerDead@ = isPlayerDead; pushToTalkEnabled@ = pushToTalkEnabled; isMuted@ = isMuted; allowRecordVoice@ = allowRecordVoice; } [CompilerGenerated] public override string ToString() { return ExtraTopLevelOperators.PrintFormatToString<FSharpFunc<ProcessingInput, string>>((PrintfFormat<FSharpFunc<ProcessingInput, string>, Unit, string, string>)(object)new PrintfFormat<FSharpFunc<ProcessingInput, string>, Unit, string, string, ProcessingInput>("%+A")).Invoke(this); } [CompilerGenerated] public sealed int CompareTo(ProcessingInput obj) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) IComparer genericComparer = LanguagePrimitives.GenericComparer; Samples val = samples@; Samples val2 = obj.samples@; int num = ((Samples)(ref val)).CompareTo((object)val2, genericComparer); if (num < 0) { return num; } if (num > 0) { return num; } genericComparer = LanguagePrimitives.GenericComparer; WaveFormat val3 = format@; WaveFormat val4 = obj.format@; int num2 = ((WaveFormat)(ref val3)).CompareTo((object)val4, genericComparer); if (num2 < 0) { return num2; } if (num2 > 0) { return num2; } genericComparer = LanguagePrimitives.GenericComparer; bool flag = isReady@; bool flag2 = obj.isReady@; int num3 = (flag ? 1 : 0) - (flag2 ? 1 : 0); if (num3 < 0) { return num3; } if (num3 > 0) { return num3; } genericComparer = LanguagePrimitives.GenericComparer; flag = isPlayerDead@; flag2 = obj.isPlayerDead@; int num4 = (flag ? 1 : 0) - (flag2 ? 1 : 0); if (num4 < 0) { return num4; } if (num4 > 0) { return num4; } genericComparer = LanguagePrimitives.GenericComparer; flag = pushToTalkEnabled@; flag2 = obj.pushToTalkEnabled@; int num5 = (flag ? 1 : 0) - (flag2 ? 1 : 0); if (num5 < 0) { return num5; } if (num5 > 0) { return num5; } genericComparer = LanguagePrimitives.GenericComparer; flag = isMuted@; flag2 = obj.isMuted@; int num6 = (flag ? 1 : 0) - (flag2 ? 1 : 0); if (num6 < 0) { return num6; } if (num6 > 0) { return num6; } genericComparer = LanguagePrimitives.GenericComparer; flag = allowRecordVoice@; flag2 = obj.allowRecordVoice@; return (flag ? 1 : 0) - (flag2 ? 1 : 0); } [CompilerGenerated] public sealed int CompareTo(object obj) { return CompareTo((ProcessingInput)obj); } [CompilerGenerated] public sealed int CompareTo(object obj, IComparer comp) { //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_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: 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_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) ProcessingInput processingInput = (ProcessingInput)obj; Samples val = samples@; Samples val2 = processingInput.samples@; int num = ((Samples)(ref val)).CompareTo((object)val2, comp); if (num < 0) { return num; } if (num > 0) { return num; } WaveFormat val3 = format@; WaveFormat val4 = processingInput.format@; int num2 = ((WaveFormat)(ref val3)).CompareTo((object)val4, comp); if (num2 < 0) { return num2; } if (num2 > 0) { return num2; } bool flag = isReady@; bool flag2 = processingInput.isReady@; int num3 = (flag ? 1 : 0) - (flag2 ? 1 : 0); if (num3 < 0) { return num3; } if (num3 > 0) { return num3; } flag = isPlayerDead@; flag2 = processingInput.isPlayerDead@; int num4 = (flag ? 1 : 0) - (flag2 ? 1 : 0); if (num4 < 0) { return num4; } if (num4 > 0) { return num4; } flag = pushToTalkEnabled@; flag2 = processingInput.pushToTalkEnabled@; int num5 = (flag ? 1 : 0) - (flag2 ? 1 : 0); if (num5 < 0) { return num5; } if (num5 > 0) { return num5; } flag = isMuted@; flag2 = processingInput.isMuted@; int num6 = (flag ? 1 : 0) - (flag2 ? 1 : 0); if (num6 < 0) { return num6; } if (num6 > 0) { return num6; } flag = allowRecordVoice@; flag2 = processingInput.allowRecordVoice@; return (flag ? 1 : 0) - (flag2 ? 1 : 0); } [CompilerGenerated] public sealed int GetHashCode(IEqualityComparer comp) { //IL_0071: 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_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) int num = 0; num = -1640531527 + ((allowRecordVoice@ ? 1 : 0) + ((num << 6) + (num >> 2))); num = -1640531527 + ((isMuted@ ? 1 : 0) + ((num << 6) + (num >> 2))); num = -1640531527 + ((pushToTalkEnabled@ ? 1 : 0) + ((num << 6) + (num >> 2))); num = -1640531527 + ((isPlayerDead@ ? 1 : 0) + ((num << 6) + (num >> 2))); num = -1640531527 + ((isReady@ ? 1 : 0) + ((num << 6) + (num >> 2))); WaveFormat val = format@; num = -1640531527 + (((WaveFormat)(ref val)).GetHashCode(comp) + ((num << 6) + (num >> 2))); Samples val2 = samples@; return -1640531527 + (((Samples)(ref val2)).GetHashCode(comp) + ((num << 6) + (num >> 2))); } [CompilerGenerated] public sealed override int GetHashCode() { return GetHashCode(LanguagePrimitives.GenericEqualityComparer); } [CompilerGenerated] public bool Equals(ProcessingInput obj, IEqualityComparer comp) { //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_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: 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_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) Samples val = samples@; Samples val2 = obj.samples@; if (((Samples)(ref val)).Equals((object)val2, comp)) { WaveFormat val3 = format@; WaveFormat val4 = obj.format@; if (((WaveFormat)(ref val3)).Equals((object)val4, comp)) { if (isReady@ == obj.isReady@) { if (isPlayerDead@ == obj.isPlayerDead@) { if (pushToTalkEnabled@ == obj.pushToTalkEnabled@) { if (isMuted@ == obj.isMuted@) { return allowRecordVoice@ == obj.allowRecordVoice@; } return false; } return false; } return false; } return false; } return false; } return false; } [CompilerGenerated] public sealed bool Equals(object obj, IEqualityComparer comp) { if (obj is ProcessingInput obj2) { return Equals(obj2, comp); } return false; } [CompilerGenerated] public sealed bool Equals(ProcessingInput obj) { //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_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) Samples val = samples@; if (((Samples)(ref val)).Equals(obj.samples@)) { WaveFormat val2 = format@; if (((WaveFormat)(ref val2)).Equals(obj.format@)) { if (isReady@ == obj.isReady@) { if (isPlayerDead@ == obj.isPlayerDead@) { if (pushToTalkEnabled@ == obj.pushToTalkEnabled@) { if (isMuted@ == obj.isMuted@) { return allowRecordVoice@ == obj.allowRecordVoice@; } return false; } return false; } return false; } return false; } return false; } return false; } [CompilerGenerated] public sealed override bool Equals(object obj) { if (obj is ProcessingInput) { return Equals((ProcessingInput)obj); } return false; } } [Serializable] [Struct] [CompilationMapping(/*Could not decode attribute arguments.*/)] public struct ProcessingState : IEquatable<ProcessingState>, IStructuralEquatable, IComparable<ProcessingState>, IComparable, IStructuralComparable { [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal FSharpValueOption<float> forcedProbability@; [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal bool allowRecordVoice@; [CompilationMapping(/*Could not decode attribute arguments.*/)] public readonly FSharpValueOption<float> forcedProbability { [CompilerGenerated] [DebuggerNonUserCode] get { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return forcedProbability@; } } [CompilationMapping(/*Could not decode attribute arguments.*/)] public readonly bool allowRecordVoice { [CompilerGenerated] [DebuggerNonUserCode] get { return allowRecordVoice@; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(ProcessingState))] public ProcessingState(FSharpValueOption<float> forcedProbability, bool allowRecordVoice) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) forcedProbability@ = forcedProbability; allowRecordVoice@ = allowRecordVoice; } [CompilerGenerated] public override string ToString() { return ExtraTopLevelOperators.PrintFormatToString<FSharpFunc<ProcessingState, string>>((PrintfFormat<FSharpFunc<ProcessingState, string>, Unit, string, string>)(object)new PrintfFormat<FSharpFunc<ProcessingState, string>, Unit, string, string, ProcessingState>("%+A")).Invoke(this); } [CompilerGenerated] public sealed int CompareTo(ProcessingState obj) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) IComparer genericComparer = LanguagePrimitives.GenericComparer; FSharpValueOption<float> val = forcedProbability@; FSharpValueOption<float> val2 = obj.forcedProbability@; int num = val.CompareTo((object)val2, genericComparer); if (num < 0) { return num; } if (num > 0) { return num; } genericComparer = LanguagePrimitives.GenericComparer; bool flag = allowRecordVoice@; bool flag2 = obj.allowRecordVoice@; return (flag ? 1 : 0) - (flag2 ? 1 : 0); } [CompilerGenerated] public sealed int CompareTo(object obj) { return CompareTo((ProcessingState)obj); } [CompilerGenerated] public sealed int CompareTo(object obj, IComparer comp) { //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_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: 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) ProcessingState processingState = (ProcessingState)obj; FSharpValueOption<float> val = forcedProbability@; FSharpValueOption<float> val2 = processingState.forcedProbability@; int num = val.CompareTo((object)val2, comp); if (num < 0) { return num; } if (num > 0) { return num; } bool flag = allowRecordVoice@; bool flag2 = processingState.allowRecordVoice@; return (flag ? 1 : 0) - (flag2 ? 1 : 0); } [CompilerGenerated] public sealed int GetHashCode(IEqualityComparer comp) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) int num = 0; num = -1640531527 + ((allowRecordVoice@ ? 1 : 0) + ((num << 6) + (num >> 2))); FSharpValueOption<float> val = forcedProbability@; return -1640531527 + (val.GetHashCode(comp) + ((num << 6) + (num >> 2))); } [CompilerGenerated] public sealed override int GetHashCode() { return GetHashCode(LanguagePrimitives.GenericEqualityComparer); } [CompilerGenerated] public bool Equals(ProcessingState obj, IEqualityComparer comp) { //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_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: 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) FSharpValueOption<float> val = forcedProbability@; FSharpValueOption<float> val2 = obj.forcedProbability@; if (val.Equals((object)val2, comp)) { return allowRecordVoice@ == obj.allowRecordVoice@; } return false; } [CompilerGenerated] public sealed bool Equals(object obj, IEqualityComparer comp) { if (obj is ProcessingState obj2) { return Equals(obj2, comp); } return false; } [CompilerGenerated] public sealed bool Equals(ProcessingState obj) { //IL_0001: 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) if (HashCompare.GenericEqualityERIntrinsic<FSharpValueOption<float>>(forcedProbability@, obj.forcedProbability@)) { return allowRecordVoice@ == obj.allowRecordVoice@; } return false; } [CompilerGenerated] public sealed override bool Equals(object obj) { if (obj is ProcessingState) { return Equals((ProcessingState)obj); } return false; } } [Serializable] [Struct] [CompilationMapping(/*Could not decode attribute arguments.*/)] public struct BufferInput : IEquatable<BufferInput>, IStructuralEquatable, IComparable<BufferInput>, IComparable, IStructuralComparable { [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal Samples samples@; [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal int sampleRate@; [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal int channels@; [CompilationMapping(/*Could not decode attribute arguments.*/)] public readonly Samples samples { [CompilerGenerated] [DebuggerNonUserCode] get { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return samples@; } } [CompilationMapping(/*Could not decode attribute arguments.*/)] public readonly int sampleRate { [CompilerGenerated] [DebuggerNonUserCode] get { return sampleRate@; } } [CompilationMapping(/*Could not decode attribute arguments.*/)] public readonly int channels { [CompilerGenerated] [DebuggerNonUserCode] get { return channels@; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(BufferInput))] public BufferInput(Samples samples, int sampleRate, int channels) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) samples@ = samples; sampleRate@ = sampleRate; channels@ = channels; } [CompilerGenerated] public override string ToString() { return ExtraTopLevelOperators.PrintFormatToString<FSharpFunc<BufferInput, string>>((PrintfFormat<FSharpFunc<BufferInput, string>, Unit, string, string>)(object)new PrintfFormat<FSharpFunc<BufferInput, string>, Unit, string, string, BufferInput>("%+A")).Invoke(this); } [CompilerGenerated] public sealed int CompareTo(BufferInput obj) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) IComparer genericComparer = LanguagePrimitives.GenericComparer; Samples val = samples@; Samples val2 = obj.samples@; int num = ((Samples)(ref val)).CompareTo((object)val2, genericComparer); if (num < 0) { return num; } if (num > 0) { return num; } genericComparer = LanguagePrimitives.GenericComparer; int num2 = sampleRate@; int num3 = obj.sampleRate@; int num4 = ((num2 > num3) ? 1 : 0) - ((num2 < num3) ? 1 : 0); if (num4 < 0) { return num4; } if (num4 > 0) { return num4; } genericComparer = LanguagePrimitives.GenericComparer; num2 = channels@; num3 = obj.channels@; return ((num2 > num3) ? 1 : 0) - ((num2 < num3) ? 1 : 0); } [CompilerGenerated] public sealed int CompareTo(object obj) { return CompareTo((BufferInput)obj); } [CompilerGenerated] public sealed int CompareTo(object obj, IComparer comp) { //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_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: 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) BufferInput bufferInput = (BufferInput)obj; Samples val = samples@; Samples val2 = bufferInput.samples@; int num = ((Samples)(ref val)).CompareTo((object)val2, comp); if (num < 0) { return num; } if (num > 0) { return num; } int num2 = sampleRate@; int num3 = bufferInput.sampleRate@; int num4 = ((num2 > num3) ? 1 : 0) - ((num2 < num3) ? 1 : 0); if (num4 < 0) { return num4; } if (num4 > 0) { return num4; } num2 = channels@; num3 = bufferInput.channels@; return ((num2 > num3) ? 1 : 0) - ((num2 < num3) ? 1 : 0); } [CompilerGenerated] public sealed int GetHashCode(IEqualityComparer comp) { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) int num = 0; num = -1640531527 + (channels@ + ((num << 6) + (num >> 2))); num = -1640531527 + (sampleRate@ + ((num << 6) + (num >> 2))); Samples val = samples@; return -1640531527 + (((Samples)(ref val)).GetHashCode(comp) + ((num << 6) + (num >> 2))); } [CompilerGenerated] public sealed override int GetHashCode() { return GetHashCode(LanguagePrimitives.GenericEqualityComparer); } [CompilerGenerated] public bool Equals(BufferInput obj, IEqualityComparer comp) { //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_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: 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) Samples val = samples@; Samples val2 = obj.samples@; if (((Samples)(ref val)).Equals((object)val2, comp)) { if (sampleRate@ == obj.sampleRate@) { return channels@ == obj.channels@; } return false; } return false; } [CompilerGenerated] public sealed bool Equals(object obj, IEqualityComparer comp) { if (obj is BufferInput obj2) { return Equals(obj2, comp); } return false; } [CompilerGenerated] public sealed bool Equals(BufferInput obj) { //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) Samples val = samples@; if (((Samples)(ref val)).Equals(obj.samples@)) { if (sampleRate@ == obj.sampleRate@) { return channels@ == obj.channels@; } return false; } return false; } [CompilerGenerated] public sealed override bool Equals(object obj) { if (obj is BufferInput) { return Equals((BufferInput)obj); } return false; } } [SpecialName] [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] [CompilerGenerated] [CompilationMapping(/*Could not decode attribute arguments.*/)] internal struct consumer@63-7 : IAsyncStateMachine, IResumableStateMachine<TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>>> { public TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>> Data; public int ResumptionPoint; public ValueTaskAwaiter<BufferInput> awaiter; public override void MoveNext() { //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Expected O, but got Unknown int resumptionPoint = ResumptionPoint; switch (resumptionPoint) { } Exception ex2 = default(Exception); Exception ex; try { bool flag; int num; bool flag2; switch (resumptionPoint) { default: awaiter = channel@61.reader.ReadAsync(channel@61.cancellationToken).GetAwaiter(); flag = true; if (awaiter.IsCompleted) { break; } if (false) { goto case 1; } ResumptionPoint = 1; num = 0; goto IL_0074; case 1: { num = 1; goto IL_0074; } IL_0074: flag2 = (byte)num != 0; flag = flag2; break; } int num2; if (flag) { BufferInput result = awaiter.GetResult(); BufferInput bufferInput = result; object instance = StartOfRound.Instance; if (instance == null || (instance is Object && !Object.op_Implicit((Object)instance))) { goto IL_015a; } ProcessingInput processingInput = new ProcessingInput(bufferInput.samples@, new WaveFormat(bufferInput.sampleRate@, bufferInput.channels@), isReady, StartOfRound.Instance.localPlayerController.isPlayerDead, IngamePlayerSettings.Instance.settings.pushToTalk, Dissonance.getDissonance().IsMuted, Mirage.Domain.Setting.getSettings().allowRecordVoice@); func2@1(FSharpValueOption<ProcessingInput>.NewValueSome(processingInput)); num2 = 1; } else { ICriticalNotifyCompletion criticalNotifyCompletion = (ICriticalNotifyCompletion)(object)awaiter; Data.MethodBuilder.AwaitUnsafeOnCompleted(ref criticalNotifyCompletion, ref this); num2 = 0; } if (num2 != 0) { goto IL_015a; } goto end_IL_0019; IL_015a: ValueTaskAwaiter<BufferInput> valueTaskAwaiter = default(ValueTaskAwaiter<BufferInput>); awaiter = valueTaskAwaiter; if (true) { Data.MethodBuilder.SetResult(Data.Result); } end_IL_0019:; } catch (object obj) { ex = (Exception)obj; ex2 = ex; } ex = ex2; if (ex != null) { Data.MethodBuilder.SetException(ex); } } void IAsyncStateMachine.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext this.MoveNext(); } public override void SetStateMachine(IAsyncStateMachine state) { Data.MethodBuilder.SetStateMachine(state); } void IAsyncStateMachine.SetStateMachine(IAsyncStateMachine state) { //ILSpy generated this explicit interface implementation from .override directive in SetStateMachine this.SetStateMachine(state); } public override int get_ResumptionPoint() { return ResumptionPoint; } public override TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>> get_Data() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return Data; } public override void set_Data(TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>> value) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) Data = value; } } [SpecialName] [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] [CompilerGenerated] [CompilationMapping(/*Could not decode attribute arguments.*/)] internal struct consumer@63-8 : IAsyncStateMachine, IResumableStateMachine<TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>>> { public TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>> Data; public int ResumptionPoint; public ValueTaskAwaiter<Unit> awaiter; public override void MoveNext() { int resumptionPoint = ResumptionPoint; switch (resumptionPoint) { } Exception ex2 = default(Exception); Exception ex; try { bool flag; int num; bool flag2; bool flag3; int num2; int num3; bool flag4; switch (resumptionPoint) { default: flag = true; goto IL_00cf; case 1: { num = 1; goto IL_0069; } IL_00cf: if (flag) { awaiter = program@1-7(null).GetAwaiter(); flag2 = true; if (awaiter.IsCompleted) { goto IL_0073; } if (false) { goto case 1; } ResumptionPoint = 1; num = 0; goto IL_0069; } if (flag) { Data.MethodBuilder.SetResult(Data.Result); } break; IL_0069: flag3 = (byte)num != 0; flag2 = flag3; goto IL_0073; IL_0073: if (flag2) { awaiter.GetResult(); _ = null; num2 = 1; } else { ICriticalNotifyCompletion criticalNotifyCompletion = (ICriticalNotifyCompletion)(object)awaiter; Data.MethodBuilder.AwaitUnsafeOnCompleted(ref criticalNotifyCompletion, ref this); num2 = 0; } if (num2 != 0) { awaiter = default(ValueTaskAwaiter<Unit>); num3 = 1; } else { num3 = 0; } flag4 = (byte)num3 != 0; flag = flag4; resumptionPoint = 0; goto IL_00cf; } } catch (object obj) { ex = (Exception)obj; ex2 = ex; } ex = ex2; if (ex != null) { Data.MethodBuilder.SetException(ex); } } void IAsyncStateMachine.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext this.MoveNext(); } public override void SetStateMachine(IAsyncStateMachine state) { Data.MethodBuilder.SetStateMachine(state); } void IAsyncStateMachine.SetStateMachine(IAsyncStateMachine state) { //ILSpy generated this explicit interface implementation from .override directive in SetStateMachine this.SetStateMachine(state); } public override int get_ResumptionPoint() { return ResumptionPoint; } public override TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>> get_Data() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return Data; } public override void set_Data(TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>> value) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) Data = value; } } [Serializable] internal sealed class consumer@63-6 : FSharpFunc<Unit, ValueTask<Unit>> { internal static readonly consumer@63-6 @_instance = new consumer@63-6(); [CompilerGenerated] [DebuggerNonUserCode] internal consumer@63-6() { } public override ValueTask<Unit> Invoke(Unit unitVar0) { consumer@63-8 stateMachine = default(consumer@63-8); stateMachine.Data.MethodBuilder = AsyncValueTaskMethodBuilder<Unit>.Create(); stateMachine.Data.MethodBuilder.Start(ref stateMachine); return stateMachine.Data.MethodBuilder.Task; } } [SpecialName] [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] [CompilerGenerated] [CompilationMapping(/*Could not decode attribute arguments.*/)] internal struct bufferChannel@79-2 : IAsyncStateMachine, IResumableStateMachine<TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>>> { public TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>> Data; public int ResumptionPoint; public FSharpFunc<Unit, ValueTask<Unit>> program; public Channel<FSharpResult<Unit, Exception>> channel; public ValueTaskAwaiter<Unit> awaiter; public override void MoveNext() { //IL_012b: 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_013d: 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_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) int resumptionPoint = ResumptionPoint; switch (resumptionPoint) { } Exception ex3 = default(Exception); Exception ex = default(Exception); try { bool flag2 = default(bool); bool flag = default(bool); switch (resumptionPoint) { default: flag = false; flag2 = false; ex = null; flag = flag || flag; break; case 1: break; } try { bool flag3; int num; bool flag4; switch (resumptionPoint) { default: awaiter = program.Invoke((Unit)null).GetAwaiter(); flag3 = true; if (awaiter.IsCompleted) { break; } if (false) { goto case 1; } ResumptionPoint = 1; num = 0; goto IL_008c; case 1: { num = 1; goto IL_008c; } IL_008c: flag4 = (byte)num != 0; flag3 = flag4; break; } int num2; if (flag3) { awaiter.GetResult(); _ = null; FSharpResult<Unit, Exception> item = FSharpResult<Unit, Exception>.NewOk((Unit)null); ValueTask valueTask = channel.writer.WriteAsync(item, channel.cancellationToken); num2 = 1; } else { ICriticalNotifyCompletion criticalNotifyCompletion = (ICriticalNotifyCompletion)(object)awaiter; Data.MethodBuilder.AwaitUnsafeOnCompleted(ref criticalNotifyCompletion, ref this); num2 = 0; } int num3; if (num2 != 0) { ValueTaskAwaiter<Unit> valueTaskAwaiter = default(ValueTaskAwaiter<Unit>); awaiter = valueTaskAwaiter; num3 = 1; } else { num3 = 0; } bool flag5 = (byte)num3 != 0; flag = flag5; } catch (object obj) { Exception ex2 = (Exception)obj; flag2 = true; ex = ex2; } int num4; if (flag2) { Exception ex2 = ex; FSharpResult<Unit, Exception> item = FSharpResult<Unit, Exception>.NewError(ex2); ValueTask valueTask = channel.writer.WriteAsync(item, channel.cancellationToken); num4 = 1; } else { num4 = (flag ? 1 : 0); } if (num4 != 0) { Data.MethodBuilder.SetResult(Data.Result); } } catch (object obj2) { ex = (Exception)obj2; ex3 = ex; } ex = ex3; if (ex != null) { Data.MethodBuilder.SetException(ex); } } void IAsyncStateMachine.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext this.MoveNext(); } public override void SetStateMachine(IAsyncStateMachine state) { Data.MethodBuilder.SetStateMachine(state); } void IAsyncStateMachine.SetStateMachine(IAsyncStateMachine state) { //ILSpy generated this explicit interface implementation from .override directive in SetStateMachine this.SetStateMachine(state); } public override int get_ResumptionPoint() { return ResumptionPoint; } public override TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>> get_Data() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return Data; } public override void set_Data(TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>> value) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) Data = value; } } [Serializable] [SpecialName] [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] [CompilationMapping(/*Could not decode attribute arguments.*/)] internal sealed class bufferChannel@79-3 { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] public FSharpFunc<Unit, ValueTask<Unit>> program; [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] public Channel<FSharpResult<Unit, Exception>> channel; public bufferChannel@79-3(FSharpFunc<Unit, ValueTask<Unit>> program, Channel<FSharpResult<Unit, Exception>> channel) { this.program = program; this.channel = channel; base..ctor(); } internal ValueTask<Unit> Invoke() { return thread@1-7(program, channel, null); } } [SpecialName] [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] [CompilerGenerated] [CompilationMapping(/*Could not decode attribute arguments.*/)] internal struct bufferChannel@79-1 : IAsyncStateMachine, IResumableStateMachine<TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>>> { public TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>> Data; public int ResumptionPoint; public CancellationToken cancellationToken; public FSharpFunc<Unit, ValueTask<Unit>> program; public ValueTaskAwaiter<FSharpResult<Unit, Exception>> awaiter; public override void MoveNext() { //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) int resumptionPoint = ResumptionPoint; switch (resumptionPoint) { } Exception ex2 = default(Exception); Exception ex; try { bool flag; int num; bool flag2; switch (resumptionPoint) { default: { Channel<FSharpResult<Unit, Exception>> val = Channel.Channel<FSharpResult<Unit, Exception>>(cancellationToken); Task<ValueTask<Unit>> task = Task.Run((Func<ValueTask<Unit>>)new bufferChannel@79-3(program, val).Invoke, cancellationToken); awaiter = val.reader.ReadAsync(val.cancellationToken).GetAwaiter(); flag = true; if (awaiter.IsCompleted) { break; } if (false) { goto case 1; } ResumptionPoint = 1; num = 0; goto IL_009d; } case 1: { num = 1; goto IL_009d; } IL_009d: flag2 = (byte)num != 0; flag = flag2; break; } int num2; if (flag) { FSharpResult<Unit, Exception> result = awaiter.GetResult(); FSharpResult<Unit, Exception> val2 = result; if (val2.Tag != 0) { throw val2.ErrorValue; } _ = val2.ResultValue; Data.Result = null; num2 = 1; } else { ICriticalNotifyCompletion criticalNotifyCompletion = (ICriticalNotifyCompletion)(object)awaiter; Data.MethodBuilder.AwaitUnsafeOnCompleted(ref criticalNotifyCompletion, ref this); num2 = 0; } if (num2 != 0) { ValueTaskAwaiter<FSharpResult<Unit, Exception>> valueTaskAwaiter = default(ValueTaskAwaiter<FSharpResult<Unit, Exception>>); awaiter = valueTaskAwaiter; if (true) { Data.MethodBuilder.SetResult(Data.Result); } } } catch (object obj) { ex = (Exception)obj; ex2 = ex; } ex = ex2; if (ex != null) { Data.MethodBuilder.SetException(ex); } } void IAsyncStateMachine.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext this.MoveNext(); } public override void SetStateMachine(IAsyncStateMachine state) { Data.MethodBuilder.SetStateMachine(state); } void IAsyncStateMachine.SetStateMachine(IAsyncStateMachine state) { //ILSpy generated this explicit interface implementation from .override directive in SetStateMachine this.SetStateMachine(state); } public override int get_ResumptionPoint() { return ResumptionPoint; } public override TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>> get_Data() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return Data; } public override void set_Data(TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>> value) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) Data = value; } } [Serializable] internal sealed class bufferChannel@79-4 : FSharpFunc<FSharpFunc<Unit, ValueTask<Unit>>, Unit> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] public CancellationToken cancellationToken; [CompilerGenerated] [DebuggerNonUserCode] internal bufferChannel@79-4(CancellationToken cancellationToken) { this.cancellationToken = cancellationToken; } public override Unit Invoke(FSharpFunc<Unit, ValueTask<Unit>> x) { ValueTask<Unit> valueTask = func1@1-4(cancellationToken, x); return null; } } [Serializable] internal sealed class bufferChannel@79 : FSharpFunc<CancellationToken, FSharpFunc<FSharpFunc<Unit, ValueTask<Unit>>, Unit>> { internal static readonly bufferChannel@79 @_instance = new bufferChannel@79(); [CompilerGenerated] [DebuggerNonUserCode] internal bufferChannel@79() { } public override FSharpFunc<FSharpFunc<Unit, ValueTask<Unit>>, Unit> Invoke(CancellationToken cancellationToken) { return new bufferChannel@79-4(cancellationToken); } } [Serializable] [CompilationMapping(/*Could not decode attribute arguments.*/)] public class MicrophoneSubscriber : IMicrophoneSubscriber { unsafe virtual void IMicrophoneSubscriber.ReceiveMicrophoneData(ArraySegment<float> buffer, WaveFormat format) { //IL_003d: Unknown result type (might be due to invalid IL or missing references) float[] array = ArrayPool<float>.Shared.Rent(buffer.Count); Buffer.BlockCopy(buffer.Array, buffer.Offset, array, 0, buffer.Count * sizeof(float)); BufferInput item = new BufferInput(new Samples(array, buffer.Count), format.SampleRate, format.Channels); ValueTask valueTask = bufferChannel.writer.WriteAsync(item, bufferChannel.cancellationToken); } virtual void IMicrophoneSubscriber.Reset() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) FSharpValueOption<ProcessingInput> valueNone = FSharpValueOption<ProcessingInput>.ValueNone; ValueTask valueTask = processingChannel.writer.WriteAsync(valueNone, processingChannel.cancellationToken); } } [Serializable] internal sealed class recorder@100 : FSharpFunc<ProcessingState, bool> { internal static readonly recorder@100 @_instance = new recorder@100(); [CompilerGenerated] [DebuggerNonUserCode] internal recorder@100() { } public override bool Invoke(ProcessingState _arg1) { return _arg1.allowRecordVoice@; } } [Serializable] internal sealed class voiceDetector@105 : FSharpFunc<ProcessingState, FSharpValueOption<float>> { internal static readonly voiceDetector@105 @_instance = new voiceDetector@105(); [CompilerGenerated] [DebuggerNonUserCode] internal voiceDetector@105() { } public override FSharpValueOption<float> Invoke(ProcessingState _arg2) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) return _arg2.forcedProbability@; } } [Serializable] internal sealed class voiceDetector@108-1 : FSharpFunc<float[], int, float> { public SileroVAD silero; [CompilerGenerated] [DebuggerNonUserCode] internal voiceDetector@108-1(SileroVAD silero) { this.silero = silero; } public override float Invoke(float[] pcmData, int pcmLength) { return API.detectSpeech(silero, pcmData, pcmLength); } } [Serializable] internal sealed class voiceDetector@108-2 : FSharpFunc<Samples, FSharpFunc<int, float>> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] public FSharpFunc<float[], FSharpFunc<int, float>> func2; [CompilerGenerated] [DebuggerNonUserCode] internal voiceDetector@108-2(FSharpFunc<float[], FSharpFunc<int, float>> func2) { this.func2 = func2; } public override FSharpFunc<int, float> Invoke(Samples x) { return func2.Invoke(((Samples)(ref x)).data); } } [Serializable] internal sealed class voiceDetector@109-5 : FSharpFunc<(ProcessingState, DetectAction), Unit> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] public Channel<(ProcessingState, DetectAction)> channel; [CompilerGenerated] [DebuggerNonUserCode] internal voiceDetector@109-5(Channel<(ProcessingState, DetectAction)> channel) { this.channel = channel; } public override Unit Invoke((ProcessingState, DetectAction) element) { ValueTask valueTask = channel.writer.WriteAsync(element, channel.cancellationToken); return null; } } [Serializable] internal sealed class voiceDetector@109-4 : FSharpFunc<Recorder<ProcessingState>, FSharpFunc<(ProcessingState, DetectAction), Unit>> { internal static readonly voiceDetector@109-4 @_instance = new voiceDetector@109-4(); [CompilerGenerated] [DebuggerNonUserCode] internal voiceDetector@109-4() { } public override FSharpFunc<(ProcessingState, DetectAction), Unit> Invoke(Recorder<ProcessingState> recorder) { Channel<(ProcessingState, DetectAction)> channel = recorder.channel; return new voiceDetector@109-5(channel); } } [Serializable] internal sealed class voiceDetector@109-3 : FSharpFunc<ProcessingState, DetectAction, Unit> { public Recorder<ProcessingState> recorder; [CompilerGenerated] [DebuggerNonUserCode] internal voiceDetector@109-3(Recorder<ProcessingState> recorder) { this.recorder = recorder; } public override Unit Invoke(ProcessingState state, DetectAction action) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) return FSharpFunc<Recorder<ProcessingState>, (ProcessingState, DetectAction)>.InvokeFast<Unit>((FSharpFunc<Recorder<ProcessingState>, FSharpFunc<(ProcessingState, DetectAction), Unit>>)voiceDetector@109-4.@_instance, recorder, (state, action)); } } [Serializable] internal sealed class resampler@111 : FSharpFunc<ResamplerOutput<ProcessingState>, Unit> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] public Channel<ResamplerOutput<ProcessingState>> channel; [CompilerGenerated] [DebuggerNonUserCode] internal resampler@111(Channel<ResamplerOutput<ProcessingState>> channel) { this.channel = channel; } public override Unit Invoke(ResamplerOutput<ProcessingState> element) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) ValueTask valueTask = channel.writer.WriteAsync(element, channel.cancellationToken); return null; } } [SpecialName] [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] [CompilerGenerated] [CompilationMapping(/*Could not decode attribute arguments.*/)] internal struct consumer@113-10 : IAsyncStateMachine, IResumableStateMachine<TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>>> { public TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>> Data; public int ResumptionPoint; public Resampler<ProcessingState> resampler; public ValueTaskAwaiter<FSharpValueOption<ProcessingInput>> awaiter; public override void MoveNext() { //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_011c: 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_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) int resumptionPoint = ResumptionPoint; switch (resumptionPoint) { } Exception ex2 = default(Exception); Exception ex; try { bool flag; int num; bool flag2; switch (resumptionPoint) { default: awaiter = processingChannel.reader.ReadAsync(processingChannel.cancellationToken).GetAwaiter(); flag = true; if (awaiter.IsCompleted) { break; } if (false) { goto case 1; } ResumptionPoint = 1; num = 0; goto IL_0074; case 1: { num = 1; goto IL_0074; } IL_0074: flag2 = (byte)num != 0; flag = flag2; break; } int num2; if (flag) { FSharpValueOption<ProcessingInput> result = awaiter.GetResult(); FSharpValueOption<ProcessingInput> val = result; if (val.Tag != 1) { Resampler<ProcessingState> val2 = resampler; Channel<ResamplerInput<ProcessingState>> channel = val2.channel; ResamplerInput<ProcessingState> reset = ResamplerInput<ProcessingState>.Reset; ValueTask valueTask = channel.writer.WriteAsync(reset, channel.cancellationToken); num2 = 1; } else { ProcessingInput item = val.Item; if (!item.isReady@ || !Mirage.Domain.Config.isConfigReady() || (!Mirage.Domain.Config.getConfig().enableRecordVoiceWhileDead@ && item.isPlayerDead@)) { goto IL_01da; } AudioFrame item2 = new AudioFrame(item.samples@, item.format@); ProcessingState item3 = new ProcessingState(item.isMuted@ ? FSharpValueOption<float>.NewValueSome(0f) : ((!item.pushToTalkEnabled@) ? FSharpValueOption<float>.ValueNone : FSharpValueOption<float>.NewValueSome(1f)), Mirage.Domain.Setting.getSettings().allowRecordVoice@); Channel<ResamplerInput<ProcessingState>> channel = resampler.channel; ResamplerInput<ProcessingState> reset = ResamplerInput<ProcessingState>.NewResamplerInput((item3, item2)); ValueTask valueTask = channel.writer.WriteAsync(reset, channel.cancellationToken); num2 = 1; } } else { ICriticalNotifyCompletion criticalNotifyCompletion = (ICriticalNotifyCompletion)(object)awaiter; Data.MethodBuilder.AwaitUnsafeOnCompleted(ref criticalNotifyCompletion, ref this); num2 = 0; } if (num2 != 0) { goto IL_01da; } goto end_IL_0019; IL_01da: ValueTaskAwaiter<FSharpValueOption<ProcessingInput>> valueTaskAwaiter = default(ValueTaskAwaiter<FSharpValueOption<ProcessingInput>>); awaiter = valueTaskAwaiter; if (true) { Data.MethodBuilder.SetResult(Data.Result); } end_IL_0019:; } catch (object obj) { ex = (Exception)obj; ex2 = ex; } ex = ex2; if (ex != null) { Data.MethodBuilder.SetException(ex); } } void IAsyncStateMachine.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext this.MoveNext(); } public override void SetStateMachine(IAsyncStateMachine state) { Data.MethodBuilder.SetStateMachine(state); } void IAsyncStateMachine.SetStateMachine(IAsyncStateMachine state) { //ILSpy generated this explicit interface implementation from .override directive in SetStateMachine this.SetStateMachine(state); } public override int get_ResumptionPoint() { return ResumptionPoint; } public override TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>> get_Data() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return Data; } public override void set_Data(TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>> value) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) Data = value; } } [SpecialName] [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] [CompilerGenerated] [CompilationMapping(/*Could not decode attribute arguments.*/)] internal struct consumer@113-11 : IAsyncStateMachine, IResumableStateMachine<TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>>> { public TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>> Data; public int ResumptionPoint; public Resampler<ProcessingState> resampler; public ValueTaskAwaiter<Unit> awaiter; public override void MoveNext() { int resumptionPoint = ResumptionPoint; switch (resumptionPoint) { } Exception ex2 = default(Exception); Exception ex; try { bool flag; int num; bool flag2; bool flag3; int num2; int num3; bool flag4; switch (resumptionPoint) { default: flag = true; goto IL_00d5; case 1: { num = 1; goto IL_006f; } IL_00d5: if (flag) { awaiter = program@1-8(resampler, null).GetAwaiter(); flag2 = true; if (awaiter.IsCompleted) { goto IL_0079; } if (false) { goto case 1; } ResumptionPoint = 1; num = 0; goto IL_006f; } if (flag) { Data.MethodBuilder.SetResult(Data.Result); } break; IL_006f: flag3 = (byte)num != 0; flag2 = flag3; goto IL_0079; IL_0079: if (flag2) { awaiter.GetResult(); _ = null; num2 = 1; } else { ICriticalNotifyCompletion criticalNotifyCompletion = (ICriticalNotifyCompletion)(object)awaiter; Data.MethodBuilder.AwaitUnsafeOnCompleted(ref criticalNotifyCompletion, ref this); num2 = 0; } if (num2 != 0) { awaiter = default(ValueTaskAwaiter<Unit>); num3 = 1; } else { num3 = 0; } flag4 = (byte)num3 != 0; flag = flag4; resumptionPoint = 0; goto IL_00d5; } } catch (object obj) { ex = (Exception)obj; ex2 = ex; } ex = ex2; if (ex != null) { Data.MethodBuilder.SetException(ex); } } void IAsyncStateMachine.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext this.MoveNext(); } public override void SetStateMachine(IAsyncStateMachine state) { Data.MethodBuilder.SetStateMachine(state); } void IAsyncStateMachine.SetStateMachine(IAsyncStateMachine state) { //ILSpy generated this explicit interface implementation from .override directive in SetStateMachine this.SetStateMachine(state); } public override int get_ResumptionPoint() { return ResumptionPoint; } public override TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>> get_Data() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return Data; } public override void set_Data(TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>> value) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) Data = value; } } [Serializable] internal sealed class consumer@113-9 : FSharpFunc<Unit, ValueTask<Unit>> { public Resampler<ProcessingState> resampler; [CompilerGenerated] [DebuggerNonUserCode] internal consumer@113-9(Resampler<ProcessingState> resampler) { this.resampler = resampler; } public override ValueTask<Unit> Invoke(Unit unitVar0) { consumer@113-11 stateMachine = default(consumer@113-11); stateMachine.resampler = resampler; stateMachine.Data.MethodBuilder = AsyncValueTaskMethodBuilder<Unit>.Create(); stateMachine.Data.MethodBuilder.Start(ref stateMachine); return stateMachine.Data.MethodBuilder.Task; } } [SpecialName] [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] [CompilerGenerated] [CompilationMapping(/*Could not decode attribute arguments.*/)] internal struct readMicrophone@132-2 : IAsyncStateMachine, IResumableStateMachine<TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>>> { public TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>> Data; public int ResumptionPoint; public FSharpFunc<Unit, ValueTask<Unit>> program; public Channel<FSharpResult<Unit, Exception>> channel; public ValueTaskAwaiter<Unit> awaiter; public override void MoveNext() { //IL_012b: 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_013d: 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_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) int resumptionPoint = ResumptionPoint; switch (resumptionPoint) { } Exception ex3 = default(Exception); Exception ex = default(Exception); try { bool flag2 = default(bool); bool flag = default(bool); switch (resumptionPoint) { default: flag = false; flag2 = false; ex = null; flag = flag || flag; break; case 1: break; } try { bool flag3; int num; bool flag4; switch (resumptionPoint) { default: awaiter = program.Invoke((Unit)null).GetAwaiter(); flag3 = true; if (awaiter.IsCompleted) { break; } if (false) { goto case 1; } ResumptionPoint = 1; num = 0; goto IL_008c; case 1: { num = 1; goto IL_008c; } IL_008c: flag4 = (byte)num != 0; flag3 = flag4; break; } int num2; if (flag3) { awaiter.GetResult(); _ = null; FSharpResult<Unit, Exception> item = FSharpResult<Unit, Exception>.NewOk((Unit)null); ValueTask valueTask = channel.writer.WriteAsync(item, channel.cancellationToken); num2 = 1; } else { ICriticalNotifyCompletion criticalNotifyCompletion = (ICriticalNotifyCompletion)(object)awaiter; Data.MethodBuilder.AwaitUnsafeOnCompleted(ref criticalNotifyCompletion, ref this); num2 = 0; } int num3; if (num2 != 0) { ValueTaskAwaiter<Unit> valueTaskAwaiter = default(ValueTaskAwaiter<Unit>); awaiter = valueTaskAwaiter; num3 = 1; } else { num3 = 0; } bool flag5 = (byte)num3 != 0; flag = flag5; } catch (object obj) { Exception ex2 = (Exception)obj; flag2 = true; ex = ex2; } int num4; if (flag2) { Exception ex2 = ex; FSharpResult<Unit, Exception> item = FSharpResult<Unit, Exception>.NewError(ex2); ValueTask valueTask = channel.writer.WriteAsync(item, channel.cancellationToken); num4 = 1; } else { num4 = (flag ? 1 : 0); } if (num4 != 0) { Data.MethodBuilder.SetResult(Data.Result); } } catch (object obj2) { ex = (Exception)obj2; ex3 = ex; } ex = ex3; if (ex != null) { Data.MethodBuilder.SetException(ex); } } void IAsyncStateMachine.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext this.MoveNext(); } public override void SetStateMachine(IAsyncStateMachine state) { Data.MethodBuilder.SetStateMachine(state); } void IAsyncStateMachine.SetStateMachine(IAsyncStateMachine state) { //ILSpy generated this explicit interface implementation from .override directive in SetStateMachine this.SetStateMachine(state); } public override int get_ResumptionPoint() { return ResumptionPoint; } public override TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>> get_Data() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return Data; } public override void set_Data(TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>> value) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) Data = value; } } [Serializable] [SpecialName] [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] [CompilationMapping(/*Could not decode attribute arguments.*/)] internal sealed class readMicrophone@132-3 { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] public FSharpFunc<Unit, ValueTask<Unit>> program; [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] public Channel<FSharpResult<Unit, Exception>> channel; public readMicrophone@132-3(FSharpFunc<Unit, ValueTask<Unit>> program, Channel<FSharpResult<Unit, Exception>> channel) { this.program = program; this.channel = channel; base..ctor(); } internal ValueTask<Unit> Invoke() { return thread@1-8(program, channel, null); } } [SpecialName] [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] [CompilerGenerated] [CompilationMapping(/*Could not decode attribute arguments.*/)] internal struct readMicrophone@132-1 : IAsyncStateMachine, IResumableStateMachine<TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>>> { public TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>> Data; public int ResumptionPoint; public CancellationToken cancellationToken; public FSharpFunc<Unit, ValueTask<Unit>> program; public ValueTaskAwaiter<FSharpResult<Unit, Exception>> awaiter; public override void MoveNext() { //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) int resumptionPoint = ResumptionPoint; switch (resumptionPoint) { } Exception ex2 = default(Exception); Exception ex; try { bool flag; int num; bool flag2; switch (resumptionPoint) { default: { Channel<FSharpResult<Unit, Exception>> val = Channel.Channel<FSharpResult<Unit, Exception>>(cancellationToken); Task<ValueTask<Unit>> task = Task.Run((Func<ValueTask<Unit>>)new readMicrophone@132-3(program, val).Invoke, cancellationToken); awaiter = val.reader.ReadAsync(val.cancellationToken).GetAwaiter(); flag = true; if (awaiter.IsCompleted) { break; } if (false) { goto case 1; } ResumptionPoint = 1; num = 0; goto IL_009d; } case 1: { num = 1; goto IL_009d; } IL_009d: flag2 = (byte)num != 0; flag = flag2; break; } int num2; if (flag) { FSharpResult<Unit, Exception> result = awaiter.GetResult(); FSharpResult<Unit, Exception> val2 = result; if (val2.Tag != 0) { throw val2.ErrorValue; } _ = val2.ResultValue; Data.Result = null; num2 = 1; } else { ICriticalNotifyCompletion criticalNotifyCompletion = (ICriticalNotifyCompletion)(object)awaiter; Data.MethodBuilder.AwaitUnsafeOnCompleted(ref criticalNotifyCompletion, ref this); num2 = 0; } if (num2 != 0) { ValueTaskAwaiter<FSharpResult<Unit, Exception>> valueTaskAwaiter = default(ValueTaskAwaiter<FSharpResult<Unit, Exception>>); awaiter = valueTaskAwaiter; if (true) { Data.MethodBuilder.SetResult(Data.Result); } } } catch (object obj) { ex = (Exception)obj; ex2 = ex; } ex = ex2; if (ex != null) { Data.MethodBuilder.SetException(ex); } } void IAsyncStateMachine.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext this.MoveNext(); } public override void SetStateMachine(IAsyncStateMachine state) { Data.MethodBuilder.SetStateMachine(state); } void IAsyncStateMachine.SetStateMachine(IAsyncStateMachine state) { //ILSpy generated this explicit interface implementation from .override directive in SetStateMachine this.SetStateMachine(state); } public override int get_ResumptionPoint() { return ResumptionPoint; } public override TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>> get_Data() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return Data; } public override void set_Data(TaskBaseStateMachineData<Unit, AsyncValueTaskMethodBuilder<Unit>> value) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing refere
Mirage.Plugin.dll
Decompiled 8 hours agousing System; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Threading.Tasks; using BepInEx; using HarmonyLib; using Mirage.Core.Plugin; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("Mirage.Plugin")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+7a8d94cfcb6c39f5419fcc3491e37e5605b1284b")] [assembly: AssemblyProduct("Mirage.Plugin")] [assembly: AssemblyTitle("Mirage.Plugin")] [assembly: AssemblyVersion("1.0.0.0")] namespace Mirage.Plugin; [BepInPlugin("qwbarch.Mirage", "Mirage", "1.29.1")] [BepInDependency(/*Could not decode attribute arguments.*/)] internal class Plugin : BaseUnityPlugin { private static string directory; public static string Directory => directory; private void Awake() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) directory = Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location); new Harmony("qwbarch.Mirage").PatchAll(typeof(InitializeMirage)); } } internal class InitializeMirage { private static void LoadDependencies() { string[] array = new string[6] { "System.Threading.Channels.dll", "FSharp.Core.dll", "Collections.Pooled.dll", "IcedTasks.dll", "SileroVAD.dll", "FSharpPlus.dll" }; string[] array2 = array; foreach (string text in array2) { Assembly.LoadFrom(Plugin.Directory + "/" + text); } } [HarmonyPostfix] [HarmonyPatch(typeof(PreInitSceneScript), "Start")] private static async void OnPreInitScene(PreInitSceneScript __instance) { await Task.Run((Action)LoadDependencies); ((MonoBehaviour)__instance).StartCoroutine(Main.main(Plugin.Directory, "qwbarch.Mirage", "Mirage", "1.29.1")); } } internal static class PluginInfo { public const string PLUGIN_NAME = "Mirage"; public const string PLUGIN_ID = "qwbarch.Mirage"; public const string PLUGIN_VERSION = "1.29.1"; }