Ejemplo n.º 1
0
        public void StartCooldown(VoteManager voteManager, IPlugin plugin, ITaskScheduler taskScheduler)
        {
            InCooldown    = true;
            _cooldownTask = taskScheduler.ScheduleTaskPeriodically(plugin, async() =>
            {
                if (--Cooldown > 0)
                {
                    return;
                }

                await voteManager.ReleaseVote(this);
                taskScheduler.CancelTask(_cooldownTask);
            }, "CooldownVote" + Name, TimeSpan.FromSeconds(1));
        }
Ejemplo n.º 2
0
 public CallVotePlugin(IDependencyContainer container, ITaskScheduler taskScheduler, IUserManager userManager) : base("CallVote", container)
 {
     _userManager = userManager;
     VoteManager  = new VoteManager(this, taskScheduler);
 }