コード例 #1
0
        public static void OpenCreateServerMenu()
        {
            // Make sure any overrides are cleared when we're going to host
            MpConnect.ClearMasterServerOverride();

            // If we are initiating the server menu from our UI, assume the intent is to host a game
            Plugin.Config.LobbyAnnounceToggle = true;

            _flowCoordinator.HandleMultiplayerLobbyControllerDidFinish(null, MultiplayerModeSelectionViewController.MenuButton.CreateServer);
        }
コード例 #2
0
        private static void OnSessionDisconnected(DisconnectedReason reason)
        {
            Plugin.Log?.Info($"Multiplayer session is now disconnected ({reason}).");

            IsConnected        = false;
            DisconnectedReason = reason;

            // Restore the user's preferred master server
            MpConnect.ClearMasterServerOverride();

            // Clear any notifications
            FloatingNotification.Instance.DismissMessage();
        }