Exemple #1
0
    public IEnumerator CheckRegister(string fileName, string[] str)
    {
        WWWForm phpform = new WWWForm();

        phpform.AddField("user_id", str[0]);
        phpform.AddField("user_pwd", str[1]);
        phpform.AddField("user_name", str[2]);
        phpform.AddField("user_sex", str[3]);
        WWW reg = new WWW(serverlink + fileName, phpform);

        yield return(reg);

        if (reg.error == null)
        {
            if (reg.text == "0")
            {
                AccountInfo = new string[] { str[0], str[2], "1", str[3] };
                state       = 0;//帳號不重複
                Debug.Log(state + " " + AccountInfo);
                xmlprocess = new Xmlprocess(AccountInfo[0], AccountInfo);
                //xmlprocess.setUserInfo(AccountInfo);//將註冊資訊傳至XmlNode
                //xmlprocess.timeHistoryRecord("Register");
                xmlprocess.ScceneHistoryRecord("Register", DateTime.Now.ToString("HH:mm:ss"));
            }
            else
            {
                state = 1;
            }
        }
        else
        {
            Debug.Log("error msg" + reg.error);
        }
    }
Exemple #2
0
    void Start()
    {
        xmlprocess    = new Xmlprocess();
        ClickBtn      = GetComponents <AudioSource>()[1];
        btn_practice  = GetComponentsInChildren <Button>()[0];
        btn_compete   = GetComponentsInChildren <Button>()[1];
        btn_LPractice = GetComponentsInChildren <Button>()[2];
        btn_LCompete  = GetComponentsInChildren <Button>()[3];
        btn_exit      = GetComponentsInChildren <Button>()[4];

        btn_practice.onClick.AddListener(goPractice);
        btn_compete.onClick.AddListener(goCompete);
        btn_LPractice.onClick.AddListener(delegate() { showLeaderboard(0); });
        btn_LCompete.onClick.AddListener(delegate() { showLeaderboard(1); });
        btn_exit.onClick.AddListener(UploadData);

        /*//必須先完成練習1次才可以進入對戰區
         * if (!xmlprocess.getLearningCount())
         * {
         *  btn_compete.interactable = false;
         *  btn_compete.image.color = Color.gray;
         * }
         * else {
         *  btn_compete.interactable = true;
         *  btn_compete.onClick.AddListener(goCompete);
         * }
         */
    }
Exemple #3
0
    public IEnumerator CheckLogin(string fileName, string[] str)
    {
        WWWForm phpform = new WWWForm();

        phpform.AddField("user_id", str[0]);
        phpform.AddField("user_pwd", str[1]);
        WWW reg = new WWW(serverlink + fileName, phpform);

        yield return(reg);

        if (reg.error == null)
        {
            if (reg.text == "0")
            {
                state = 0;//帳密錯誤
            }
            else
            {
                AccountInfo = reg.text.Split(',');
                state       = 1;
                xmlprocess  = new Xmlprocess(AccountInfo[0]);
                //xmlprocess.setUserInfo(AccountInfo);
                xmlprocess.New_timeHistoryRecord("Login", DateTime.Now.ToString("yyyy-MM-dd"));
            }
        }
        else
        {
            Debug.Log("error msg" + reg.error);
        }
    }
Exemple #4
0
    private Button[] _badgeBtn; //存取X區所有獎章按鈕物件


    private void Awake()
    {
        learningBadgeCount = 5; //設定練習區的獎章數量
        competeBadgeCount  = 7; //設定對戰區的獎章數量

        xmlprocess      = new Xmlprocess();
        badgeName       = new string[learningBadgeCount + competeBadgeCount];
        badgeDesciption = new string[(learningBadgeCount + competeBadgeCount), 4];
        s_LearningState = xmlprocess.getAchieveLearningState();
        s_CompeteState  = xmlprocess.getAchieveCompeteState();
        StartCoroutine(LoadBadgeData());
    }
Exemple #5
0
    //MySQLAccess mySQLAccess;


    public IEnumerator CheckLogin(string fileName, string[] str)
    {
        //mySQLAccess = new MySQLAccess("140.115.126.137", "maze", "106524006", "quik");


        WWWForm phpform = new WWWForm();

        phpform.AddField("user_id", str[0]);
        phpform.AddField("user_pwd", str[1]);
        WWW reg = new WWW(serverlink + fileName, phpform);

        yield return(reg);

        //s_state = reg.ToString();

        if (reg.error == null)
        {
            if (reg.text == "0")
            {
                state = 0;//帳密錯誤
            }
            else if (reg.text == "1")
            {
                state = 2;//連線失敗
            }
            else if (reg.text == "2")
            {
                state = 3;//發生錯誤
            }
            else//帳密正確
            {
                AccountInfo = reg.text.Split(',');
                state       = 1;
                xmlprocess  = new Xmlprocess(AccountInfo[0], AccountInfo);
                //xmlprocess.setUserInfo(AccountInfo);//ID,pwd,level,sex
                xmlprocess.ScceneHistoryRecord("Login", DateTime.Now.ToString("HH:mm:ss"));
            }

            /* else {
             *   state = 0;
             *   s_state = reg.ToString();
             * }*/
        }
        else
        {
            Debug.Log("error msg" + reg.error);
        }
    }
