using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.NET.Common;
using BepInExResoniteShim;
using FrooxEngine;
using HarmonyLib;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(/*Could not decode attribute arguments.*/)]
[assembly: TargetFramework(".NETCoreApp,Version=v9.0", FrameworkDisplayName = ".NET 9.0")]
[assembly: AssemblyCompany("eia485")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.1.0")]
[assembly: AssemblyInformationalVersion("1.0.1+9794d9b1ac970cde08874b36e822b7d8e281a6fb")]
[assembly: AssemblyProduct("AllowMultipleAudioStreams")]
[assembly: AssemblyTitle("AllowMultipleAudioStreams")]
[assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/EIA485/NeosAllowMultipleAudioStreams")]
[assembly: AssemblyVersion("1.0.1.0")]
[module: RefSafetyRules(11)]
namespace AllowMultipleAudioStreams;
[ResonitePlugin("net.eia485.AllowMultipleAudioStreams", "AllowMultipleAudioStreams", "1.0.1", "eia485", "https://github.com/EIA485/NeosAllowMultipleAudioStreams")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
public class AllowMultipleAudioStreams : BasePlugin
{
[HarmonyPatch]
private class AllowMultipleAudioStreamsPatch
{
private static MethodBase TargetMethod()
{
global::System.Type[] nestedTypes = typeof(AudioStreamSpawner).GetNestedTypes((BindingFlags)32);
for (int i = 0; i < nestedTypes.Length; i++)
{
MethodInfo val = Enumerable.FirstOrDefault<MethodInfo>((global::System.Collections.Generic.IEnumerable<MethodInfo>)nestedTypes[i].GetMethods((BindingFlags)36), (Func<MethodInfo, bool>)((MethodInfo m) => ((MemberInfo)m).Name.Contains("OnStartStreaming") && m.ReturnType == typeof(void) && ((MethodBase)m).GetParameters().Length == 1 && ((MethodBase)m).GetParameters()[0].ParameterType == typeof(AudioStreamController)));
if (val != (MethodInfo)null)
{
return (MethodBase)(object)val;
}
}
return null;
}
private static bool Prefix()
{
return false;
}
}
public override void Load()
{
((BasePlugin)this).HarmonyInstance.PatchAll();
}
}
public static class PluginMetadata
{
public const string GUID = "net.eia485.AllowMultipleAudioStreams";
public const string NAME = "AllowMultipleAudioStreams";
public const string VERSION = "1.0.1";
public const string AUTHORS = "eia485";
public const string REPOSITORY_URL = "https://github.com/EIA485/NeosAllowMultipleAudioStreams";
}