示例#1
0
 private void save2SQL()
 {
     sqlite tmp = new sqlite();
     tmp.saveLogin(account, password);
 }
示例#2
0
    private IEnumerator doJBLogin()
    {
        string url = connect.getURL()+ "/login/login.php";
        // isSucess = false;
        WWWForm form = new WWWForm();
        form.AddField("act", account.text);
        form.AddField("psd", password.text);
        form.AddField("hash", connect.getHash());
        byte[] rawData = form.data;
        WWW www = new WWW(url,rawData);

        yield return www;
        // check for errors
        if (www.error == null)
        {
            string temp = www.text;
            Debug.Log("temp:"+temp+" num:"+temp.Length);
            Debug.Log(www.text);
            if (temp.Length == 5) //success login
            {
                //Load User All Information
                user.setAccount(account.text);
                user.loadAllfromServer();
                //save account & password
                sqlite tmp_s = new sqlite();
                tmp_s.saveLogin(account.text, password.text);
                //upload the login time
                StartCoroutine(logLoginTime());
                hint.text = "";
                //change scence
                lanimation.changeScence();
                //earse all return stack
                ar.eraseAllValue();
                //ar.changeSenceAnimator("/Menu");
            }
            else//帳密有誤
            {
                hint.text = "帳密有誤";
            }
        }
        else
        {
            hint.text = "請檢查裝置連線";
            Debug.Log("WWW Error: " + www.error);
        }

        //isSucess = false;
    }