Example #1
0
    public void Login()
    {
        if (!String.IsNullOrEmpty(mailAddressIT.text) && !String.IsNullOrEmpty(passwordIT.text))
        {
            GUser.GetUserByConnexion(mailAddressIT.text, passwordIT.text);
            User user = GUser.user;

            if (user != null)
            {
                Debug.Log("not null");
                if (user.IsStudent())
                {
                    GApp.SetPrefUser(user.Firstname, user.Lastname, mailAddressIT.text, passwordIT.text, "Elève", ((Student)user).Promo.Specialty, "TD1", "TP1", "2019-02-14"); // as IARISS didn't give us the schedule data for the current month, but for a more "full" month
                }
                else
                {
                    GApp.SetPrefUser(user.Firstname, user.Lastname, mailAddressIT.text, passwordIT.text, "Prof.", "", "", "", "2019-02-14"); // as IARISS didn't give us the schedule data for the current month, but for a more "full" month
                }

                GApp.ChangeScene("DetectSalle");
            }

            else
            {
                Debug.Log("user Null");
            }
        }
    }
Example #2
0
    // Check si modification ou nouvel utilisateur
    public void CreateUser()
    {
        if (!String.IsNullOrEmpty(firstname.text) && !String.IsNullOrEmpty(lastname.text) && !String.IsNullOrEmpty(email.text) && !String.IsNullOrEmpty(password.text))
        {
            User currentUser;

            // Prof
            if (String.Equals(status.captionText.text, "Prof."))
            {
                int id = DBCommands.InsertTeacher(lastname.text, firstname.text, email.text, password.text);
                currentUser = GUser.CreateTeacher(id, firstname.text, lastname.text, email.text, password.text);
                GApp.SetPrefUser(firstname.text, lastname.text, email.text, password.text, "Prof.", "", "", "", "2019-02-11");
            }
            // Student
            else
            {
                Promo p  = GPromo.GetPromo(1, promo.captionText.text);
                int   id = DBCommands.InsertStudent(firstname.text, lastname.text, p.Id, email.text, password.text);
                currentUser = GUser.CreateStudent(id, firstname.text, lastname.text, email.text, password.text, p);
                GApp.SetPrefUser(firstname.text, lastname.text, email.text, password.text, "Elève", p.Specialty, td.captionText.text, tp.captionText.text, "2019-02-11");
            }

            GApp.ChangeScene(nextScene);
        }
    }
Example #3
0
    public void AlreadyLoggedIn()
    {
        if (!String.IsNullOrEmpty(PlayerPrefs.GetString("email")) && !String.IsNullOrEmpty(PlayerPrefs.GetString("password")))
        {
            GUser.GetUserByConnexion(PlayerPrefs.GetString("email"), PlayerPrefs.GetString("password"));
            User user = GUser.user;

            if (user != null)
            {
                Debug.Log("not null");


                if (user.IsStudent())
                {
                    string spe = ((Student)user).Promo.Specialty;
                    GApp.SetPrefUser(user.Firstname, user.Lastname, user.Email, user.Password, "Elève", spe, "TD1", "TP1", "2019-02-14"); // as IARISS didn't give us the schedule data for the current month, but for a more "full" month
                }
                else
                {
                    GApp.SetPrefUser(user.Firstname, user.Lastname, user.Email, user.Password, "Prof.", "", "", "", "2019-02-14"); // as IARISS didn't give us the schedule data for the current month, but for a more "full" month
                }

                GApp.ChangeScene("DetectSalle");
            }
            else
            {
                Debug.Log("user Null");
                PlayerPrefs.DeleteAll();
            }
        }
        else
        {
            GApp.ChangeScene("ConnexionScene");
        }
    }
Example #4
0
        private void SaveShortCut(object sender, System.EventArgs e)
        {
            ContainerConnectionCommandTarget t = GApp.GetConnectionCommandTarget();

            t.SaveShortCut();
            t.Focus();
        }