Exemple #6
0
 void Start()
 {
     ClickBtn         = GetComponentsInChildren <AudioSource>()[0];
     ChooseCard       = GetComponentsInChildren <AudioSource>()[1];
     xmlprocess       = new Xmlprocess();
     this.turnManager = this.gameObject.AddComponent <PunTurnManager>();
     this.turnManager.TurnManagerListener = this;
     this.turnManager.TurnDuration        = 15f;
     cardCount        = 12;
     C_correctNum     = -1; //當前連續答對題數
     max_correctNum   = -1; //最大連續答對數
     correctNum       = 0;  //累計正確題數
     hintLA_count     = 10000; hintST_count = 10000;
     c_hintLA_count   = 0; c_hintST_count = 0;
     wrongNum         = 0;
     IsShowingResults = false;
     RefreshConnectUI();
 }
Exemple #7
0
    void Start()
    {
        ClickBtn = GetComponents <AudioSource>()[1];
        //id = obj_gamestart.GetComponentsInChildren<Text>()[0];
        username      = obj_gamestart.GetComponentsInChildren <InputField>()[0];
        btn_start     = obj_gamestart.GetComponentsInChildren <Button>()[0];
        btn_guide     = obj_gamestart.GetComponentsInChildren <Button>()[2];
        btn_backguide = obj_gamestart.GetComponentsInChildren <Button>()[3];

        btn_backguide.onClick.AddListener(back);
        btn_start.onClick.AddListener(gamestart);
        btn_guide.onClick.AddListener(showGuide);

        xmlprocess = new Xmlprocess();
        //id.text = xmlprocess.getUserInfo()[0];
        username.text = xmlprocess.getUserInfo()[1];
        UIManager.Instance.CloseAllPanel();
    }
Exemple #8
0
    void Start()
    {
        xmlprocess    = new Xmlprocess();
        userInfo      = xmlprocess.getUserInfo();
        userName.text = userInfo[1];
        level.text    = userInfo[2];
        photo         = Resources.LoadAll <Sprite>("Image/Main/Photo");
        switch (userInfo[3])
        {
        case "0":
            userImg.sprite = photo[0];
            break;

        case "1":
            userImg.sprite = photo[2];
            break;
        }
        ClickBtn = GetComponent <AudioSource>();
        btn_photo.onClick.AddListener(clickshowPhotoUI);
        btn_achievement.onClick.AddListener(clickshowAchievementUI);

        //如果初次進入主畫面,顯示成就UI
        if (Home.showAchieve)
        {
            showAchievementUI();
            Home.showAchieve = false;
        }


        //如果完成練習,顯示成就UI
        if (PracticeView.showAchieve)
        {
            Debug.Log(Xmlprocess.levelVal);
            showAchievementUI();
            PracticeView.showAchieve = false;
        }
        //如果離開對戰畫面,顯示成就UI
        if (Btn_BackEvent.showAchieve)
        {
            showAchievementUI();
            Btn_BackEvent.showAchieve = false;
        }
    }
Exemple #9
0
 void Start()
 {
     xmlprocess = new Xmlprocess();
     compete.onClick.AddListener(delegate { goScene("compete"); });
 }
Exemple #10
0
    public Dictionary <int, string> EM_vocabularyDic = new Dictionary <int, string>(); //key=單字ID,val=英文意思


    public PracticeManager()
    {
        xmlprocess = new Xmlprocess();
    }
Exemple #11
0
 void Start()
 {
     mySQLAccess = new MySQLAccess(host, id, pwd, database);
     xmlprocess  = new Xmlprocess();
     StartCoroutine("ReloadXMLtoDB", 0.5F);
 }
Exemple #12
0
 void Start()
 {
     xmlprocess    = new Xmlprocess();
     userInfo      = xmlprocess.getUserInfo();
     userName.text = userInfo[1];
 }
Exemple #13
0
 public CompeteManager()
 {
     xmlprocess = new Xmlprocess();
     playerInfo = xmlprocess.getUserInfo();
 }