Ejemplo n.º 1
0
 public void UpdateClientsAsync(string propertyName, Dictionary<string, object> values, Action<ResponseBase, Exception> callback) {
     UpdateClientsRequest request = new UpdateClientsRequest {
         PropertyName = propertyName,
         Values = values
     };
     JsonRpcRoot.SignPostAsync(RpcRoot.OfficialServerHost, RpcRoot.OfficialServerPort, _controllerName, nameof(IClientDataController.UpdateClients), data: request, callback);
 }
Ejemplo n.º 2
0
        public void GetLatestSnapshotsAsync(int limit, Action <GetCoinSnapshotsResponse, Exception> callback)
        {
            GetCoinSnapshotsRequest request = new GetCoinSnapshotsRequest {
                Limit = limit
            };

            JsonRpcRoot.SignPostAsync(RpcRoot.OfficialServerHost, RpcRoot.OfficialServerPort, _controllerName, nameof(ICoinSnapshotController.LatestSnapshots), data: request, callback);
        }
Ejemplo n.º 3
0
        public void RemoveClientsAsync(List <string> objectIds, Action <ResponseBase, Exception> callback)
        {
            var request = new MinerIdsRequest {
                ObjectIds = objectIds
            };

            JsonRpcRoot.SignPostAsync(RpcRoot.OfficialServerHost, RpcRoot.OfficialServerPort, _controllerName, nameof(IClientDataController.RemoveClients), data: request, callback);
        }
Ejemplo n.º 4
0
        public void RemoveMineWorkAsync(Guid id, Action <ResponseBase, Exception> callback)
        {
            DataRequest <Guid> request = new DataRequest <Guid> {
                Data = id
            };

            JsonRpcRoot.SignPostAsync(RpcRoot.OfficialServerHost, RpcRoot.OfficialServerPort, _controllerName, nameof(IUserMineWorkController.RemoveMineWork), data: request, callback);
        }
Ejemplo n.º 5
0
 public void UpdateClientAsync(string objectId, string propertyName, object value, Action<ResponseBase, Exception> callback) {
     UpdateClientRequest request = new UpdateClientRequest {
         ObjectId = objectId,
         PropertyName = propertyName,
         Value = value
     };
     JsonRpcRoot.SignPostAsync(RpcRoot.OfficialServerHost, RpcRoot.OfficialServerPort, _controllerName, nameof(IClientDataController.UpdateClient), data: request, callback);
 }
Ejemplo n.º 6
0
        public void AddOrUpdateOverClockDataAsync(OverClockData entity, Action <ResponseBase, Exception> callback)
        {
            DataRequest <OverClockData> request = new DataRequest <OverClockData>()
            {
                Data = entity
            };

            JsonRpcRoot.SignPostAsync(RpcRoot.OfficialServerHost, RpcRoot.OfficialServerPort, _controllerName, nameof(IOverClockDataController.AddOrUpdateOverClockData), data: request, callback);
        }
Ejemplo n.º 7
0
        public void MarkDeleteServerMessageAsync(Guid id, Action <ResponseBase, Exception> callback)
        {
            DataRequest <Guid> request = new DataRequest <Guid>()
            {
                Data = id
            };

            JsonRpcRoot.SignPostAsync(RpcRoot.OfficialServerHost, RpcRoot.OfficialServerPort, _controllerName, nameof(IServerMessageController.MarkDeleteServerMessage), data: request, callback);
        }
        public void RemoveKernelOutputKeyword(Guid id, Action <ResponseBase, Exception> callback)
        {
            DataRequest <Guid> request = new DataRequest <Guid>()
            {
                Data = id
            };

            JsonRpcRoot.SignPostAsync(RpcRoot.OfficialServerHost, RpcRoot.OfficialServerPort, _controllerName, nameof(IKernelOutputKeywordController.RemoveKernelOutputKeyword), data: request, callback);
        }
        public void AddOrUpdateKernelOutputKeywordAsync(KernelOutputKeywordData entity, Action <ResponseBase, Exception> callback)
        {
            DataRequest <KernelOutputKeywordData> request = new DataRequest <KernelOutputKeywordData>()
            {
                Data = entity
            };

            JsonRpcRoot.SignPostAsync(RpcRoot.OfficialServerHost, RpcRoot.OfficialServerPort, _controllerName, nameof(IKernelOutputKeywordController.AddOrUpdateKernelOutputKeyword), data: request, callback);
        }
Ejemplo n.º 10
0
        public void AddOrUpdateMinerGroupAsync(MinerGroupData entity, Action <ResponseBase, Exception> callback)
        {
            entity.ModifiedOn = DateTime.Now;
            DataRequest <MinerGroupData> request = new DataRequest <MinerGroupData> {
                Data = entity
            };

            JsonRpcRoot.SignPostAsync(RpcRoot.OfficialServerHost, RpcRoot.OfficialServerPort, _controllerName, nameof(IUserMinerGroupController.AddOrUpdateMinerGroup), data: request, callback);
        }
