Ejemplo n.º 1
0
        private static bool Prefix()
        {
            if (!MPInternet.OldEnabled || MPInternet.ServerEnabled)
            {
                return(true);
            }
            string pwd = NetworkMatch.m_match_req_password;

            if (pwd == "")
            {
                var pmd = (PrivateMatchDataMessage)_NetworkMatch_m_private_data_Field.GetValue(null);
                pwd = pmd != null ? pmd.m_password : "";
            }
            MPInternet.ServerAddress = MPInternet.FindPasswordAddress(pwd.Trim(), out string msg);
            if (MPInternet.ServerAddress == null)
            {
                Debug.Log("SwitchToLobbyMenu FindPasswordAddress failed " + msg);
                NetworkMatch.CreateGeneralUIPopup("INTERNET MATCH", msg, 1);
                //MenuManager.ChangeMenuState(MenuState.MP_LOCAL_MATCH, true);

                /*
                 * MenuManager.m_menu_state = MenuState.MP_LOCAL_MATCH;
                 * MenuManager.m_next_menu_state = MenuManager.m_menu_state;
                 * UIManager.CreateUIElement(UIManager.SCREEN_CENTER, 7000, UIElementType.MP_MATCH_SETUP, Loc.LS("INTERNET MATCH"));
                 * MenuManager.m_menu_sub_state = MenuSubState.ACTIVE;
                 * MenuManager.m_menu_micro_state = NetworkMatch.m_match_req_password == "" ? 4 : 1;
                 */
                MenuManager.ClearMpStatus();
                return(false);
            }
            MenuManager.m_mp_status = NetworkMatch.m_match_req_password == "" ? Loc.LS("CREATING INTERNET MATCH") : Loc.LS("JOINING INTERNET MATCH");
            return(true);
        }
Ejemplo n.º 2
0
        static void Postfix()
        {
            if (MenuManager.m_menu_sub_state != MenuSubState.ACTIVE || NetworkManager.IsHeadless() || !UIManager.PushedSelect(100) ||
                UIManager.m_menu_selection != 2)
            {
                return;
            }
            MenuManager.PlaySelectSound();
            UIManager.DestroyAll();

            NetworkMatch.SetNetworkGameClientMode(NetworkMatch.NetworkGameClientMode.Invalid);
            NetworkMatch.SetNetworkGameClientMode(NetworkMatch.NetworkGameClientMode.LocalLAN);
            MenuManager.ClearMpStatus();

            if (NetworkMatch.m_match_req_password == "")
            {
                //MenuManager.m_updating_pm_settings = true;
                //MenuManager.ChangeMenuState(MenuState.MP_LOCAL_MATCH);

                //var pmd = (PrivateMatchDataMessage)typeof(MenuManager).GetMethod("BuildPrivateMatchData", BindingFlags.NonPublic | BindingFlags.Static).Invoke(null, new object[] { false });
                //NetworkMatch.StartPrivateLobby(pmd);
                //MenuManager.m_updating_pm_settings = true;
                MenuManager.ChangeMenuState(MenuState.MP_LOCAL_MATCH);
            }
            else
            {
                MenuManager.m_mp_status = Loc.LS("JOINING " + MPInternet.ClientModeName());
                NetworkMatch.JoinPrivateLobby(MPInternet.MenuPassword);
            }
        }
Ejemplo n.º 3
0
        static void Postfix()
        {
            if (MenuManager.m_menu_sub_state != MenuSubState.ACTIVE || NetworkManager.IsHeadless() || !UIManager.PushedSelect(100) ||
                UIManager.m_menu_selection != 2)
            {
                return;
            }
            MenuManager.PlaySelectSound();
            UIManager.DestroyAll();

            NetworkMatch.SetNetworkGameClientMode(NetworkMatch.NetworkGameClientMode.Invalid);
            NetworkMatch.SetNetworkGameClientMode(NetworkMatch.NetworkGameClientMode.LocalLAN);
            MenuManager.ClearMpStatus();

            if (NetworkMatch.m_match_req_password == "")
            {
                MenuManager.ChangeMenuState(MenuState.MP_LOCAL_MATCH);
            }
            else
            {
                MenuManager.m_mp_status = Loc.LS("JOINING " + MPInternet.ClientModeName());
                NetworkMatch.JoinPrivateLobby(MPInternet.MenuPassword);
            }
        }