コード例 #1
0
        public JsonResult SleepDachi()
        {
            Dachi MyDachi = SessionCheck();

            MyDachi.Sleep();
            HttpContext.Session.SetObjectAsJson("MyDachi", MyDachi);
            return(Json(MyDachi));
        }
コード例 #2
0
        public IActionResult Sleep()
        {
            Dachi newDachi = HttpContext.Session.GetObjectFromJson <Dachi>("Dachi");

            newDachi.Sleep();
            HttpContext.Session.SetObjectAsJson("Dachi", newDachi);
            string LocalVariable = HttpContext.Session.GetString("Dachi.Name");

            ViewBag.Name   = LocalVariable;
            ViewBag.Result = $"Your Diondachi {LocalVariable} is taking a nap";
            ViewBag.Emote  = 5;
            return(View("Dachi", newDachi));
        }