示例#1
0
 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()));
 }
示例#2
0
        // 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());
        }
示例#3
0
 private void OnLoginError(BaseEvent e)
 {
     LoginScene.SetNotice("Login fail !");
     Debug.WriteLine("Login fail !");
 }