コード例 #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);
            }
        }