Пример #1
0
        public IActionResult CheckRevelation(int cycleId, string channelId, [FromBody] PuzzleSolver.ClientRevelation revelation)
        {
            var session   = GetSolverServerSession(cycleId, channelId, CyclePhase.PaymentPhase);
            var solutions = session.CheckRevelation(revelation);

            Repository.Save(cycleId, session);
            return(Json(solutions));
        }
Пример #2
0
        public SolutionKey[] CheckRevelation(
            [ModelBinder(BinderType = typeof(TumblerParametersModelBinder))]
            ClassicTumblerParameters tumblerId,
            int cycleId, string channelId, [FromBody] PuzzleSolver.ClientRevelation revelation)
        {
            if (tumblerId == null)
            {
                throw new ArgumentNullException("tumblerId");
            }
            var session   = GetSolverServerSession(cycleId, channelId, CyclePhase.PaymentPhase);
            var solutions = session.CheckRevelation(revelation);

            Repository.Save(cycleId, session);
            return(solutions);
        }
Пример #3
0
 public Task <SolutionKey[]> CheckRevelationAsync(string channelId, PuzzleSolver.ClientRevelation revelation)
 {
     return(SendAsync <SolutionKey[]>(HttpMethod.Post, revelation, $"clientschannels/{cycleId}/{channelId}/checkrevelation"));
 }
Пример #4
0
 public SolutionKey[] CheckRevelation(string channelId, PuzzleSolver.ClientRevelation revelation)
 {
     return(CheckRevelationAsync(channelId, revelation).GetAwaiter().GetResult());
 }
Пример #5
0
        public async Task <SolutionKey[]> CheckRevelationAsync(uint160 channelId, PuzzleSolver.ClientRevelation revelation)
        {
            var result = await SendAsync <ArrayWrapper <SolutionKey> >(HttpMethod.Post, revelation, $"clientschannels/{cycleId}/{channelId}/checkrevelation").ConfigureAwait(false);

            return(result.Elements);
        }
Пример #6
0
 public Task <SolutionKey[]> CheckRevelationAsync(int cycleId, string channelId, PuzzleSolver.ClientRevelation revelation)
 {
     return(SendAsync <SolutionKey[]>(HttpMethod.Post, revelation, "api/v1/tumblers/0/clientschannels/{0}/{1}/checkrevelation", cycleId, channelId));
 }