public ActionResult <bool> GameRequestSpecificUser([FromBody] ServerLogic.Player id) { string token = GetToken(); if (token == null || token == string.Empty || this.service.SaveGameRequest(token, id)) { return(BadRequest(400)); } this.rep.SetAllRegisteredPlayer(this.service.GetRegisteredPlayer()); this.UpdateData(); return(Ok(200)); }
public ActionResult <GameInformation> StartGame([FromBody] ServerLogic.Player player) { string token = GetToken(); GameInformation gameInfo = this.service.StartGame(player, token); if (token == null || token == string.Empty || gameInfo == null) { return(BadRequest(400)); } this.rep.AddHistory(this.service.GetHistory()); this.rep.SetAllRegisteredPlayer(this.service.GetRegisteredPlayer()); this.UpdateData(); return(Ok(gameInfo)); }