コード例 #1
0
 /// <summary>
 /// 处理请求操作
 /// </summary>
 public void HandleOperation(EPatchOperation operation)
 {
     if (operation == EPatchOperation.BeginDownloadWebFiles)
     {
         _procedure.Switch(EPatchStates.DownloadWebFiles.ToString());
     }
     else if (operation == EPatchOperation.TryRequestGameVersion)
     {
         _procedure.Switch(EPatchStates.RequestGameVersion.ToString());
     }
     else if (operation == EPatchOperation.TryRequestPatchManifest)
     {
         _procedure.Switch(EPatchStates.RequestPatchManifest.ToString());
     }
     else if (operation == EPatchOperation.TryDownloadWebFiles)
     {
         _procedure.Switch(EPatchStates.CreateDownloader.ToString());
     }
     else
     {
         throw new NotImplementedException($"{operation}");
     }
 }
コード例 #2
0
ファイル: PatchWindow.cs プロジェクト: CJD982262945/Projects
 /// <summary>
 /// 发送事件
 /// </summary>
 private void SendOperationEvent(EPatchOperation operation)
 {
     PatchEventMessageDefine.OperationEvent msg = new PatchEventMessageDefine.OperationEvent();
     msg.operation = operation;
     EventManager.Instance.SendMessage(msg);
 }
コード例 #3
0
 /// <summary>
 /// 处理请求
 /// </summary>
 private void HandlePatchOperation(EPatchOperation operation)
 {
     PatchUpdater.Instance.HandleOperation(operation);
 }
コード例 #4
0
 /// <summary>
 /// 处理请求操作
 /// </summary>
 public void HandleOperation(EPatchOperation operation)
 {
     if (operation == EPatchOperation.BeginGetDownloadList)
     {
         // 从挂起的地方继续
         if (_procedure.Current == EPatchStates.RequestPatchManifest.ToString())
         {
             _procedure.SwitchNext();
         }
         else
         {
             MotionLog.Error($"Patch states is incorrect : {_procedure.Current}");
         }
     }
     else if (operation == EPatchOperation.BeginDownloadWebFiles)
     {
         // 从挂起的地方继续
         if (_procedure.Current == EPatchStates.GetDownloadList.ToString())
         {
             _procedure.SwitchNext();
         }
         else
         {
             MotionLog.Error($"Patch states is incorrect : {_procedure.Current}");
         }
     }
     else if (operation == EPatchOperation.TryRequestGameVersion)
     {
         // 修复当前错误节点
         if (_procedure.Current == EPatchStates.RequestGameVersion.ToString())
         {
             _procedure.Switch(_procedure.Current);
         }
         else
         {
             MotionLog.Error($"Patch states is incorrect : {_procedure.Current}");
         }
     }
     else if (operation == EPatchOperation.TryRequestPatchManifest)
     {
         // 修复当前错误节点
         if (_procedure.Current == EPatchStates.RequestPatchManifest.ToString())
         {
             _procedure.Switch(_procedure.Current);
         }
         else
         {
             MotionLog.Error($"Patch states is incorrect : {_procedure.Current}");
         }
     }
     else if (operation == EPatchOperation.TryDownloadWebFiles)
     {
         // 修复当前错误节点
         if (_procedure.Current == EPatchStates.DownloadWebFiles.ToString())
         {
             _procedure.Switch(EPatchStates.GetDownloadList.ToString());
         }
         else
         {
             MotionLog.Error($"Patch states is incorrect : {_procedure.Current}");
         }
     }
     else
     {
         throw new NotImplementedException($"{operation}");
     }
 }
コード例 #5
0
 /// <summary>
 /// 处理请求操作
 /// </summary>
 public void HandleOperation(EPatchOperation operation)
 {
     _patcher.HandleOperation(operation);
 }