public ActionResult Index(string key)
        {
            key = string.IsNullOrEmpty(key) ? string.Empty : key;

            var    model  = new RegisterModel();
            Player player = null;

            try
            {
                player     = _playerService.Find(key);
                model.Key  = player.Key;
                model.Name = player.Name;
                model.Init(player.Cells.ToList());
            }
            catch (PlayerNotFoundException exception)
            {
                model.Init(new List <Point>());
            }

            if (player == null && Player.KeyRegex.Match(key).Success)
            {
                ModelState.AddModelError(string.Empty, "Player with key: " + key + " not found.");
            }

            return(View(model));
        }
Exemple #2
0
        public ActionResult Register()
        {
            RegisterModel model = new RegisterModel();

            model.Init(GetSupportedLocales(), GetSupportedTimeZones(), _membershipService.MinPasswordLength);
            return(View(model));
        }