Exemple #1
0
 public CreateGameHandler(ClientContext clientContext, IBlazeNotificationHandler notificationHandler, IGameManager gameManager, IUserSessionManager userSessionManager)
 {
     _notificationHandler = notificationHandler;
     _clientContext       = clientContext;
     _gameManager         = gameManager;
     _userSessionManager  = userSessionManager;
 }
 public LoginHandler(Skateboard3Context context, ClientContext clientContext, IBlazeNotificationHandler notificationHandler, IPs3TicketDecoder ticketDecoder, IUserSessionManager userSessionManager)
 {
     _context             = context;
     _clientContext       = clientContext;
     _notificationHandler = notificationHandler;
     _ticketDecoder       = ticketDecoder;
     _userSessionManager  = userSessionManager;
 }
 public StartMatchmakingHandler(ClientContext clientContext, Skateboard3Context context, IOptions <BlazeConfig> blazeConfig, IBlazeNotificationHandler notificationHandler, IGameManager gameManager, IUserSessionManager userSessionManager)
 {
     _notificationHandler = notificationHandler;
     _context             = context;
     _blazeConfig         = blazeConfig.Value;
     _gameManager         = gameManager;
     _userSessionManager  = userSessionManager;
     _clientContext       = clientContext;
 }
 public ConnectController(
     ILogFactory logFactory,
     IUserSessionManager userSessionManager,
     IDiscoveryCache discoveryCache
     )
 {
     _log = logFactory.CreateLog(this);
     _userSessionManager = userSessionManager;
     _discoveryCache     = discoveryCache;
 }
 public CallbackController(
     IUserSessionManager userSessionManager,
     ILogFactory logFactory,
     IClientSessionsClient clientSessionsClient,
     IHttpClientFactory httpClientFactory,
     IDiscoveryCache discoveryCache,
     IroncladSettings ironcladSettings,
     ILykkeSessionManager lykkeSessionManager)
 {
     _clientSessionsClient = clientSessionsClient;
     _userSessionManager   = userSessionManager;
     _log = logFactory.CreateLog(this);
     _httpClientFactory   = httpClientFactory;
     _discoveryCache      = discoveryCache;
     _ironcladSettings    = ironcladSettings;
     _lykkeSessionManager = lykkeSessionManager;
 }
 public ResourcesController(
     IUserSessionManager userSessionManager,
     IUserSessionRepository userSessionRepository,
     IClientAccountClient clientAccountClient,
     IHttpClientFactory httpClientFactory,
     IDiscoveryCache discoveryCache,
     IClientSessionsClient clientSessionsClient,
     IroncladSettings ironcladSettings,
     LifetimeSettings lifetimeSettings,
     ILykkeSessionManager lykkeSessionManager)
 {
     _ironcladSettings      = ironcladSettings;
     _lifetimeSettings      = lifetimeSettings;
     _lykkeSessionManager   = lykkeSessionManager;
     _userSessionRepository = userSessionRepository;
     _clientAccountClient   = clientAccountClient;
     _userSessionManager    = userSessionManager;
     _httpClientFactory     = httpClientFactory;
     _discoveryCache        = discoveryCache;
     _clientSessionsClient  = clientSessionsClient;
 }
Exemple #7
0
 public UseCaseService(IUserSessionManager userSessionManager)
 {
     _userSessionManager = userSessionManager;
 }
Exemple #8
0
 public RoleService(IUserSessionManager userSessionManager)
 {
     _userSessionManager = userSessionManager;
 }
