/// <summary> /// 请求下载处理器(异常下载方法) /// 用于下载错误时,重新下载的方法 /// </summary> /// <param name="reqId">请求ID</param> /// <param name="fileId">文件ID /// 资源下载标识非ResDownType.ResPackage, 设置为-1 /// 资源下载标识为ResDownType.ResPackage,代表包ID /// </param> /// <param name="flag">资源下载标识</param> /// <param name="url">下载地址</param> /// <param name="name">文件名称(带文件格式)</param> /// <param name="type">文件类型</param> /// <param name="iDown">下载回调接口</param> public void ReqDownLoadHandlerException(uint reqId, int fileId, ResDownFlag flag, string url, string name, IResourceDown iDown) { // 加入异常下载队列(异常下载传入true) m_ExceptionQueue.Enqueue(new ResDownReqInfo(reqId, fileId, flag, true, url, name, iDown)); // 订阅Update事件 //SubscribeUpdateEvent(true); }
/// <summary> /// 请求下载处理器(正常下载方法) /// </summary> /// <param name="reqId">请求ID</param> /// <param name="fileId">文件ID /// 资源下载标识非ResDownType.ResPackage, 设置为-1 /// 资源下载标识为ResDownType.ResPackage,代表包ID /// </param> /// <param name="flag">资源下载标识</param> /// <param name="url">下载地址</param> /// <param name="name">文件名称(带文件格式)</param> /// <param name="type">文件类型</param> /// <param name="iDown">下载回调接口</param> public void ReqDownLoadHandler(out uint reqId, int fileId, ResDownFlag flag, string url, string name, IResourceDown iDown) { // 输出下载请求唯一ID reqId = m_ReqDownLoadId++; // 加入下载队列(非异常下载传入false) m_DownQueue.Enqueue(new ResDownReqInfo(reqId, fileId, flag, false, url, name, iDown)); // 订阅Update事件 //SubscribeUpdateEvent(true); }
public ResDownResult(uint reqId = 0) { uReqId = reqId; nFileID = 0; strFileName = ""; nUserData = 0; eFlag = ResDownFlag.None; eState = ResDownState.NoDown; fProgress = 0f; sErrorMsg = null; }
public ResDownReqInfo(uint reqId, int fileId, ResDownFlag flag, bool unusual, string url, string name, IResourceDown iDown) { m_result = new ResDownResult(); m_result.uReqId = reqId; m_result.nFileID = fileId; m_result.strFileName = name; m_result.eFlag = flag; m_url = url; m_name = name; m_iDown = iDown; m_unusual = unusual; }