PatchEventDispatcher.cs 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. 
  2. public static class PatchEventDispatcher
  3. {
  4. public static void SendPatchStepsChangeMsg(EPatchStates currentStates)
  5. {
  6. PatchEventMessageDefine.PatchStatesChange msg = new PatchEventMessageDefine.PatchStatesChange();
  7. msg.CurrentStates = currentStates;
  8. EventManager.SendMessage(msg);
  9. }
  10. public static void SendFoundUpdateFilesMsg(int totalCount, long totalSizeBytes)
  11. {
  12. PatchEventMessageDefine.FoundUpdateFiles msg = new PatchEventMessageDefine.FoundUpdateFiles();
  13. msg.TotalCount = totalCount;
  14. msg.TotalSizeBytes = totalSizeBytes;
  15. EventManager.SendMessage(msg);
  16. }
  17. public static void SendDownloadProgressUpdateMsg(int totalDownloadCount, int currentDownloadCount, long totalDownloadSizeBytes, long currentDownloadSizeBytes)
  18. {
  19. PatchEventMessageDefine.DownloadProgressUpdate msg = new PatchEventMessageDefine.DownloadProgressUpdate();
  20. msg.TotalDownloadCount = totalDownloadCount;
  21. msg.CurrentDownloadCount = currentDownloadCount;
  22. msg.TotalDownloadSizeBytes = totalDownloadSizeBytes;
  23. msg.CurrentDownloadSizeBytes = currentDownloadSizeBytes;
  24. EventManager.SendMessage(msg);
  25. }
  26. public static void SendStaticVersionUpdateFailedMsg()
  27. {
  28. PatchEventMessageDefine.StaticVersionUpdateFailed msg = new PatchEventMessageDefine.StaticVersionUpdateFailed();
  29. EventManager.SendMessage(msg);
  30. }
  31. public static void SendPatchManifestUpdateFailedMsg()
  32. {
  33. PatchEventMessageDefine.PatchManifestUpdateFailed msg = new PatchEventMessageDefine.PatchManifestUpdateFailed();
  34. EventManager.SendMessage(msg);
  35. }
  36. public static void SendWebFileDownloadFailedMsg(string fileName, string error)
  37. {
  38. PatchEventMessageDefine.WebFileDownloadFailed msg = new PatchEventMessageDefine.WebFileDownloadFailed();
  39. msg.FileName = fileName;
  40. msg.Error = error;
  41. EventManager.SendMessage(msg);
  42. }
  43. }