Beispiel #1
0
        protected override void Initialize(HttpControllerContext controllerContext)
        {
            base.Initialize(controllerContext);

            if (User == null)
            {
                return;
            }

            var windowsIdentity = User.Identity as WindowsIdentity;

            if (windowsIdentity != null)
            {
                _gameDataProvider.InitializeSession(User.Identity.Name);
                return;
            }
            var claimsIdentity = User.Identity as ClaimsIdentity;

            if (claimsIdentity != null)
            {
                _gameDataProvider.InitializeGameContext(Guid.Parse(claimsIdentity.FindFirst("gameSession").Value));
            }
        }
Beispiel #2
0
 /// <summary>Called before the action method is invoked.</summary>
 /// <param name="filterContext">Information about the current request and action.</param>
 protected override void OnActionExecuting(ActionExecutingContext filterContext)
 {
     _gameDataProvider.InitializeSession(User.Identity.Name);
 }
Beispiel #3
0
 protected override void Initialize(HttpControllerContext controllerContext)
 {
     base.Initialize(controllerContext);
     _gameDataProvider.InitializeSession(User.Identity.Name);
 }