Example #5
0
    private void Awake()
    {
        Ins = this;
#if !UNITY_EDITOR
        GMode = GameMode.Release;
#endif
    }
Example #6
0
    public void SignOut()
    {
        if (!String.IsNullOrEmpty(PlayerPrefs.GetString("email")) && !String.IsNullOrEmpty(PlayerPrefs.GetString("password")))
        {
            PlayerPrefs.DeleteAll();
        }

        GApp.ChangeScene("ConnexionScene");
    }
Example #7
0
        private void ToggleLogSwitch(object sender, System.EventArgs e)
        {
            if (_blockEventHandler)
            {
                return;
            }
            ContainerConnectionCommandTarget t = GApp.GetConnectionCommandTarget();

            t.SetLogSuspended(!t.Connection.LogSuspended);
            t.Focus();
        }
Example #8
0
        private void LineFeedRule(object sender, System.EventArgs e)
        {
            if (_blockEventHandler)
            {
                return;
            }
            ContainerConnectionCommandTarget t = GApp.GetConnectionCommandTarget();

            t.ShowLineFeedRuleDialog();
            t.Focus();
        }
Example #9
0
        private void ToggleLocalEcho(object sender, System.EventArgs e)
        {
            if (_blockEventHandler)
            {
                return;
            }
            ContainerConnectionCommandTarget t = GApp.GetConnectionCommandTarget();

            t.SetLocalEcho(!t.Connection.Param.LocalEcho);
            t.Focus();
        }
Example #10
0
        private void ChangeEncoding(object sender, System.EventArgs e)
        {
            if (_blockEventHandler)
            {
                return;
            }
            EncodingProfile enc = EncodingProfile.Get((EncodingType)_encodingBox.SelectedIndex);
            ContainerConnectionCommandTarget t = GApp.GetConnectionCommandTarget();

            t.SetEncoding(enc);
            t.Focus();
        }
Example #11
0
        private void ChangeNewLine(object sender, System.EventArgs e)
        {
            if (_blockEventHandler)
            {
                return;
            }
            NewLine nl = (NewLine)_newLineOption.SelectedIndex;
            ContainerConnectionCommandTarget t = GApp.GetConnectionCommandTarget();

            t.SetTransmitNewLine(nl);
            t.Focus();
        }
Example #12
0
 private void InitializeTerminalPane()
 {
     if (GApp._frame == null)
     {
         string[] args = new string[0];
         GApp.Run(args);
         GApp._frame._multiPaneControl.InitUI(null, GApp.Options);
         GEnv.InterThreadUIService.MainFrameHandle = GApp._frame.Handle;
     }
     this._terminalPane     = new TerminalPane();
     this.TerminalPane.Dock = DockStyle.Fill;
     this.Controls.Add(this.TerminalPane);
 }
Example #13
0
        private void OnOK(object sender, EventArgs args)
        {
            bool ok = ClosePage();

            if (ok)
            {
                DialogResult = DialogResult.OK;

                GApp.UpdateOptions(_options);
            }
            else
            {
                DialogResult = DialogResult.None;
            }
        }
Example #14
0
 //コマンド実行本体
 private static CommandResult Execute(Entry e)
 {
     if (e.Target == Target.Global)
     {
         return(GApp.GlobalCommandTarget.Exec(e));
     }
     else
     {
         ContainerConnectionCommandTarget t = GApp.GetConnectionCommandTarget();
         if (t == null)
         {
             return(CommandResult.Ignored);                        //アクティブなコネクションがなければ無視
         }
         return(t.Exec(e.CID));
     }
 }
