public IHttpActionResult GetOrder([FromBody] GameRoleDTO grDto) { var userManager = new UserManager(); var ugsManager = new UserGameStorageManager(); var user = userManager.GetUser(grDto.SsoId); var order = ugsManager.GetUserGameStorage(user.ID).Order; return(Ok(order)); }
public IHttpActionResult LeaveGame(string sessionToken) { try { var userSession = _SessionManager.GetSession(sessionToken); var userID = userSession.UId; var currentUserGameStore = _UserGameStoreManager.GetUserGameStorage(userID); var gameSession = _GameSessionManager.GetGameSession(currentUserGameStore.GId); --gameSession.PlayerCount; _GameSessionManager.UpdateGameSession(gameSession); _UserGameStoreManager.DeleteGameUser(userID); return(Ok()); } catch (Exception e) { return(Content(HttpStatusCode.Conflict, e.Message)); } }