Esempio n. 1
0
    IEnumerator Upload()
    {
        string groupid = PlayerPrefs.GetString("group_id", null);
        string teamid  = i_teamid.text;
        string userid  = PlayerPrefs.GetString("user_id", null);

        string  url  = StaticMembers.GetRootUrlWithSlash() + "jointeam.php";
        WWWForm form = new WWWForm();

        form.AddField("groupid", groupid);
        form.AddField("teamid", teamid);
        form.AddField("userid", userid);

        using (UnityWebRequest www = UnityWebRequest.Post(url, form))
        {
            www.timeout = 30;
            yield return(www.SendWebRequest());

            if (www.isNetworkError || www.isHttpError)
            {
                text.text = www.error;
            }
            else
            {
                gotResult(www.downloadHandler.text);
            }
        }
    }
Esempio n. 2
0
    IEnumerator Upload()
    {
        string  url  = StaticMembers.GetRootUrlWithSlash() + "joingroupbus.php";
        WWWForm form = new WWWForm();

        form.AddField("username", username);
        form.AddField("groupid", groupid);
        form.AddField("groupkey", groupkey);

        /*
         * Debug.Log(url);
         * Debug.Log(username);
         * Debug.Log(groupid);
         * Debug.Log(groupkey);
         */

        using (UnityWebRequest www = UnityWebRequest.Post(url, form))
        {
            www.timeout = 30;
            yield return(www.SendWebRequest());

            if (www.isNetworkError || www.isHttpError)
            {
                text.text = www.error;
            }
            else
            {
                gotResult(www.downloadHandler.text);
            }
        }
    }
Esempio n. 3
0
    IEnumerator Upload()
    {
        string  url  = StaticMembers.GetRootUrlWithSlash() + "updatepos.php";
        WWWForm form = new WWWForm();

        form.AddField("userid", userid);
        form.AddField("groupid", groupid);
        form.AddField("x", Player.transform.position.x.ToString());
        form.AddField("y", Player.transform.position.y.ToString());
        form.AddField("level", level);

        using (UnityWebRequest www = UnityWebRequest.Post(url, form))
        {
            www.timeout = 30;
            yield return(www.SendWebRequest());

            if (www.isNetworkError || www.isHttpError)
            {
                //text.text = www.error;
                Debug.Log(www.error);
            }
            else
            {
                gotResult(www.downloadHandler.text);
            }
        }

        //yield return new WaitForSeconds(0.05f);
        UpdatePos();
    }
Esempio n. 4
0
    IEnumerator CheckGroup(string s_groupid)
    {
        string  url  = StaticMembers.GetRootUrlWithSlash() + "checkifgroupexcits.php";
        WWWForm form = new WWWForm();

        form.AddField("groupid", s_groupid);

        using (UnityWebRequest www = UnityWebRequest.Post(url, form))
        {
            www.timeout = 5;
            yield return(www.SendWebRequest());

            if (www.isNetworkError || www.isHttpError)
            {
                text.text = www.error;
            }
            else
            {
                gotresultcheck(www.downloadHandler.text);
            }
        }
    }