コード例 #1
0
        public ActionResult SignIn(string playerName)
        {
            //ViewBag.Page = "Home";
            GameController gameApiController = new GameController();
            Player player = gameApiController.SignIn(playerName);

            SessionManager.Instance.PlayerName = player.PlayerName;
            SessionManager.Instance.PlayerId =  player.PlayerId;
            SessionManager.Instance.IsPlayerLoggedIn = true;

            return RedirectToAction("Index");
        }
コード例 #2
0
        public ActionResult PlayGame(int matchId, string playerName)
        {
            if (!SessionManager.Instance.IsPlayerLoggedIn || SessionManager.Instance.PlayerName != playerName)
            {
                GameController gameApiController = new GameController();
                Player player = gameApiController.SignIn(playerName);
                SessionManager.Instance.PlayerName = playerName;
                SessionManager.Instance.PlayerId = player.PlayerId;
                SessionManager.Instance.IsPlayerLoggedIn = true;
            }

            SessionManager.Instance.MatchId = matchId;

            return View();
        }