using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using ForceLobbyCode;
using HarmonyLib;
using Il2Cpp;
using MelonLoader;
using MelonLoader.Preferences;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: MelonInfo(typeof(Mod), "Force Lobby Code", "1.0", "Spike", null)]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("CUSTOM_PRIVATE_CODE")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("CUSTOM_PRIVATE_CODE")]
[assembly: AssemblyTitle("CUSTOM_PRIVATE_CODE")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace ForceLobbyCode;
public class Mod : MelonMod
{
public static MelonPreferences_Category CustomLobbyCodes;
public static MelonPreferences_Entry<string> LobbyCode;
public override void OnInitializeMelon()
{
MelonLogger.Msg("ForceLobbyCode loaded!");
CustomLobbyCodes = MelonPreferences.CreateCategory("CustomLobbyCodes");
LobbyCode = CustomLobbyCodes.CreateEntry<string>("LobbyCode", "Spikey", (string)null, "The lobby code to use when creating a lobby. (has to Be 6 Letters exactly)", false, false, (ValueValidator)null, (string)null);
}
}
[HarmonyPatch(typeof(SteamNetworkManager), "GenerateRandomLobbyCode")]
public static class Patch_GenerateRandomLobbyCode
{
private static void Postfix(ref string __result)
{
__result = Mod.LobbyCode.Value;
}
}