예제 #1
0
        public void SendEffect(AbstractEffect effect)
        {
            int duration = effect.Duration > 0 ? effect.Duration : Config.GetEffectDuration();

            duration = (int)Math.Round(duration * effect.GetMultiplier());

            var msg = new MessageEffect()
            {
                Word     = effect.Word,
                Duration = duration,
                Voter    = effect.GetVoter(),
                Seed     = RandomHandler.Next(9999999)
            };

            socket?.Send(JsonConvert.SerializeObject(msg));
        }
예제 #2
0
        public void SendEffect(AbstractEffect effect, int _duration = -1)
        {
            int duration = effect.Duration > 0 ? effect.Duration : Config.GetEffectDuration();

            if (_duration != -1)
            {
                duration = _duration; // Always Override
            }

            var msg = new MessageEffect()
            {
                Word     = effect.Word,
                Duration = duration,
                Voter    = effect.GetVoter(),
                Seed     = RandomHandler.Next(9999999)
            };

            socket?.Send(JsonConvert.SerializeObject(msg));
        }