Exemple #9
0
        protected virtual void InitializeSession(HttpContext httpContext)
        {
            string sessionID   = httpContext.Session.SessionID;
            Guid   sessionGuid = Guid.Empty;

            if (!Guid.TryParseExact(sessionID, "N", out sessionGuid))
            {
                Log.Error("Invalid session ID" + sessionGuid);
            }

            IUserSessionManager usManager = UserSession.CreateManager();
            UserSession         session   = usManager.Load(this.Service.ServiceData, sessionGuid);

            if (session != null && session.IPAddress != httpContext.Request.UserHostAddress)
            {
                Log.Error("Session hijack!");
            }

            if (session == null)
            {
                // TODO: Remove this in production
                string ipAddress = !httpContext.Request.UserHostAddress.Equals("::1") && !httpContext.Request.UserHostAddress.StartsWith("192.") ?
                                   httpContext.Request.UserHostAddress :
                                   "78.155.61.246";

                IIPCountryMapManager ipcmManager = IPCountryMap.CreateManager();
                IPCountryMap         countryMap  = ipcmManager.Load(ipAddress);

                Language language = countryMap.Country.Language != null ? countryMap.Country.Language : Language.CreateManager().Load("EN", LanguageIdentifier.TwoLetterIsoCode);

                session = new UserSession(-1,
                                          sessionGuid,
                                          this.Service.ServiceData.UserSessionType,
                                          this.Service.ServiceData,
                                          null,
                                          this.Domain,
                                          null,
                                          countryMap.Country,
                                          language,
                                          null,
                                          null,
                                          httpContext.Request.UserHostAddress,
                                          httpContext.Request.UserAgent,
                                          httpContext.Request.Url.ToString(),
                                          httpContext.Request.UrlReferrer != null ? httpContext.Request.UrlReferrer.ToString() : null,
                                          false,
                                          DateTime.Now.AddMinutes(20),
                                          DateTime.Now, DateTime.Now);

                // TODO: Make this dynamic
                if (!session.EntranceUrl.Contains("/thumbnail") &&
                    !session.EntranceUrl.EndsWith("/logo"))
                {
                    session.Insert();
                }

                //INFO: DO NOT DO ANYTHING WITH THIS LINE BELOW!!!
                httpContext.Session["someValue"] = "bla";
            }

            this._session = new WebUserSession(session);
        }
Exemple #10
0
 public PlayerSessionBinder(IUserSessionManager sessionManager)
 {
     this.sessionManager = sessionManager;
 }
Exemple #11
0
 public BusinessAccessService(IUserSessionManager userSessionManager)
 {
     _userSessionManager = userSessionManager;
 }
Exemple #12
0
 public NetworkInfoHandler(ClientContext clientContext, IUserSessionManager userSessionManager)
 {
     _clientContext      = clientContext;
     _userSessionManager = userSessionManager;
 }
 public LocationService(IMemoryCache memoryCache, IUserSessionManager userSessionManager)
 {
     _userSessionManager = userSessionManager;
 }
Exemple #14
0
 public SessionDataHandler(Skateboard3Context skateboard3Context, ClientContext clientContext, IUserSessionManager userSessionManager)
 {
     _skateboard3Context = skateboard3Context;
     _clientContext      = clientContext;
     _userSessionManager = userSessionManager;
 }
Exemple #15
0
 public OrganizationService(IUserSessionManager userSessionManager)
 {
     _userSessionManager = userSessionManager;
 }
Exemple #16
0
 public FileService(IWebHostEnvironment environment, IUserSessionManager userSessionManager)
 {
     _hostEnvironment    = environment;
     _userSessionManager = userSessionManager;
 }
 public UserController(ITechShopData data, IUserSessionManager userSessionManager) : base(data)
 {
     this.userManager = new ApplicationUserManager(
         new UserStore<User>(new TechShopDbContext()));
     this.userSessionManager = userSessionManager;
 }
 public UserController(ITechShopData data, IUserSessionManager userSessionManager) : base(data)
 {
     this.userManager = new ApplicationUserManager(
         new UserStore <User>(new TechShopDbContext()));
     this.userSessionManager = userSessionManager;
 }
Exemple #19
0
 public SessionsController(Skateboard3Context dbContext, IUserSessionManager userSessionManager)
 {
     _dbContext          = dbContext;
     _userSessionManager = userSessionManager; //TODO handle usersessionmanager depend better
 }
 public SystemConfigService(IUserSessionManager userSessionManager)
 {
     _userSessionManager = userSessionManager;
 }
