public IEnumerator CoLoadDataListFrom_Array <T>(string hID, string strPHPName, delDBRequest_GenericArray <T> OnFinishLoad, params StringPair[] arrParameter) { string strTableName = typeof(T).Name; if (p_Event_DB_OnRequest_Start != null) { p_Event_DB_OnRequest_Start(strTableName, arrParameter); } //UnityEngine.Networking.UnityWebRequest www; WWW www; int iRequestCount = 0; bool bSuccess; while (true) { bSuccess = true; www = GetWWW(hID, strPHPName, strTableName, arrParameter); yield return(www); //www = GetWWWNew( hID, strPHPName, strTableName, arrParameter ); //yield return www.SendWebRequest(); T[] arrOutData = null; bSuccess = www.error == null; try { bSuccess = SCManagerParserJson.DoReadJsonArray <T>(www, out arrOutData); } catch { bSuccess = false; } if (OnFinishLoad == null) { break; } else if (OnFinishLoad(bSuccess, ++iRequestCount, arrOutData)) { break; } } if (bSuccess == false) { Debug.Log("DBParser Warning " + www.text + " php : " + strPHPName + " TableName : " + strTableName + " iRequestCount : " + iRequestCount, null); //Debug.Log( "DBParser Warning " + www.downloadHandler.text + " php : " + strPHPName + " TableName : " + strTableName + " iRequestCount : " + iRequestCount, null ); for (int i = 0; i < arrParameter.Length; i++) { Debug.LogWarning(string.Format("Key{0} : {1}, Value{2} : {3} ", i, arrParameter[i].strKey, i, arrParameter[i].strValue)); } } if (p_Event_DB_OnRequest_Finish != null) { p_Event_DB_OnRequest_Finish(strTableName, arrParameter); } yield break; }
static public void DoNetworkDB_Get_Array <StructDB>(delDBRequest_GenericArray <StructDB> OnFinishLoad = null, params StringPair[] arrParams) { instance.StartCoroutine(p_pNetworkDB.CoLoadDataFromServer_Json_Array(instance._strID, EPHPName.Get, OnFinishLoad, arrParams)); }
public IEnumerator CoLoadDataFromServer_Json_Array <ENUM_PHP_NAME, T>(string hID, ENUM_PHP_NAME ePHPName, delDBRequest_GenericArray <T> OnFinishLoad, params StringPair[] arrParameter) where ENUM_PHP_NAME : System.IFormattable, System.IConvertible, System.IComparable { yield return(CoLoadDataListFrom_Array(hID, ePHPName.ToString(), OnFinishLoad, arrParameter)); }
static public void DoNetworkDB_GetRange_Orderby_HighToLow <StructDB>(string strFieldName, int iGetDataCount, delDBRequest_GenericArray <StructDB> OnFinishLoad = null) { CheckIsContainField <StructDB>(strFieldName); instance.StartCoroutine(p_pNetworkDB.CoLoadDataFromServer_Json_Array(instance._strID, EPHPName.Get_Range, OnFinishLoad, new StringPair(strFieldName, iGetDataCount))); }