fCraft.ChatCommands.IgnoreHandler C# (CSharp) Method

IgnoreHandler() private static method

private static IgnoreHandler ( Player player, Command cmd ) : void
player Player
cmd Command
return void
        private static void IgnoreHandler( Player player, Command cmd )
        {
            string name = cmd.Next();
            if ( name != null ) {
                if ( cmd.HasNext ) {
                    CdIgnore.PrintUsage( player );
                    return;
                }
                PlayerInfo targetInfo = PlayerDB.FindPlayerInfoOrPrintMatches( player, name );
                if ( targetInfo == null )
                    return;

                if ( player.Ignore( targetInfo ) ) {
                    player.MessageNow( "You are now ignoring {0}", targetInfo.ClassyName );
                } else {
                    player.MessageNow( "You are already ignoring {0}", targetInfo.ClassyName );
                }
            } else {
                PlayerInfo[] ignoreList = player.IgnoreList;
                if ( ignoreList.Length > 0 ) {
                    player.MessageNow( "Ignored players: {0}", ignoreList.JoinToClassyString() );
                } else {
                    player.MessageNow( "You are not currently ignoring anyone." );
                }
                return;
            }
        }