public static bool IsLockedOut(PlayerMobile pm, DungeonID id, out TimeSpan t)
        {
            t = TimeSpan.Zero;

            if (pm == null || pm.Deleted || id == DungeonID.None)
            {
                return(false);
            }

            var s = false;

            var state = Lockouts.GetValue(pm);

            if (state != null)
            {
                s = state.IsLockedOut(id, out t);

                if (state.IsEmpty)
                {
                    Lockouts.Remove(pm);
                }
            }

            return(s);
        }
        public void GetPlayRestrictions(ref Lockouts restrictions, bool reload)
        {
            if (!reload)
            {
                if (this.LastGameSessionInfo != null)
                {
                    restrictions.loaded           = true;
                    restrictions.sessionStartTime = this.LastGameSessionInfo.SessionStartTime;
                    return;
                }
                if (this.GameSessionRunningCount > 0)
                {
                    return;
                }
            }
            this.LastGameSessionInfo = null;
            AccountAPI gameSessionRunningCount = this;

            gameSessionRunningCount.GameSessionRunningCount = gameSessionRunningCount.GameSessionRunningCount + 1;
            GetGameSessionInfoRequest getGameSessionInfoRequest = new GetGameSessionInfoRequest();

            getGameSessionInfoRequest.SetEntityId(this.m_battleNet.GameAccountId);
            AccountAPI.GetGameSessionInfoRequestContext getGameSessionInfoRequestContext = new AccountAPI.GetGameSessionInfoRequestContext(this);
            this.m_rpcConnection.QueueRequest(this.m_accountService.Id, 34, getGameSessionInfoRequest, new RPCContextDelegate(getGameSessionInfoRequestContext.GetGameSessionInfoRequestContextCallback), 0);
        }
        public static void SetLockout(PlayerMobile pm, DungeonID id, TimeSpan t)
        {
            if (pm == null || pm.Deleted || id == DungeonID.None)
            {
                return;
            }

            var state = Lockouts.GetValue(pm);

            if (state == null)
            {
                if (t <= TimeSpan.Zero)
                {
                    return;
                }

                Lockouts[pm] = state = new LockoutState(pm);
            }

            state.SetLockout(id, t);

            if (state.IsEmpty)
            {
                Lockouts.Remove(pm);
            }
        }
Beispiel #4
0
        private static void CSLoad()
        {
            Maps.Import();
            Dungeons.Import();
            Lockouts.Import();

            Restore();

            DefragmentTimer.Start();
        }
Beispiel #5
0
        private static void CSSave()
        {
            IndexFile.Serialize(SaveIndex);

            Maps.Export();
            Dungeons.Export();
            Lockouts.Export();

            RestoreFile.Serialize(SaveRestore);
            RestoreFile.SetHidden(true);
        }
        public static TimeSpan GetLockout(PlayerMobile pm, DungeonID id)
        {
            if (pm == null || pm.Deleted || id == DungeonID.None)
            {
                return(TimeSpan.Zero);
            }

            var t = TimeSpan.Zero;

            var state = Lockouts.GetValue(pm);

            if (state != null)
            {
                t = state.GetLockout(id);

                if (state.IsEmpty)
                {
                    Lockouts.Remove(pm);
                }
            }

            return(t);
        }
 public void RemoveLockout(string Lockout)
 {
     Lockouts = Lockouts.Replace(Lockout, string.Empty);
     Dirty    = true;
 }
Beispiel #8
0
 public static void GetPlayRestrictions(ref Lockouts restrictions, bool reload)
 {
     BattleNet.s_impl.GetPlayRestrictions(ref restrictions, reload);
 }
Beispiel #9
0
 public void GetPlayRestrictions(ref Lockouts restrictions, bool reload)
 {
     this.Account.GetPlayRestrictions(ref restrictions, reload);
 }