Beispiel #1
0
        /// <summary>
        /// Executes the PunishMessage message.
        /// </summary>
        /// <param name="message">The message.</param>
        private void Execute(PunishMessage message)
        {
            foreach (uint clientDatabaseId in message.ClientDatabaseIds)
            {
                var clientId = Repository.Client.GetClientIdByClientDatabaseId(clientDatabaseId);
                if (clientId.HasValue)
                {
                    QueryRunner.MoveClient(clientId.Value, Repository.Settings.Control.Punish.Channel);
                }

                Repository.Client.StripGroups(clientDatabaseId);
                Repository.Client.AddClientServerGroups(clientDatabaseId, new[] { Repository.Settings.Control.Punish.ServerGroup });
            }

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

            Log(Repository.Settings.Control.Punish,
                string.Format("Client '{1}'(id:{2}) used {0}.", Repository.Settings.Control.Punish.Command,
                              clientEntry.Nickname, clientEntry.DatabaseId));
        }
        /// <summary>
        /// Executes the PunishMessage message.
        /// </summary>
        /// <param name="message">The message.</param>
        private void Execute(PunishMessage message)
        {
            foreach (uint clientDatabaseId in message.ClientDatabaseIds)
            {
                var clientId = Repository.Client.GetClientIdByClientDatabaseId(clientDatabaseId);
                if (clientId.HasValue)
                {
                    QueryRunner.MoveClient(clientId.Value, Repository.Settings.Control.Punish.Channel);
                }

                Repository.Client.StripGroups(clientDatabaseId);
                Repository.Client.AddClientServerGroups(clientDatabaseId, new[] { Repository.Settings.Control.Punish.ServerGroup });
            }

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