void Dispose() { httpClient = null; httpDataCom.OnUnregister(null); httpDataCom = null; _engine = null; }
/**************************************************** 状态的改变 ***************************************************************/ 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"); } }
//游戏的内部逻辑请求 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)); } }
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"); } }
void ICore.Dispose() { httpClient = null; ICore IhttpDataCom = httpDataCom as ICore; if (IhttpDataCom != null) { IhttpDataCom.Dispose(); } httpDataCom = null; _engine = null; }
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()); }
/// <summary> /// 清空所有的Http的任务,删除DataComplete /// </summary> public void OnUnregister(StateParam <GameState> obj) { ResetRequet(); httpDataCom = null; }