Ejemplo n.º 11
0
        public void GetLocalJsonAsync(Guid workId, Action <DataResponse <string>, Exception> callback)
        {
            DataRequest <Guid> request = new DataRequest <Guid>()
            {
                Data = workId
            };

            JsonRpcRoot.SignPostAsync(RpcRoot.OfficialServerHost, RpcRoot.OfficialServerPort, _controllerName, nameof(IUserMineWorkController.GetLocalJson), data: request, callback);
        }
Ejemplo n.º 12
0
        // ReSharper disable once InconsistentNaming
        public void AddOrUpdateNTMinerFileAsync(NTMinerFileData entity, Action <ResponseBase, Exception> callback)
        {
            DataRequest <NTMinerFileData> request = new DataRequest <NTMinerFileData>()
            {
                Data = entity
            };

            JsonRpcRoot.SignPostAsync(RpcRoot.OfficialServerHost, RpcRoot.OfficialServerPort, _controllerName, nameof(IFileUrlController.AddOrUpdateNTMinerFile), data: request, callback);
        }
Ejemplo n.º 13
0
        public void SetAppSettingAsync(AppSettingData entity, Action <ResponseBase, Exception> callback)
        {
            DataRequest <AppSettingData> request = new DataRequest <AppSettingData>()
            {
                Data = entity
            };

            JsonRpcRoot.SignPostAsync(RpcRoot.OfficialServerHost, RpcRoot.OfficialServerPort, _controllerName, nameof(IAppSettingController.SetAppSetting), data: request, callback);
        }
Ejemplo n.º 14
0
        public void GetWorkJsonAsync(Guid workId, Guid clientId, Action <GetWorkJsonResponse, Exception> callback)
        {
            GetWorkJsonRequest request = new GetWorkJsonRequest()
            {
                WorkId   = workId,
                ClientId = clientId
            };

            JsonRpcRoot.SignPostAsync(RpcRoot.OfficialServerHost, RpcRoot.OfficialServerPort, _controllerName, nameof(IUserMineWorkController.GetWorkJson), data: request, callback);
        }
Ejemplo n.º 15
0
        public void ExportMineWorkAsync(Guid workId, string localJson, string serverJson, Action <ResponseBase, Exception> callback)
        {
            ExportMineWorkRequest request = new ExportMineWorkRequest {
                MineWorkId = workId,
                LocalJson  = localJson,
                ServerJson = serverJson
            };

            JsonRpcRoot.SignPostAsync(RpcRoot.OfficialServerHost, RpcRoot.OfficialServerPort, _controllerName, nameof(IUserMineWorkController.ExportMineWork), data: request, callback);
        }
Ejemplo n.º 16
0
        public void SaveCalcConfigsAsync(List <CalcConfigData> configs, Action <ResponseBase, Exception> callback)
        {
            if (configs == null || configs.Count == 0)
            {
                return;
            }
            SaveCalcConfigsRequest request = new SaveCalcConfigsRequest {
                Data = configs
            };

            JsonRpcRoot.SignPostAsync(RpcRoot.OfficialServerHost, RpcRoot.OfficialServerPort, _controllerName, nameof(ICalcConfigController.SaveCalcConfigs), data: request, callback);
        }
Ejemplo n.º 17
0
 public void QueryUsersAsync(QueryUsersRequest request, Action <QueryUsersResponse, Exception> callback)
 {
     JsonRpcRoot.SignPostAsync(RpcRoot.OfficialServerHost, RpcRoot.OfficialServerPort, _controllerName, nameof(IUserController.QueryUsers), data: request, callback: (QueryUsersResponse response, Exception e) => {
         if (response != null && response.Data != null && response.Data.Count != 0)
         {
             foreach (var user in response.Data)
             {
                 user.Password   = Cryptography.QuickUtil.TextDecrypt(Convert.FromBase64String(user.Password), RpcRoot.RpcUser.Password);
                 user.PrivateKey = Cryptography.QuickUtil.TextDecrypt(Convert.FromBase64String(user.PrivateKey), RpcRoot.RpcUser.Password);
             }
         }
         callback?.Invoke(response, e);
     }, timeountMilliseconds: 5000);
 }
Ejemplo n.º 18
0
        public void GetMineWorksAsync(Action <DataResponse <List <UserMineWorkData> >, Exception> callback)
        {
            object request = new object();

            JsonRpcRoot.SignPostAsync(RpcRoot.OfficialServerHost, RpcRoot.OfficialServerPort, _controllerName, nameof(IUserMineWorkController.MineWorks), data: request, callback, timeountMilliseconds: 5000);
        }
