Пример #1
0
        public void RegisterNewSession(SessionWrapper sessionWrapper)
        {
            var userInfo = sessionWrapper.GetUserInfo(context);

            if (isProvablyFair)
            {
                userInfo.rng.CheckOldSession();
            }

            if (sessionWrapper.UserId > 0)
            {
                reportTracker.Register(context.Game.IdLong, sessionWrapper.CasinoId, sessionWrapper.UserId);
            }

            sessionWrapper.SetUserActivityTimeout(context.Game.Id, userTimeoutInSeconds);

            if (userInfo.features.ContainsKey("time_limit"))
            {
                var startTime = userInfo.features.Evaluate <long>("time_limit_date").FromJavascriptTime();
                var timeLimit = userInfo.features.Evaluate <int>("time_limit");
                timeLimit = sessionWrapper.SetUserTimeLimit(context.Game.Id, startTime, timeLimit, userInfo.features.Evaluate("time_limit_popup", "time_limit_popup"));
                context.sendSystemInternal(sessionWrapper.SessionId, SessionMessageTypeEnum.TimeLimit, new Dictionary <string, object> {
                    { "timeLimit", Math.Max(0, timeLimit) }
                });;
            }
        }
Пример #2
0
        internal void UnregisterSession(SessionWrapper session)
        {
            mediaHelper?.UnregisterSession(session.SessionId);
            var userInfo = session.GetUserInfo(this);

            if (userInfo != null)
            {
                reportTracker.Clear(game.IdLong, userInfo.UserId);
            }
        }
Пример #3
0
        public SessionStreamWrapper(SessionWrapper session, string streamId)
        {
            this.session  = session;
            this.streamId = streamId;
            RegisterUserActivity();
            var sessionThread = new Thread(SessionProc)
            {
                Name = "Session {0}/{1}".FormatString(session.SessionId, streamId), Priority = ThreadPriority.BelowNormal
            };

            sessionThread.Start();
        }
Пример #4
0
 protected bool Equals(SessionWrapper other)
 {
     return(SessionId == other.SessionId);
 }
Пример #5
0
 internal void RegisterSession(SessionWrapper session)
 {
     mediaHelper?.RegisterSession(session.SessionId);
     accountingHelper?.RegisterSession(session.SessionId);
 }