少年修仙传客户端代码仓库
client_Wu Xijin
2018-09-07 13a66b58ec8a2d5585650c5bbb11e4eeca5996dc
3335 代码维护
1个文件已修改
38 ■■■■■ 已修改文件
System/AssetVersion/RemoteFile.cs 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/AssetVersion/RemoteFile.cs
@@ -11,25 +11,30 @@
public class RemoteFile
{
    static bool m_ProcessErroring = false;
    public static bool processErroring {
    public static bool processErroring
    {
        get { return m_ProcessErroring; }
    }
    public static int maxDownLoadTask = 48;
    public static int MaxConnectLimit = 48;
    static int gDownloadIsRunningCount;
    public static int DownloadIsRunningCount {
    public static int DownloadIsRunningCount
    {
        get { return gDownloadIsRunningCount; }
    }
    public static int gStartTickcount = 0;
    static long gTotalDownloadSize = 0L;  //已下载的字节数
    static object lockObj = new object();
    public static long TotalDownloadedSize {
        get {
    public static long TotalDownloadedSize
    {
        get
        {
            return System.Threading.Interlocked.Read(ref gTotalDownloadSize);
        }
        set {
        set
        {
            gTotalDownloadSize = value;
        }
    }
@@ -37,8 +42,10 @@
    static float downloadSpeedRef = 0f; //字节/秒
    static long downloadSizeRef = 0L;
    public static string DownloadSpeed {
        get {
    public static string DownloadSpeed
    {
        get
        {
            float speed = downloadSpeedRef;
            if (RemoteFile.gStartTickcount != 0)
            {
@@ -95,14 +102,17 @@
    Action<bool, AssetVersion> onCompleted;
    protected bool mHadError = false;
    public bool HaveError {
    public bool HaveError
    {
        get { return mHadError; }
    }
    bool m_Done = false;
    public bool done {
    public bool done
    {
        get { return m_Done; }
        private set {
        private set
        {
            m_Done = value;
            if (value)
            {
@@ -407,8 +417,8 @@
            if (localFileSize == mRemoteFileSize && !outDated)
            {
                gDownloadIsRunningCount--;
                done = true;
                mHadError = !Move(mLocalFileTemp, localFile);//把临时文件改名为正式文件
                done = true;
                yield break; // We already have the file, early out
            }
            else if (localFileSize > mRemoteFileSize || outDated)
@@ -673,8 +683,10 @@
        }
    }
    bool IsOutdated {
        get {
    bool IsOutdated
    {
        get
        {
            if (File.Exists(mLocalFileTemp))
                return mRemoteLastModified > mLocalLastModified;
            return false;