public void phpIOSCheck(string dat, phpCallback cb) { string id = SystemInfo.deviceUniqueIdentifier; string urlSql = urlCheck + "str=" + dat; StartCoroutine(phpIOSCheck1(urlSql, cb)); }
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); } } }
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) { } } }
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); } } }
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); } } }
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) { } } }
public void phpIOSPay(string dat, phpCallback cb) { string id = SystemInfo.deviceUniqueIdentifier; string urlSql = urlPay + "id=" + id + "&dat=" + dat; StartCoroutine(phpIOSPay1(urlSql, cb)); }
public void phpActive(phpCallback cb) { string id = SystemInfo.deviceUniqueIdentifier; string urlSql = url + "CALL .SELECT_ACTIVE( '" + id + "' );"; StartCoroutine(phpActive(urlSql, cb)); }
public void phpLoadIndex(int i, phpCallback cb) { string id = SystemInfo.deviceUniqueIdentifier; string urlSql = url + "CALL .SELECT_SAVE_INDEX( '" + i + "' );"; StartCoroutine(phpGet(urlSql, i, cb)); }
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)); }
public void phpLoad(string id, int i, phpCallback cb) { string urlSql = url + "CALL .SELECT_SAVE( '" + id + "' , '" + i + "' );"; StartCoroutine(phpGet(urlSql, i, cb)); }