static public void DoNetworkDB_Insert <StructDB>(delDBRequest OnResult, StructDB pStructDB) where StructDB : IDB_Insert { if (instance.isActiveAndEnabled) { instance.StartCoroutine(p_pNetworkDB.CoExcutePHP(instance._strID, EPHPName.Insert, typeof(StructDB).ToString(), OnResult, pStructDB.IDB_Insert_GetField())); } }
static public void DoNetworkDB_Delete <StructDB>(delDBRequest OnResult, params StringPair[] arrParam) { if (instance._strID != null) { instance.StartCoroutine(p_pNetworkDB.CoExcutePHP(instance._strID, EPHPName.DeleteInfo, typeof(StructDB).ToString(), OnResult, arrParam)); } else { Debug.Log("Delete는 strID에 null이오면 안됩니다."); } }
public IEnumerator CoExcutePHP <ENUM_PHP_NAME>(string hID, ENUM_PHP_NAME ePHPName, string strTableName, delDBRequest OnFinishLoad = null, params StringPair[] arrParameter) where ENUM_PHP_NAME : System.IFormattable, System.IConvertible, System.IComparable { yield return(CoExcutePHP(hID, ePHPName.ToString(), strTableName, OnFinishLoad, arrParameter)); }
// ===================================== // // public - [Getter And Setter] Function // // ===================================== // // ========================================================================== // // private - [Proc] Function // // 중요 로직을 처리 // // ===================================== // protected IEnumerator CoExcutePHP(string hID, string strPHPName, string strTableName, delDBRequest OnFinishLoad = null, params StringPair[] arrParameter) { if (p_Event_DB_OnRequest_Start != null) { p_Event_DB_OnRequest_Start(strTableName, arrParameter); } int iRequestCount = 0; while (true) { #if UNITY_2017_1 UnityEngine.Networking.UnityWebRequest www = GetWWWNew(hID, strPHPName, strTableName, arrParameter); yield return(www.SendWebRequest()); bool bSuccess = www.error == null && (www.downloadHandler.text.Contains("false") == false); if (bSuccess == false) { Debug.Log("DBParser Error " + www.downloadHandler.text + " php : " + strPHPName + " TableName : " + strTableName); } #else WWW www = GetWWW(hID, strPHPName, strTableName, arrParameter); yield return(www); bool bSuccess = www.error == null && (www.text.Contains("false") == false); if (bSuccess == false) { Debug.Log("DBParser Error " + www.text + " php : " + strPHPName + " TableName : " + strTableName); } #endif // Debug.Log(strPHPName + " result : " + www.text); //Debug.Log( "DBParser Error " + www.text + " php : " + strPHPName + " TableName : " + strTableName ); if (OnFinishLoad == null) { break; } else if (OnFinishLoad(bSuccess, ++iRequestCount)) { break; } } if (p_Event_DB_OnRequest_Finish != null) { p_Event_DB_OnRequest_Finish(strTableName, arrParameter); } yield break; }
static public void DoNetworkDB_Insert <StructDB>(delDBRequest OnResult, params StringPair[] arrParam) { instance.StartCoroutine(p_pNetworkDB.CoExcutePHP(instance._strID, EPHPName.Insert, typeof(StructDB).ToString(), OnResult, arrParam)); }
static public void DoNetworkDB_Update_Set_ServerTime <StructDB>(string strFieldName, delDBRequest OnResult) { instance.StartCoroutine(p_pNetworkDB.CoExcutePHP(instance._strID, EPHPName.Update_Set_ServerTime, typeof(StructDB).ToString(), OnResult, new StringPair(strFieldName, ""))); }
static public void DoNetworkDB_Update_Set_Custom <StructDB>(string strFieldName, object strSetFieldValue, delDBRequest OnResult, params StringPair[] arrField) { CheckIsContainField <StructDB>(strFieldName); StringPair[] arrPair = new StringPair[arrField.Length + 1]; for (int i = 0; i < arrField.Length; i++) { arrPair[i] = arrField[i]; } arrPair[arrField.Length] = new StringPair(strFieldName, strSetFieldValue.ToString()); instance.StartCoroutine(p_pNetworkDB.CoExcutePHP(null, EPHPName.Update_Set_Custom, typeof(StructDB).ToString(), OnResult, arrPair)); }
static public void DoNetworkDB_Update_Set_DoubleKey <StructDB>(string strFieldName, object strSetFieldValue, delDBRequest OnResult, StringPair pDoubleKey) { CheckIsContainField <StructDB>(strFieldName); instance.StartCoroutine(p_pNetworkDB.CoExcutePHP(instance._strID, EPHPName.Update_Set_ID_DoubleKey, typeof(StructDB).ToString(), OnResult, new StringPair[2] { pDoubleKey, new StringPair(strFieldName, strSetFieldValue) })); }
static public void DoNetworkDB_CheckCount_IsEqualOrGreater <StructDB>(string strFieldName, object iCheckFieldCount, delDBRequest OnResult = null) { CheckIsContainField <StructDB>(strFieldName); instance.StartCoroutine(p_pNetworkDB.CoExcutePHP(instance._strID, EPHPName.Check_Count, typeof(StructDB).ToString(), OnResult, new StringPair(strFieldName, iCheckFieldCount.ToString()))); }