public ActionResult FinishedGames() { Player player = GetLoggedInPlayer(HttpContext); player.LoadGames(false, true); return(PlayerResponseData.CreateResponseData(player, "Finished Games Fetched Successfuly").GetActionResult()); }
public ActionResult ActiveGames() { Player player = GetLoggedInPlayer(HttpContext); player.LoadGames(true, false); player.GetRank(); return(PlayerResponseData.CreateResponseData(player, "Active Games Fetched Successfuly").GetActionResult()); }
public ActionResult AllData() { Player player = GetLoggedInPlayer(HttpContext); player.GetUsername(); player.LoadGames(true, true); return(PlayerResponseData.CreateResponseData(player, "All Data Loaded Successfuly").GetActionResult()); }
public ActionResult Register([FromBody] JObject data) { string username = data["username"].ToString(); string password = data["password"].ToString(); PlayerValidationResult result = PlayerManager.RegisterPlayer(username, password); string jwtToken = null; if (result.validationStatus == ValidationStatus.Valid) { jwtToken = GenerateJSONWebToken(result.player.ID, result.player.GetUsername()); } return(PlayerResponseData.CreateResponseData(result, "Registration successful", jwtToken).GetActionResult()); }