Ejemplo n.º 19
0
 public void GetMinerGroupsAsync(Action <DataResponse <List <UserMinerGroupData> >, Exception> callback)
 {
     JsonRpcRoot.SignPostAsync(RpcRoot.OfficialServerHost, RpcRoot.OfficialServerPort, _controllerName, nameof(IUserMinerGroupController.MinerGroups), data: new object(), callback, timeountMilliseconds: 5000);
 }
Ejemplo n.º 20
0
 public void ChangePasswordAsync(ChangePasswordRequest request, Action <ResponseBase, Exception> callback)
 {
     JsonRpcRoot.SignPostAsync(RpcRoot.OfficialServerHost, RpcRoot.OfficialServerPort, _controllerName, nameof(IUserController.ChangePassword), request, callback);
 }
Ejemplo n.º 21
0
 public void UpdateUserAsync(UserUpdateData data, Action <ResponseBase, Exception> callback)
 {
     JsonRpcRoot.SignPostAsync(RpcRoot.OfficialServerHost, RpcRoot.OfficialServerPort, _controllerName, nameof(IUserController.UpdateUser), data, callback);
 }
Ejemplo n.º 22
0
 public void RemoveAdminRoleAsync(string loginName, Action <ResponseBase, Exception> callback)
 {
     JsonRpcRoot.SignPostAsync(RpcRoot.OfficialServerHost, RpcRoot.OfficialServerPort, _controllerName, nameof(IUserController.RemoveAdminRole), new DataRequest <string> {
         Data = loginName
     }, callback);
 }
Ejemplo n.º 23
0
 public void RemoveNodeAsync(string address, Action <ResponseBase, Exception> callback)
 {
     JsonRpcRoot.SignPostAsync(RpcRoot.OfficialServerHost, RpcRoot.OfficialServerPort, _controllerName, nameof(IWsServerNodeController.RemoveNode), new DataRequest <string> {
         Data = address
     }, callback);
 }
Ejemplo n.º 24
0
 public void ReportNodeStateAsync(WsServerNodeState nodeState, Action <ResponseBase, Exception> callback)
 {
     JsonRpcRoot.SignPostAsync(RpcRoot.OfficialServerHost, RpcRoot.OfficialServerPort, _controllerName, nameof(IWsServerNodeController.ReportNodeState), nodeState, callback, timeountMilliseconds: 3000);
 }
Ejemplo n.º 25
0
 public void GetNodeAddressesAsync(Action <DataResponse <string[]>, Exception> callback)
 {
     JsonRpcRoot.SignPostAsync(RpcRoot.OfficialServerHost, RpcRoot.OfficialServerPort, _controllerName, nameof(IWsServerNodeController.NodeAddresses), new object(), callback);
 }
Ejemplo n.º 26
0
 public void GetServerStateAsync(Action <DataResponse <WebApiServerState>, Exception> callback)
 {
     JsonRpcRoot.SignPostAsync(RpcRoot.OfficialServerHost, RpcRoot.OfficialServerPort, _controllerName, nameof(IWebApiServerNodeController.GetServerState), new object(), callback);
 }
Ejemplo n.º 27
0
 public void GetGpuNamesAsync(Action <DataResponse <List <GpuName> >, Exception> callback)
 {
     JsonRpcRoot.SignPostAsync(RpcRoot.OfficialServerHost, RpcRoot.OfficialServerPort, _controllerName, nameof(IGpuNameController.GpuNames), new object(), callback, timeountMilliseconds: 5 * 1000);
 }
Ejemplo n.º 28
0
 public void RemoveGpuNameAsync(GpuName gpuName, Action <ResponseBase, Exception> callback)
 {
     JsonRpcRoot.SignPostAsync(RpcRoot.OfficialServerHost, RpcRoot.OfficialServerPort, _controllerName, nameof(IGpuNameController.RemoveGpuName), new DataRequest <GpuName> {
         Data = gpuName
     }, callback, timeountMilliseconds: 5 * 1000);
 }
Ejemplo n.º 29
0
 // 去调ClientDataBinaryService的方法了所以这个没人调了
 public void QueryClientsAsync(QueryClientsRequest query, Action<QueryClientsResponse, Exception> callback) {
     JsonRpcRoot.SignPostAsync(RpcRoot.OfficialServerHost, RpcRoot.OfficialServerPort, _controllerName, nameof(IClientDataController.QueryClients), data: query, callback);
 }
Ejemplo n.º 30
0
 public void QueryGpuNameCountsAsync(QueryGpuNameCountsRequest request, Action <QueryGpuNameCountsResponse, Exception> callback)
 {
     JsonRpcRoot.SignPostAsync(RpcRoot.OfficialServerHost, RpcRoot.OfficialServerPort, _controllerName, nameof(IGpuNameController.QueryGpuNameCounts), request, callback, timeountMilliseconds: 5 * 1000);
 }