using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using HarmonyLib;
[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 = "")]
[assembly: AssemblyCompany("MorePlayersFixed")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Allows for up to 16 players to join a \"Old Market Simulator\" play-session. Entirely based on ViViKo's original MorePlayers mod: https://thunderstore.io/c/old-market-simulator/p/ViViKo/MorePlayers/")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("MorePlayersFixed")]
[assembly: AssemblyTitle("MorePlayersFixed")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace MorePlayersFixed
{
[BepInPlugin("ca.tredecate.moreplayersfixed", "MorePlayersFixed", "1.0.0")]
public class MorePlayersFixed : BaseUnityPlugin
{
private readonly Harmony harmony = new Harmony("tredecate.MorePlayersFixed");
public static MorePlayersFixed Instance;
private void Awake()
{
Instance = this;
harmony.PatchAll();
((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin MorePlayersFixed is loaded!");
((BaseUnityPlugin)this).Logger.LogInfo((object)"Entirely based on ViViKo's original MorePlayers mod: https://thunderstore.io/c/old-market-simulator/p/ViViKo/MorePlayers/");
}
}
public static class PluginInfo
{
public const string PLUGIN_GUID = "MorePlayersFixed";
public const string PLUGIN_NAME = "MorePlayersFixed";
public const string PLUGIN_VERSION = "1.0.0";
}
}
namespace MorePlayersFixed.Patches
{
[HarmonyPatch(typeof(LobbyManager))]
public class LobbyManagerPatch
{
[HarmonyPatch("CreateLobby")]
[HarmonyTranspiler]
private static IEnumerable<CodeInstruction> CreateLobbyPatch(IEnumerable<CodeInstruction> instructions)
{
List<CodeInstruction> list = instructions.ToList();
CodeInstruction val = list.Find((CodeInstruction instruction) => instruction.opcode == OpCodes.Ldc_I4_4);
val.opcode = OpCodes.Ldc_I4_S;
val.operand = 16;
return list;
}
}
}