[HarmonyPriority(Priority.Last)] // it's important we take priority over any mod plugins public static void Postfix(NetworkConfigSO __instance, ref MasterServerEndPoint __result) { MpConnect.ReportCurrentMasterServerValue(__result); if (MpConnect.OverrideEndPoint != null) { // We are overriding the endpoint, to replace either the official or modded value __result = MpConnect.OverrideEndPoint; } }
public static bool Prefix(MultiplayerModeSelectionFlowCoordinator __instance, MultiplayerModeSelectionViewController viewController, MultiplayerModeSelectionViewController.MenuButton menuButton) { // Make sure any overrides are cleared when we're going to connect or host MpConnect.ClearMasterServerOverride(); if (menuButton == MenuButton.GameBrowser) { // When the "GameBrowser" button is clicked, bypass the game's own incomplete code & open our view instead PluginUi.LaunchServerBrowser(); return(false); } else { // Going to a non-serverbrowser part of the online menu MpModeSelection.WeInitiatedConnection = false; } return(true); }
public void Join() { MpConnect.Join(this); }