Exemple #1
0
 void Dispose()
 {
     httpClient = null;
     httpDataCom.OnUnregister(null);
     httpDataCom = null;
     _engine     = null;
 }
Exemple #2
0
    /****************************************************  状态的改变  ***************************************************************/

    public void OnLogin(StateParam <GameState> obj)
    {
        if (obj != null)
        {
            LoginInfo Log = obj.obj as LoginInfo;
            httpDataCom = new HttpData_Completeness(Log.LocalIOMgr);
        }
        else
        {
            throw new DragonException("HttpThread OnLogin Param must be LocalIOManager");
        }
    }
Exemple #3
0
    //游戏的内部逻辑请求
    public string doRequest(HttpRequest req, HttpData_Completeness httpDataCom)
    {
        string param = req.toJson(httpDataCom);

        if (string.IsNullOrEmpty(req.Url))
        {
            return(doRequest(param, BaseUrl));
        }
        else
        {
            return(doRequest(param, req.Url));
        }
    }
Exemple #4
0
    void ICore.OnLogin(Object dpm)
    {
        if (dpm != null)
        {
            DataPersistManager dataManager = dpm as DataPersistManager;

            httpDataCom = new HttpData_Completeness(dataManager);
        }
        else
        {
            throw new DragonException("HttpThread OnLogin Param must be DataPersistManager");
        }
    }
Exemple #5
0
    void ICore.Dispose()
    {
        httpClient = null;

        ICore IhttpDataCom = httpDataCom as ICore;

        if (IhttpDataCom != null)
        {
            IhttpDataCom.Dispose();
        }
        httpDataCom = null;

        _engine = null;
    }
Exemple #6
0
    public string toJson(HttpData_Completeness httpDataComm)
    {
        int No = 1;

        if (httpDataComm != null)
        {
            No = httpDataComm.getHttpRequestNo(this);
        }
        int cache = RequestTypeToCache();

        return(ACTION + "=" + Convert.ToString(_act) + "&" + NO + "=" + Convert.ToString(No) +
               "&" + VERSION + "=" + Convert.ToString(_Version) +
               "&" + CRC + "=" + HashHttpRequest._________________________(Convert.ToString(_act), Convert.ToString(_Version), sb.ToString(), Convert.ToString(No), _PlatformId) +
               "&" + UNIQUE_PLATFORM_ID + "=" + _PlatformId +
               "&" + RESOURCE_VERSION + "=" + 1 +
               "&" + CACHE + "=" + cache +
               "&" + DATA + "=" + sb.ToString());
    }
Exemple #7
0
 /// <summary>
 /// 清空所有的Http的任务,删除DataComplete
 /// </summary>
 public void OnUnregister(StateParam <GameState> obj)
 {
     ResetRequet();
     httpDataCom = null;
 }