Example #15
0
    public void UpdateUser()
    {
        if (!String.IsNullOrEmpty(firstname.text) && !String.IsNullOrEmpty(lastname.text) && !String.IsNullOrEmpty(email.text) && !String.IsNullOrEmpty(password.text))
        {
            User currentUser = GUser.GetUserByConnexion(email.text, password.text);

            // Prof
            if (String.Equals(status.captionText.text, "Prof."))
            {
                GUser.UpdateTeacher((Teacher)currentUser, firstname.text, lastname.text, email.text, password.text);
                GApp.SetPrefUser(firstname.text, lastname.text, email.text, password.text, "Prof.", "", "", "", "2019-02-11");
            }
            // Student
            else
            {
                GUser.UpdateStudent((Student)currentUser, firstname.text, lastname.text, email.text, password.text, ((Student)currentUser).Promo);
                GApp.SetPrefUser(firstname.text, lastname.text, email.text, password.text, "Elève", promo.captionText.text, td.captionText.text, tp.captionText.text, "2019-02-11");
            }

            GApp.ChangeScene(nextScene);
        }
    }
 private void AdjustOptionFileLocation(OptionPreservePlace p)
 {
     _optionPreservePlacePath.Text = GApp.GetOptionDirectory(p);
 }
Example #17
0
 private void CommentLog(object sender, EventArgs e)
 {
     GApp.GetConnectionCommandTarget().CommentLog();
 }
Example #18
0
 private void ShowServerInfo(object sender, EventArgs e)
 {
     GApp.GetConnectionCommandTarget().ShowServerInfo();
 }
Example #19
0
        public void Connect()
        {
            // 先判断连接状态
            if (IsConnected || _isConnecting)
            {
                return;
            }

            _isConnecting = true;

            if (statusText == null)
            {
                statusText           = new Label();
                statusText.Dock      = DockStyle.Fill;
                statusText.BackColor = Color.White;
                statusText.ForeColor = Color.Black;
                statusText.Font      = new Font("Microsoft YaHei", 10);
                statusText.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            }

            statusText.Text    = "正在连接";
            statusText.Visible = true;
            this.Invalidate();

            this.Controls.Add(statusText);

            if (GApp._frame == null)
            {
                GApp.Run(new string[0]);
                GApp.Options.BGColor              = this.BackColor;
                GApp.Options.TextColor            = this.ForeColor;
                GApp.Options.RightButtonAction    = RightButtonAction.Paste;
                GApp.Options.AutoCopyByLeftButton = true;
                //GApp.Options.WarningOption = WarningOption.Ignore;
                GApp.Options.Font = this.Font;
                GApp._frame._multiPaneControl.InitUI(null, GApp.Options);
                GEnv.InterThreadUIService.MainFrameHandle = GApp._frame.Handle;
            }

            try
            {
                //------------------------------------------------------------------------
                SSHTerminalParam sshp = new SSHTerminalParam(Poderosa.ConnectionParam.ConnectionMethod.SSH2, this.Host, this.UserName, this.Password);
                sshp.AuthType      = AuthType.Password;
                sshp.IdentityFile  = string.Empty;
                sshp.Encoding      = EncodingType.UTF8;
                sshp.Port          = this._port;
                sshp.RenderProfile = new RenderProfile();
                sshp.TerminalType  = TerminalType.XTerm;

                CommunicationUtil.SilentClient s = new CommunicationUtil.SilentClient();
                Size sz = this.Size;
                SocketWithTimeout swt = new SSHConnector(sshp, sz, sshp.Passphrase, null);
                swt.AsyncConnect(s, sshp.Host, sshp.Port, (ct, errorMessage) =>
                {
                    if (ct == null)
                    {
                        statusText.Invoke(new Action(() =>
                        {
                            statusText.Text = "连接异常:" + errorMessage;
                        }));

                        return;
                    }

                    if (this._terminalPane == null)
                    {
                        this.Invoke(new Action(() =>
                        {
                            this._terminalPane = new TerminalPane();
                            InitTerminalPane(ct);
                        }));
                    }
                    else
                    {
                        this._terminalPane.Invoke(new Action(() =>
                        {
                            this._terminalPane.Detach();
                            InitTerminalPane(ct);
                        }));
                    }
                });
            }
            catch (Exception ex)
            {
                statusText.Text = "连接异常:" + ex.Message;
                return;
            }

            _isConnecting = false;
        }
 private void GameInit()
 {
     //游戏初始化
     GApp.Init();
     GApp.Reset();
 }