using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
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", "2.0.0", "Lilly", null)]
[assembly: MelonGame("KisSoft", "ATLYSS")]
[assembly: MelonOptionalDependencies(new string[] { "BepInEx" })]
[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;
[BepInPlugin("022aff51-6d76-45e7-b7ba-ef9e6f53cc53", "Lilly's Uncapped Players", "2.0.0")]
public class Bepin : BaseUnityPlugin
{
private Uncapper core;
private void Awake()
{
//IL_004f: Unknown result type (might be due to invalid IL or missing references)
//IL_0055: Expected O, but got Unknown
if (!((Object)(object)Uncapper.Instance != (Object)null))
{
GameObject val = Object.Instantiate<GameObject>(GameObject.CreatePrimitive((PrimitiveType)3));
((Object)val).hideFlags = (HideFlags)61;
core = val.AddComponent<Uncapper>();
core.Log = logger;
Harmony val2 = new Harmony("Lilly's Uncapped Players");
val2.PatchAll();
}
}
public bool logger(string mesg)
{
((BaseUnityPlugin)this).Logger.LogInfo((object)(mesg ?? ""));
return true;
}
}
public class MelonLoad : MelonMod
{
private Uncapper core;
public override void OnInitializeMelon()
{
if (!((Object)(object)Uncapper.Instance != (Object)null))
{
GameObject val = Object.Instantiate<GameObject>(GameObject.CreatePrimitive((PrimitiveType)3));
((Object)val).hideFlags = (HideFlags)61;
core = val.AddComponent<Uncapper>();
core.Log = logger;
}
}
private bool logger(string msg)
{
MelonLogger.Msg(msg);
return true;
}
}
public class Uncapper : MonoBehaviour
{
[HarmonyPatch(typeof(LobbyListManager), "Awake")]
public static class unCapSlider
{
private static void Postfix(ref LobbyListManager __instance)
{
try
{
__instance._lobbyMaxConnectionSlider.maxValue = 250f;
__instance._lobbyMaxConnectionSlider.minValue = 2f;
}
catch (Exception ex)
{
Instance.Log(ex.ToString());
}
}
}
[HarmonyPatch(typeof(ProfileDataManager), "Load_HostSettingsData")]
public static class Inject
{
private static bool Prefix(ref string ____dataPath)
{
Load_HostSettingsData(____dataPath);
return false;
}
private static void Load_HostSettingsData(string dataPath)
{
try
{
if (File.Exists(dataPath + "/hostSettings.json"))
{
string text = File.ReadAllText(dataPath + "/hostSettings.json");
ProfileDataManager._current._hostSettingsProfile = JsonUtility.FromJson<ServerHostSettings_Profile>(text);
if (string.IsNullOrEmpty(ProfileDataManager._current._hostSettingsProfile._serverName) || ProfileDataManager._current._hostSettingsProfile._serverName.Contains("<") || ProfileDataManager._current._hostSettingsProfile._serverName.Contains(">"))
{
ProfileDataManager._current._hostSettingsProfile._serverName = "Atlyss Server";
}
if (ProfileDataManager._current._hostSettingsProfile._maxAllowedConnections < 2)
{
ProfileDataManager._current._hostSettingsProfile._maxAllowedConnections = 2;
}
else if (ProfileDataManager._current._hostSettingsProfile._maxAllowedConnections > 250)
{
ProfileDataManager._current._hostSettingsProfile._maxAllowedConnections = 250;
}
MainMenuManager._current.Load_HostSettings();
AtlyssNetworkManager._current._serverName = ProfileDataManager._current._hostSettingsProfile._serverName;
AtlyssNetworkManager._current._serverPassword = ProfileDataManager._current._hostSettingsProfile._serverPassword;
AtlyssNetworkManager._current._serverMotd = ProfileDataManager._current._hostSettingsProfile._serverMotd;
((NetworkManager)AtlyssNetworkManager._current).maxConnections = ProfileDataManager._current._hostSettingsProfile._maxAllowedConnections;
}
}
catch (Exception ex)
{
Instance.Log(ex.ToString());
}
}
}
public static Uncapper Instance;
private PartyObjectBehavior partyPre = null;
public Func<string, bool> Log;
public void Start()
{
Instance = this;
uncapParties();
}
private void uncapParties()
{
try
{
if ((Object)(object)partyPre == (Object)null)
{
PartyObjectBehavior[] array = Resources.FindObjectsOfTypeAll(typeof(PartyObjectBehavior)) as PartyObjectBehavior[];
foreach (PartyObjectBehavior val in array)
{
val.Network_maxPartyLimit = 1000;
val._maxPartyLimit = 1000;
}
}
}
catch (Exception ex)
{
Log(ex.ToString());
}
}
}