示例#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);
 }