Exemple #21
0
 public DbContextScopeFactory(IUserSessionManager sessionMgr, IRepositoryFactory factory)
 {
     _sessionManager = sessionMgr;
     _factory        = factory;
 }
 public PersonService(IUserSessionManager userSessionManager)
 {
     _userSessionManager = userSessionManager;
 }
Exemple #23
0
 public MenuService(IMemoryCache memoryCache, IUserSessionManager userSessionManager)
 {
     _memoryCache        = memoryCache;
     _userSessionManager = userSessionManager;
 }
 public ClientManager(IUserSessionManager userSessionManager)
 {
     _userSessionManager = userSessionManager;
 }
Exemple #25
0
 public ComboValService(IUserSessionManager userSessionManager)
 {
     _userSessionManager = userSessionManager;
 }
Exemple #26
0
        protected virtual void InitializeSession(HttpContext httpContext)
        {
            string sessionID   = httpContext.Session.SessionID;
            Guid   sessionGuid = Guid.Empty;

            if (!Guid.TryParseExact(sessionID, "N", out sessionGuid))
            {
                // TODO: log4net
                //if (Log.IsWarnEnabled)
                //  Log.Warn(new LogMessageBuilder(
                //    new LogErrorCode("paywall.web.core", "paywallhttpcontext", "initializesession"),
                //      "Invalid session ID", sessionGuid));

                throw new ArgumentException("MobiContext: Could not parse Session guid");
            }

            IUserSessionManager usManager = UserSession.CreateManager();
            UserSession         session   = usManager.Load(sessionGuid);

            if (session != null && session.IPAddress != httpContext.Request.UserHostAddress)
            {
                // TODO: Session hijack.. log
            }

            if (session == null)
            {
                IIPCountryMapManager ipcmManager = IPCountryMap.CreateManager();

                // TODO: Remove this in production
                string ipAddress = !httpContext.Request.UserHostAddress.Equals("::1") && !httpContext.Request.UserHostAddress.StartsWith("192.") ?
                                   httpContext.Request.UserHostAddress :
                                   "78.155.61.246";

                IPCountryMap countryMap = ipcmManager.Load(ipAddress);
                Language     language   = countryMap.Country.Language != null ? countryMap.Country.Language : Language.CreateManager().Load("EN", LanguageIdentifier.TwoLetterIsoCode);

                session = new UserSession(-1,
                                          sessionGuid,
                                          StatisticsApplication.GetDefaultUserSessionType(),
                                          null,     // service
                                          this.Runtime.ApplicationData,
                                          null,     // domain,
                                          null,     // user,
                                          countryMap.Country,
                                          language, // language
                                          null,     // mobileOperator
                                          null,     // trackingID,
                                          httpContext.Request.UserHostAddress,
                                          httpContext.Request.UserAgent,
                                          httpContext.Request.Url.ToString().Replace(" ", string.Empty),
                                          httpContext.Request.UrlReferrer != null ? httpContext.Request.UrlReferrer.ToString() : null,
                                          false,
                                          DateTime.Now.AddMinutes(20),
                                          DateTime.Now, DateTime.Now);

                session.Insert();

                //INFO: DO NOT DO ANYTHING WITH THIS LINE BELOW!!!
                httpContext.Session["someValue"] = "bla";
            }

            this._session = new StatisticsUserSession(session);
        }
 public AuthController(IUserSessionManager sessionManager, IPlayerAuthenticator auth)
 {
     this.sessionManager = sessionManager;
     this.auth           = auth;
 }
Exemple #28
0
 public EntityStateService(IUserSessionManager userSessionManager)
 {
     _userSessionManager = userSessionManager;
 }
 public AccessGroupService(IUserSessionManager userSessionManager)
 {
     _userSessionManager = userSessionManager;
 }