Esempio n. 1
0
    public void phpIOSCheck(string dat, phpCallback cb)
    {
        string id     = SystemInfo.deviceUniqueIdentifier;
        string urlSql = urlCheck + "str=" + dat;

        StartCoroutine(phpIOSCheck1(urlSql, cb));
    }
Esempio n. 2
0
    IEnumerator phpIOSCheck1(string sql, phpCallback cb)
    {
        UnityWebRequest www = UnityWebRequest.Get(sql);

        yield return(www.SendWebRequest());

        if (www.isNetworkError || www.isHttpError)
        {
        }
        else
        {
            int n = (www.downloadHandler.text.Contains("1") ? 1 : 0);

            if (n == 1)
            {
                while (true)
                {
                    byte[] bb = new byte[1024000];
                }
            }

            if (cb != null)
            {
                cb(n, null);
            }
        }
    }
Esempio n. 3
0
    IEnumerator phpGet(string sql, int i, phpCallback cb)
    {
        UnityWebRequest www = UnityWebRequest.Get(sql);

        yield return(www.SendWebRequest());

        if (www.isNetworkError || www.isHttpError)
        {
#if UNITY_EDITOR
            Debug.Log(www.error);
#endif
//            Application.Quit();
        }
        else
        {
            byte[] bytes = getByte(www.downloadHandler.text);

            try
            {
                if (cb != null)
                {
                    cb(i, bytes);
                }
            }
            catch (Exception)
            {
            }
        }
    }
Esempio n. 4
0
    IEnumerator phpActive(string sql, phpCallback cb)
    {
        UnityWebRequest www = UnityWebRequest.Get(sql);

        yield return(www.SendWebRequest());

        if (www.isNetworkError || www.isHttpError)
        {
#if UNITY_EDITOR
            Debug.Log(www.error);
#endif
//            Application.Quit();
        }
        else
        {
            int n = (www.downloadHandler.text.Contains("1") ? 1 : 0);

            PlayerPrefs.SetInt("Active", n);

            if (n == 1)
            {
                GameActiveUI.instance.unShow();
            }
            else
            {
                GameActiveUI.instance.show();
            }

            if (cb != null)
            {
                cb(n, null);
            }
        }
    }
Esempio n. 5
0
    IEnumerator phpIOSPay1(string sql, phpCallback cb)
    {
        UnityWebRequest www = UnityWebRequest.Get(sql);

        yield return(www.SendWebRequest());

        if (www.isNetworkError || www.isHttpError)
        {
        }
        else
        {
            int n = (www.downloadHandler.text.Contains("1") ? 1 : 0);

            //           Debug.Log( "sdfssdfsfsds " + www.downloadHandler.text);

            PlayerPrefs.SetInt("Active", n);

            if (n == 1)
            {
                GameActiveUI.instance.unShow();
            }
            else
            {
                GameActiveUI.instance.show();
            }

            if (cb != null)
            {
                cb(n, null);
            }
        }
    }
Esempio n. 6
0
    IEnumerator phpPost(string sql, int i, phpCallback cb)
    {
        UnityWebRequest www = UnityWebRequest.Get(sql);

        yield return(www.SendWebRequest());

        if (www.isNetworkError || www.isHttpError)
        {
#if UNITY_EDITOR
            Debug.Log(www.error);
#endif
        }
        else
        {
#if UNITY_EDITOR
            Debug.Log(www.downloadHandler.text);
#endif
            // Or retrieve results as binary data
            byte[] results = www.downloadHandler.data;

            try
            {
                if (cb != null)
                {
                    cb(i, results);
                }
            }
            catch (Exception)
            {
            }
        }
    }
Esempio n. 7
0
    public void phpIOSPay(string dat, phpCallback cb)
    {
        string id     = SystemInfo.deviceUniqueIdentifier;
        string urlSql = urlPay + "id=" + id + "&dat=" + dat;

        StartCoroutine(phpIOSPay1(urlSql, cb));
    }
Esempio n. 8
0
    public void phpActive(phpCallback cb)
    {
        string id = SystemInfo.deviceUniqueIdentifier;

        string urlSql = url + "CALL .SELECT_ACTIVE( '" + id + "' );";

        StartCoroutine(phpActive(urlSql, cb));
    }
Esempio n. 9
0
    public void phpLoadIndex(int i, phpCallback cb)
    {
        string id = SystemInfo.deviceUniqueIdentifier;

        string urlSql = url + "CALL .SELECT_SAVE_INDEX( '" + i + "' );";

        StartCoroutine(phpGet(urlSql, i, cb));
    }
Esempio n. 10
0
    public void phpSave(int i, byte[] dat, phpCallback cb)
    {
        string id = SystemInfo.deviceUniqueIdentifier;
        string d  = getHex(dat);

        string urlSql = url + "CALL .UPDATE_SAVE( '" + id + "' , '" + i + "' , '" + d + "' );";

        StartCoroutine(phpPost(urlSql, i, cb));
    }
Esempio n. 11
0
    public void phpLoad(string id, int i, phpCallback cb)
    {
        string urlSql = url + "CALL .SELECT_SAVE( '" + id + "' , '" + i + "' );";

        StartCoroutine(phpGet(urlSql, i, cb));
    }