/// <summary> /// 开始处理 Web 请求任务。 /// </summary> /// <param name="task">要处理的 Web 请求任务。</param> public void Start(WebRequestTask task) { if (task == null) { throw new System.Exception("Task is invalid."); } m_Task = task; m_Task.Status = WebRequestTaskStatus.Doing; if (WebRequestAgentStart != null) { WebRequestAgentStart(this); } byte[] postData = m_Task.GetPostData(); if (postData == null) { m_Helper.Request(m_Task.WebRequestUri, m_Task.UserData); } else { m_Helper.Request(m_Task.WebRequestUri, postData, m_Task.UserData); } m_WaitTime = 0f; }
/// <summary> /// 开始处理 Web 请求任务。 /// </summary> /// <param name="task">要处理的 Web 请求任务。</param> /// <returns>开始处理任务的状态。</returns> public StartTaskStatus Start(WebRequestTask task) { if (task == null) { throw new GameFrameworkException("Task is invalid."); } m_Task = task; m_Task.Status = WebRequestTaskStatus.Doing; if (WebRequestAgentStart != null) { WebRequestAgentStart(this); } byte[] postData = m_Task.GetPostData(); if (postData == null) { m_Helper.Request(m_Task.WebRequestUri, m_Task.UserData); } else { m_Helper.Request(m_Task.WebRequestUri, postData, m_Task.UserData); } m_WaitTime = 0f; return(StartTaskStatus.CanResume); }
/// <summary> /// 开始处理 Web 请求任务。 /// </summary> /// <param name="task">要处理的 Web 请求任务。</param> /// <returns>开始处理任务的状态。</returns> public void Start(WebRequestTask task) { if (task == null) { Debug.LogError("Task is invalid."); } m_Task = task; m_Task.Status = WebRequestTaskStatus.Doing; if (WebRequestAgentStart != null) { WebRequestAgentStart(this); } byte[] postData = m_Task.GetPostData(); if (postData == null) { m_Helper.Request(m_Task.WebRequestUri, m_Task.UserData); } else { m_Helper.Request(m_Task.WebRequestUri, postData, m_Task.UserData); } m_WaitTime = 0f; //return StartTaskStatus.CanResume; }
/// <summary> /// 开始处理 Web 请求任务。 /// </summary> /// <param name="task">要处理的 Web 请求任务。</param> public void Start(WebRequestTask task) { if (task == null) { throw new GameFrameworkException("Task is invalid."); } m_Task = task; m_Task.Status = WebRequestTaskStatus.Doing; if (WebRequestAgentStart != null) { WebRequestAgentStart(this); } if (m_Task.PostData == null) { m_Helper.Request(m_Task.WebRequestUri, m_Task.UserData); } else { m_Helper.Request(m_Task.WebRequestUri, m_Task.PostData, m_Task.UserData); } m_WaitTime = 0f; }
/// <summary> /// 开始处理 Web 请求任务。 /// </summary> /// <param name="task">要处理的 Web 请求任务。</param> /// <returns>开始处理任务的状态。</returns> public StartTaskStatus Start(WebRequestTask task) { if (task == null) { throw new Exception("Task is invalid."); } m_Task = task; m_Task.Status = WebRequestTaskStatus.Doing; m_Helper.Request(m_Task.WebRequestUri, m_Task.GetPostData()); m_WaitTime = 0f; return(StartTaskStatus.CanResume); }