コード例 #1
0
        public override void Update()
        {
            base.Update();

            /* If queue is empty take easy way out */
            if (NotificationQueue.Count == 0)
            {
                return;
            }

            /* Only Check Every X Updates and not every. */
            updateCount++;

            if (updateCount < SKIPPED_UPDATES)
            {
                return;
            }

            updateCount = 0;

            try {
                foreach (EntityIdCooldownKey cooldownKey in NotificationQueue.ToList())
                {
                    if (CooldownManagerNotificationQueue.CheckCooldown(cooldownKey, NOTIFICATION_COOLDOWN_COMMAND, out _))
                    {
                        long identityId = cooldownKey.EntityId;

                        NotifyPlayer(identityId);

                        NotificationQueue.Remove(cooldownKey);
                    }
                }
            } catch (Exception e) {
                Log.Error(e, "Error on Update!");
            }
        }