HAARFTE/Assets/DemoGame/GameScript/Loader/Event/Args/DownloadProgressUpdateEvent...

111 lines
3.5 KiB
C#
Raw Normal View History

2024-10-24 16:16:57 +08:00
namespace ZGame
{
/// <summary>
/// 补丁包初始化失败
/// </summary>
public class InitializeFailedEventArgs : GameEventArgs
{
public static readonly int EventId = typeof(InitializeFailedEventArgs).GetHashCode();
public override int Id => EventId;
}
/// <summary>
/// 补丁流程步骤改变
/// </summary>
public class PatchStatesChangeEventArgs : GameEventArgs
{
public static readonly int EventId = typeof(PatchStatesChangeEventArgs).GetHashCode();
public override int Id => EventId;
public string Tips { get; }
public PatchStatesChangeEventArgs(string tips)
{
this.Tips = tips;
}
}
/// <summary>
/// 发现更新文件
/// </summary>
public class FoundUpdateFilesEventArgs : GameEventArgs
{
public static readonly int EventId = typeof(FoundUpdateFilesEventArgs).GetHashCode();
public override int Id => EventId;
public int TotalCount { get; }
public long TotalSizeBytes { get; }
public FoundUpdateFilesEventArgs(int totalCount, long totalSizeBytes)
{
this.TotalCount = totalCount;
this.TotalSizeBytes = totalSizeBytes;
}
}
/// <summary>
/// 下载进度更新
/// </summary>
public class DownloadProgressUpdateEventArgs : GameEventArgs
{
public static readonly int EventId = typeof(DownloadProgressUpdateEventArgs).GetHashCode();
public override int Id => EventId;
public int TotalDownloadCount { get; }
public int CurrentDownloadCount { get; }
public long TotalDownloadSizeBytes { get; }
public long CurrentDownloadSizeBytes { get; }
public DownloadProgressUpdateEventArgs(int totalDownloadCount, int currentDownloadCount, long totalDownloadSizeBytes, long currentDownloadSizeBytes)
{
this.TotalDownloadCount = totalDownloadCount;
this.CurrentDownloadCount = currentDownloadCount;
this.TotalDownloadSizeBytes = totalDownloadSizeBytes;
this.CurrentDownloadSizeBytes = currentDownloadSizeBytes;
}
}
/// <summary>
/// 资源版本号更新失败
/// </summary>
public class PackageVersionUpdateFailedEventArgs : GameEventArgs
{
public static readonly int EventId = typeof(PackageVersionUpdateFailedEventArgs).GetHashCode();
public override int Id => EventId;
}
/// <summary>
/// 补丁清单更新失败
/// </summary>
public class PatchManifestUpdateFailedEventArgs : GameEventArgs
{
public static readonly int EventId = typeof(PatchManifestUpdateFailedEventArgs).GetHashCode();
public override int Id => EventId;
}
/// <summary>
/// 网络文件下载失败
/// </summary>
public class WebFileDownloadFailedEventArgs : GameEventArgs
{
public static readonly int EventId = typeof(WebFileDownloadFailedEventArgs).GetHashCode();
public override int Id => EventId;
public string FileName { get; }
public string Error { get; }
public WebFileDownloadFailedEventArgs(string fileName, string error)
{
this.FileName = fileName;
this.Error = error;
}
}
/// <summary>
/// 更新完成
/// </summary>
public class UpdaterDoneEventArgs : GameEventArgs
{
public static readonly int EventId = typeof(UpdaterDoneEventArgs).GetHashCode();
public override int Id => EventId;
}
}