public async Task <ActionResult> JoinTourney(string id, [FromBody] string userAddress) { if (await SEModule.JoinTourney(id, userAddress)) { return(Ok("User joined.")); } else { return(Ok("User could not join because Tournament has reach max capacity or user has already joined.")); } }
public async Task <ActionResult> GetTourney(string id) { var tourney = await SEModule.GetTourney(id); if (tourney != null) { return(Ok(tourney)); } else { return(NotFound()); } }
public async Task <ActionResult> CreateNewTourney(TourneyCreationData d) { // TODO refarctor authentification if (await CheckAuthentification()) { var tourneyId = await SEModule.CreateTourney(d); return(Ok(tourneyId)); } else { return(Forbid("Missing or wrong user certification")); } }
public async Task <ActionResult> PutStartTourney(string id) { if (await CheckAuthentification()) { if (await SEModule.StartTourney(id)) { return(Ok("Tournament Started")); } else { return(NotFound("Tournament ID not found")); } } return(Forbid("Missing or wrong user certification")); }
public async Task <ActionResult> PutResolveMatchup(string id, [FromBody] ResolveData resolveData) { if (await CheckAuthentification()) { if (await SEModule.ResolveMatchup(id, resolveData)) { return(Ok("MatchUp Resolved")); } else { return(Ok("MatchUp could not be resolved")); } } return(Forbid("Missing or wrong user certification")); }