Beispiel #1
0
        /// <summary>
        /// Executes the Stick message.
        /// </summary>
        /// <param name="message">The message.</param>
        private void Execute(StickMessage message)
        {
            if (message.ErrorMessage != null)
            {
                Log(LogLevel.Warning, message.ErrorMessage);
                return;
            }

            var clientEntry = Repository.Client.GetClientInfo(message.SenderClientId);

            Log(Repository.Settings.Control.Stick,
                string.Format("Client '{1}'(id:{2}) used {0}.", Repository.Settings.Control.Stick.Command,
                              clientEntry.Nickname, clientEntry.DatabaseId));

            foreach (uint clientDatabaseId in message.ClientDatabaseIds)
            {
                Repository.Channel.AddStickyClients(clientDatabaseId, message.ChannelId, message.StickTime);
                Log(Repository.Settings.Control.Stick, string.Format("Client (id:{0}) got sticked.", clientDatabaseId));
            }
        }
        /// <summary>
        /// Executes the Stick message.
        /// </summary>
        /// <param name="message">The message.</param>
        private void Execute(StickMessage message)
        {
            if (message.ErrorMessage != null)
            {
                Log(LogLevel.Warning, message.ErrorMessage);
                return;
            }

            var clientEntry = Repository.Client.GetClientInfo(message.SenderClientId);
            Log(Repository.Settings.Control.Stick,
                string.Format("Client '{1}'(id:{2}) used {0}.", Repository.Settings.Control.Stick.Command,
                              clientEntry.Nickname, clientEntry.DatabaseId));

            foreach (uint clientDatabaseId in message.ClientDatabaseIds)
            {
                Repository.Channel.AddStickyClients(clientDatabaseId, message.ChannelId, message.StickTime);
                Log(Repository.Settings.Control.Stick, string.Format("Client (id:{0}) got sticked.", clientDatabaseId));
            }
        }