Decompiled source of Lillys Uncapped Players And Parties v1.0.0

Mods/Uncapped Players And Parties.dll

Decompiled 14 hours ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using HarmonyLib;
using MelonLoader;
using Mirror;
using Uncapped_Players_And_Parties;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: MelonInfo(typeof(Uncapper), "Lilly's Uncapped Players", "1.0.0", "Lilly", null)]
[assembly: AssemblyTitle("Uncapped Players And Parties")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Uncapped Players And Parties")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("18dd6f33-0186-4af7-b358-4e1c48bff4ff")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace Uncapped_Players_And_Parties;

public class Uncapper : MelonMod
{
	[HarmonyPatch(typeof(AtlyssNetworkManager), "OnStartServer")]
	public static class uncapPlayers
	{
		private static void Prefix(ref AtlyssNetworkManager __instance)
		{
			try
			{
				((NetworkManager)__instance).maxConnections = 500;
			}
			catch (Exception ex)
			{
				MelonLogger.Msg((object)ex);
			}
		}
	}

	private PartyObjectBehavior partyPre = null;

	public override void OnLateInitializeMelon()
	{
		uncapParties();
	}

	private void uncapParties()
	{
		try
		{
			if (!((Object)(object)partyPre == (Object)null))
			{
				return;
			}
			GameObject[] array = Resources.FindObjectsOfTypeAll(typeof(GameObject)) as GameObject[];
			foreach (GameObject val in array)
			{
				if (((Object)val).name == "_entity_partyObject")
				{
					partyPre = val.GetComponent<PartyObjectBehavior>();
					partyPre.Network_maxPartyLimit = 1000;
					partyPre._maxPartyLimit = 1000;
					break;
				}
			}
		}
		catch (Exception ex)
		{
			MelonLogger.Msg((object)ex);
		}
	}
}