示例#1
0
 public IEnumerator CoExcuteAndGetValue <ENUM_PHP_NAME>(string hID, ENUM_PHP_NAME ePHPName, string strTableName, delDBRequest_WithText OnFinishLoad = null, params StringPair[] arrParameter)
     where ENUM_PHP_NAME : System.IFormattable, System.IConvertible, System.IComparable
 {
     yield return(CoExcuteAndGetValue(hID, ePHPName.ToString(), strTableName, OnFinishLoad, arrParameter));
 }
示例#2
0
    protected IEnumerator CoExcuteAndGetValue(string hID, string strPHPName, string strTableName, delDBRequest_WithText OnFinishLoad = null, params StringPair[] arrParameter)
    {
        if (p_Event_DB_OnRequest_Start != null)
        {
            p_Event_DB_OnRequest_Start(strTableName, arrParameter);
        }

        int iRequestCount = 0;

        while (true)
        {
            WWW www = GetWWW(hID, strPHPName, strTableName, arrParameter);
            yield return(www);

            bool bSuccess = www.error == null && (www.text.Contains("false") == false);

            //Debug.Log(strPHPName + " result : " + www.text);

            if (bSuccess == false)
            {
                Debug.Log("DBParser Error " + www.text + " php : " + strPHPName + " TableName : " + strTableName);
                for (int i = 0; i < arrParameter.Length; i++)
                {
                    Debug.Log(string.Format("Key{0} : {1}, Value{2} : {3} ", i, arrParameter[i].strKey, i, arrParameter[i].strValue));
                }
            }

            if (OnFinishLoad == null)
            {
                break;
            }
            else if (OnFinishLoad(bSuccess, ++iRequestCount, www.text))
            {
                break;
            }
        }

        if (p_Event_DB_OnRequest_Finish != null)
        {
            p_Event_DB_OnRequest_Finish(strTableName, arrParameter);
        }

        yield break;
    }
示例#3
0
    static public void DoNetworkDB_UpdateAdd <StructDB>(string strFieldName, object iFieldCount, delDBRequest_WithText OnResult = null, params StringPair[] arrParams)
    {
        CheckIsContainField <StructDB>(strFieldName);

        if (arrParams.Length != 0)
        {
            StringPair[] arrNewParams = new StringPair[arrParams.Length + 1];
            arrNewParams[0] = new StringPair(strFieldName, iFieldCount);

            for (int i = 0; i < arrParams.Length; i++)
            {
                arrNewParams[i + 1] = arrParams[i];
            }

            instance.StartCoroutine(p_pNetworkDB.CoExcuteAndGetValue(instance._strID, EPHPName.Update_Add, typeof(StructDB).ToString(), OnResult, arrNewParams));
        }
        else
        {
            instance.StartCoroutine(p_pNetworkDB.CoExcuteAndGetValue(instance._strID, EPHPName.Update_Add, typeof(StructDB).ToString(), OnResult, new StringPair(strFieldName, iFieldCount.ToString())));
        }
    }
示例#4
0
 static public void DoNetworkDB_GetRandomKey(string strCheckOverlapTableName, delDBRequest_WithText OnFinishLoad = null, params StringPair[] arrParams)
 {
     instance.StartCoroutine(p_pNetworkDB.CoExcuteAndGetValue(null, EPHPName.Get_RandomKey, strCheckOverlapTableName, OnFinishLoad, arrParams));
 }
示例#5
0
    static public void DoNetworkDB_UpdateAdd_If_CheckCount_IsEqualOrGreater <StructDB>(string strFieldName, object iCheckFieldCount, int iAddFieldCount, delDBRequest_WithText OnResult = null)
    {
        CheckIsContainField <StructDB>(strFieldName);

        instance.StartCoroutine(p_pNetworkDB.CoExcuteAndGetValue(instance._strID, EPHPName.CheckCount_AndUpdateAdd, typeof(StructDB).ToString(), OnResult, new StringPair(strFieldName, iCheckFieldCount.ToString()), new StringPair(strFieldName, iAddFieldCount.ToString())));
    }