Ejemplo n.º 1
0
 private void ReportSpeed()
 {
     try {
         SpeedDto speedDto = CreateSpeedDto();
         RpcRoot.OfficialServer.ReportBinaryService.ReportSpeedAsync(speedDto, (response, e) => {
             if (response.IsSuccess())
             {
                 AppVersionChangedEvent.PublishIfNewVersion(response.ServerState.MinerClientVersion);
                 if (response.NewServerMessages.Count != 0)
                 {
                     VirtualRoot.Execute(new ReceiveServerMessageCommand(response.NewServerMessages));
                 }
                 else
                 {
                     VirtualRoot.Execute(new LoadNewServerMessageCommand(response.ServerState.MessageTimestamp));
                 }
                 VirtualRoot.Execute(new LoadKernelOutputKeywordCommand(response.ServerState.OutputKeywordTimestamp));
                 if (response.ServerState.WsStatus == WsStatus.Online)
                 {
                     VirtualRoot.RaiseEvent(new WsServerOkEvent());
                 }
             }
             else
             {
                 Logger.ErrorDebugLine(e);
             }
         });
     }
     catch (Exception e) {
         Logger.ErrorDebugLine(e);
     }
 }
Ejemplo n.º 2
0
 private void ReportSpeed()
 {
     try {
         SpeedData data = CreateSpeedData();
         RpcRoot.Server.ReportService.ReportSpeedAsync(NTKeyword.OfficialServerHost, data, response => {
             if (response.IsSuccess())
             {
                 AppVersionChangedEvent.PublishIfNewVersion(response.ServerState.MinerClientVersion);
                 if (response.NewServerMessages.Count != 0)
                 {
                     VirtualRoot.Execute(new ReceiveServerMessageCommand(response.NewServerMessages));
                 }
                 else
                 {
                     VirtualRoot.Execute(new LoadNewServerMessageCommand(response.ServerState.MessageTimestamp));
                 }
                 VirtualRoot.Execute(new LoadKernelOutputKeywordCommand(response.ServerState.OutputKeywordTimestamp));
             }
         });
     }
     catch (Exception e) {
         Logger.ErrorDebugLine(e);
     }
 }