Beispiel #1
0
        public ActionResult Create(DTOGame currentGame)
        {
            if (ModelState.IsValid)
            {
                db.Games.Add(currentGame.GameRound);
                db.SaveChanges();

                currentGame.CurrentPlayer.Game_Id = currentGame.GameRound.ID;
                db.Players.Add(currentGame.CurrentPlayer);
                db.SaveChanges();

                //string publicId = currentGame.GameRound.PublicId;
                DTOGameSession session = new DTOGameSession(currentGame);

                return(View("~/Views/GameSession/index.cshtml", session));
            }
            else
            {
                return(new HttpStatusCodeResult(404));
            }
        }
 /// <summary>
 /// Creates an Event on the connected server
 /// </summary>
 /// <param name="eventName">The name that the event will be given</param>
 /// <param name="gameSession">The GameSession that the event occurred in</param>
 /// <returns>Returns the created Event</returns>
 public DTOEvent CreateEvent(string eventName, DTOGameSession gameSession)
 {
     return(OpenChannelAndPerform(svc => svc.CreateEvent(eventName, gameSession.Id)));
 }