Decompiled source of MaxLobbySize v1.0.0

MaxLobbySize.dll

Decompiled a week ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Core.Logging.Interpolation;
using BepInEx.Logging;
using BepInEx.Unity.IL2CPP;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using Steamworks;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("MaxLobbySize")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Changes maximum lobby size")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("MaxLobbySize")]
[assembly: AssemblyTitle("MaxLobbySize")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace MaxLobbySize
{
	[BepInPlugin("MaxLobbySize", "MaxLobbySize", "1.0.0")]
	public class Plugin : BasePlugin
	{
		private readonly Harmony harmony = new Harmony("MaxLobbySize");

		private static ManualLogSource mls;

		private static int customLobbySize = 6;

		public override void Load()
		{
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Expected O, but got Unknown
			harmony.PatchAll(typeof(Plugin));
			mls = ((BasePlugin)this).Log;
			customLobbySize = ((BasePlugin)this).Config.Bind<int>("General", "LobbySize", 99, "Sets the maximum size of your lobby").Value;
			ManualLogSource log = ((BasePlugin)this).Log;
			bool flag = default(bool);
			BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(18, 1, ref flag);
			if (flag)
			{
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Plugin ");
				((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>("MaxLobbySize");
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" is loaded!");
			}
			log.LogInfo(val);
		}

		[HarmonyPatch(typeof(SteamMatchmaking), "CreateLobbyAsync")]
		[HarmonyPrefix]
		private static void CreateLobbyAsync(ref int maxMembers)
		{
			mls.LogError((object)("Steamworks.SteamMatchmaking::CreateLobbyAsync " + maxMembers + " overriding to " + customLobbySize));
			maxMembers = customLobbySize;
		}
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "MaxLobbySize";

		public const string PLUGIN_NAME = "MaxLobbySize";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}