Esempio n. 1
0
 public void IsLoginNameExistAsync(string loginName, Action <bool> callback)
 {
     JsonRpcRoot.GetAsync(RpcRoot.OfficialServerHost, RpcRoot.OfficialServerPort, _controllerName, nameof(IUserController.IsLoginNameExist), new Dictionary <string, string> {
         ["loginName"] = loginName
     }, (DataResponse <bool> response, Exception e) => {
         callback?.Invoke(response.IsSuccess() && response.Data);
     }, timeountMilliseconds: 5000);
 }
Esempio n. 2
0
 public void GetOperationResultsAsync(IMinerData client, long afterTime)
 {
     JsonRpcRoot.GetAsync <List <OperationResultData> >(client.GetLocalIp(), NTKeyword.NTMinerDaemonPort, _daemonControllerName, nameof(INTMinerDaemonController.GetOperationResults), new Dictionary <string, string> {
         ["afterTime"] = afterTime.ToString()
     }, (data, e) => {
         if (data != null && data.Count > 0)
         {
             VirtualRoot.RaiseEvent(new ClientOperationResultsEvent(client.ClientId, data));
         }
     }, timeountMilliseconds: 3000);
 }
Esempio n. 3
0
 private void Init()
 {
     JsonRpcRoot.GetAsync(RpcRoot.OfficialServerHost, RpcRoot.OfficialServerPort, RpcRoot.GetControllerName <INTMinerWalletController>(), nameof(INTMinerWalletController.NTMinerWallets), null, (DataResponse <List <NTMinerWalletData> > response, Exception e) => {
         if (response.IsSuccess() && response.Data != null && response.Data.Count != 0)
         {
             var ethWallets = response.Data.Where(a => "ETH".Equals(a.CoinCode, StringComparison.OrdinalIgnoreCase)).ToArray();
             if (ethWallets.Length != 0)
             {
                 _ethWallets.Clear();
                 _ethWallets.AddRange(ethWallets.Select(a => a.Wallet));
             }
         }
     });
 }
Esempio n. 4
0
 /// <summary>
 /// 本机网络调用
 /// </summary>
 public void GetWsDaemonStateAsync(Action <WsClientState, Exception> callback)
 {
     JsonRpcRoot.GetAsync(NTKeyword.Localhost, NTKeyword.NTMinerDaemonPort, _controllerName, nameof(INTMinerDaemonController.GetWsDaemonState), null, callback, timeountMilliseconds: 3000);
 }
 public void GetLocalMessagesAsync(string clientIp, long afterTime, Action <List <LocalMessageDto>, Exception> callback)
 {
     JsonRpcRoot.GetAsync(clientIp, NTKeyword.MinerClientPort, _controllerName, nameof(IMinerClientController.GetLocalMessages), new Dictionary <string, string> {
         ["afterTime"] = afterTime.ToString()
     }, callback, timeountMilliseconds: 3000);
 }
 public void WsGetSpeedAsync(Action <SpeedDto, Exception> callback)
 {
     JsonRpcRoot.GetAsync(NTKeyword.Localhost, NTKeyword.MinerClientPort, _controllerName, nameof(IMinerClientController.WsGetSpeed), null, callback, timeountMilliseconds: 3000);
 }
 public void GetSpeedAsync(IMinerData client, Action <SpeedDto, Exception> callback)
 {
     JsonRpcRoot.GetAsync(client.GetLocalIp(), NTKeyword.MinerClientPort, _controllerName, nameof(IMinerClientController.GetSpeed), null, callback, timeountMilliseconds: 3000);
 }