少年修仙传客户端代码仓库
client_Wu Xijin
2018-08-22 0a858ed58b484a23d01a8232e151dd8efa145561
System/AssetVersion/RemoteFile.cs
@@ -72,7 +72,7 @@
        }
    }
    AssetVersion assetVersion;
    public AssetVersion assetVersion { get; private set; }
    protected string mRemoteFile;
    protected string localFile;
    bool speedLimit = false;
@@ -123,6 +123,7 @@
    public static void Prepare()
    {
        gDownloadIsRunningCount = 0;
        gStartTickcount = System.Environment.TickCount;
        TotalDownloadedSize = 0L;
        downloadSpeedRef = 0f;
@@ -153,7 +154,8 @@
        }
        stop = true;
        try
        {
        if (headRequest != null)
        {
            headRequest.Abort();
@@ -190,13 +192,19 @@
            inStream.Close();
            inStream = null;
        }
        }
        catch (Exception ex)
        {
            Debug.Log(ex);
        }
        finally
        {
        onCompleted = null;
        mHadError = false;
        if (state == State.Working)
        {
            gDownloadIsRunningCount--;
            }
        }
    }
@@ -324,7 +332,11 @@
                            headResponse.Close();
                            headResponse = null;
                        }
                        if (headRequest != null)
                        {
                        headRequest.Abort();
                            headRequest = null;
                        }
                    }
                }, headRequest);
@@ -373,7 +385,12 @@
        if (mHadError)
        {
            DebugEx.LogWarningFormat("获取远程文件{0} 信息失败!", mRemoteFile);
            if (headRequest != null)
            {
            headRequest.Abort();
                headRequest = null;
            }
            done = true;
            gDownloadIsRunningCount--;
            yield break;