// ------------------------------------------- /* * CreateRoom */ private void CreateRoom() { SoundsController.Instance.PlaySingleSound(SoundsConfiguration.SOUND_SELECTION_FX); string ipAddress = m_container.Find("IPAddress").GetComponent <InputField>().text; int portNumber = int.Parse(m_container.Find("PortAddress").GetComponent <InputField>().text); if (ipAddress.Length < 5) { UIEventController.Instance.DispatchUIEvent(UIEventController.EVENT_SCREENMANAGER_OPEN_INFORMATION_SCREEN, ScreenInformationView.SCREEN_INFORMATION, UIScreenTypePreviousAction.KEEP_CURRENT_SCREEN, LanguageController.Instance.GetText("message.error"), LanguageController.Instance.GetText("screen.lobby.setup.server.invalid.ip"), null, ""); } else { if (portNumber < 2000) { UIEventController.Instance.DispatchUIEvent(UIEventController.EVENT_SCREENMANAGER_OPEN_INFORMATION_SCREEN, ScreenInformationView.SCREEN_INFORMATION, UIScreenTypePreviousAction.KEEP_CURRENT_SCREEN, LanguageController.Instance.GetText("message.error"), LanguageController.Instance.GetText("screen.lobby.setup.server.invalid.portnumber"), null, ""); } else { PlayerPrefs.SetString(PLAYERPREFS_YNT_IP, ipAddress); PlayerPrefs.SetString(PLAYERPREFS_YNT_PORT, portNumber.ToString()); MultiplayerConfiguration.SaveIPAddressServer(ipAddress); MultiplayerConfiguration.SavePortServer(portNumber); UIEventController.Instance.DispatchUIEvent(UIEventController.EVENT_SCREENMANAGER_OPEN_GENERIC_SCREEN, ScreenRemoteModeView.SCREEN_NAME, UIScreenTypePreviousAction.DESTROY_ALL_SCREENS, false, null); Destroy(); } } }
// ------------------------------------------- /* * Will save the port number of the host */ public void MenuController_SavePortServer(int _value) { MultiplayerConfiguration.SavePortServer(_value); }