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); }
private static Exception Finalizer(Exception __exception) { if (__exception != null) { if (__exception.GetType() == typeof(SocketException)) { if (MPInternet.Enabled) { NetworkMatch.CreateGeneralUIPopup("ERROR connecting to server", __exception.Message, 5.0f); NetworkMatch.ExitMatchToMainMenu(); } return(null); } } // forward all other exceptions return(__exception); }