예제 #1
0
        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));
        }
예제 #2
0
 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));
     }
 }