示例#1
0
        public ActionResult Cancel(int id)
        {
            PlayerTask pt = PlayerTask.Load(id);

            pt.State = Task.TaskState.Completed;
            pt.Save();
            return(null);
        }
示例#2
0
 public ActionResult Modal_Task(int playerTaskId)
 {
     if (Player.CurrentPlayer == null)
     {
         return(Content(""));
     }
     return(View(PlayerTask.Load(playerTaskId)));
 }
示例#3
0
        public EmptyResult KillTask(int id)
        {
            PlayerTask pt = PlayerTask.Load(id);

            pt.Delete();

            return(null);
        }
示例#4
0
        public ActionResult Update(int playerTaskId, FormCollection form)
        {
            PlayerTask pt   = PlayerTask.Load(playerTaskId);
            TaskDetail task = pt.GetTask.GetTaskDetail();

            task.UpdateTask(pt, form);

            return(null);
        }
示例#5
0
        public JsonResult GetPlayerTaskStatus(int id)
        {
            PlayerTask task = PlayerTask.Load(id);

            if (task == null)
            {
                return(Json(new PlayerTask_JSON()
                {
                    id = 0
                }, JsonRequestBehavior.AllowGet));
            }

            return(Json(task.GetJSON, JsonRequestBehavior.AllowGet));
        }
示例#6
0
        public ActionResult ModalBody(int playerTaskId)
        {
            if (!Player.CurrentPlayerId.HasValue)
            {
                return(Content(""));
            }

            PlayerTask pt = PlayerTask.Load(playerTaskId);

            if (pt.playerId != Player.CurrentPlayerId)
            {
                return(Content("ERRRRRROR"));        // task doesn't match current player - cheating?
            }
            return(View(pt.Task.id, pt));            // name.cshtml
        }