Esempio n. 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));
        }
        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);
        }
Esempio n. 3
0
 public Task <SolutionKey[]> CheckRevelationAsync(string channelId, PuzzleSolver.ClientRevelation revelation)
 {
     return(SendAsync <SolutionKey[]>(HttpMethod.Post, revelation, $"clientschannels/{cycleId}/{channelId}/checkrevelation"));
 }
Esempio n. 4
0
 public SolutionKey[] CheckRevelation(string channelId, PuzzleSolver.ClientRevelation revelation)
 {
     return(CheckRevelationAsync(channelId, revelation).GetAwaiter().GetResult());
 }
Esempio n. 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);
        }
Esempio n. 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));
 }