protected void LoginButtonBehavior() { if (_inputHost.GetInputText() == "" || _inputPort.GetInputText() == "") { LoginScene.SetNotice("Host or Port is empty !"); return; } _network.Connect(_inputHost.GetInputText(), int.Parse(_inputPort.GetInputText())); Debug.WriteLine(_inputHost.GetInputText() + " " + int.Parse(_inputPort.GetInputText())); }
// events handler private void OnConnection(BaseEvent e) { bool result = (bool)e.Params["success"]; if (!result) { Debug.WriteLine("Connection fail !"); LoginScene.SetNotice("Connection fail !"); return; } LoginScene.SetNotice("Connected !"); _network.Login(_inputName.GetInputText()); }
private void OnLoginError(BaseEvent e) { LoginScene.SetNotice("Login fail !"); Debug.WriteLine("Login fail !"); }