当前位置: 首页>>代码示例>>C#>>正文


C# Player.Ignore方法代码示例

本文整理汇总了C#中fCraft.Player.Ignore方法的典型用法代码示例。如果您正苦于以下问题:C# Player.Ignore方法的具体用法?C# Player.Ignore怎么用?C# Player.Ignore使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在fCraft.Player的用法示例。


在下文中一共展示了Player.Ignore方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: IgnoreHandler

        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;
            }
        }
开发者ID:fragmer,项目名称:fCraft,代码行数:26,代码来源:ChatCommands.cs

示例2: IgnoreHandler

        static void IgnoreHandler( Player player, CommandReader cmd ) {
            string name = cmd.Next();
            if( name != null ) {
                if( cmd.HasNext ) {
                    // too many parameters given
                    CdIgnore.PrintUsage( player );
                    return;
                }
                // A name was given -- let's find the target
                PlayerInfo targetInfo = PlayerDB.FindPlayerInfoOrPrintMatches( player, name, SearchOptions.ReturnSelfIfNoMatches );
                if( targetInfo == null ) return;
                if( targetInfo == player.Info ) {
                    player.Message( "You cannot &H/Ignore&S yourself." );
                    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 {
                ListIgnoredPlayers( player );
            }
        }
开发者ID:fragmer,项目名称:fCraft,代码行数:26,代码来源:ChatCommands.cs

示例3: Ignore

        internal static void Ignore( Player player, Command cmd ) {
            string name = cmd.Next();
            if( name != null ) {
                PlayerInfo targetInfo;
                if( !PlayerDB.FindPlayerInfo( name, out targetInfo ) ) {
                    PlayerInfo[] infos = PlayerDB.FindPlayers( name );
                    if( infos.Length == 1 ) {
                        targetInfo = infos[0];
                    } else if( infos.Length > 1 ) {
                        player.ManyMatchesMessage( "player", infos );
                        return;
                    } else {
                        player.NoPlayerMessage( name );
                        return;
                    }
                } else if( targetInfo == null ) {
                    player.NoPlayerMessage( name );
                    return;
                }
                if( player.Ignore( targetInfo ) ) {
                    player.MessageNow( "You are now ignoring {0}", targetInfo.GetClassyName() );
                } else {
                    player.MessageNow( "You are already ignoring {0}", targetInfo.GetClassyName() );
                }

            } else {
                PlayerInfo[] ignoreList = player.GetIgnoreList();
                if( ignoreList.Length > 0 ) {
                    player.MessageNow( "Ignored players: {0}", ignoreList.JoinToClassyString() );
                } else {
                    player.MessageNow( "You are not currently ignoring anyone." );
                }
                return;
            }
        }
开发者ID:fragmer,项目名称:fCraft,代码行数:35,代码来源:ChatCommands.cs

示例4: IgnoreHandler

        static void IgnoreHandler(Player player, CommandReader cmd) {
            string name = cmd.Next();
            if (!string.IsNullOrEmpty(name)) {
                if (name.ToLower() == "irc") {
                    if (player.Info.ReadIRC == true) {
                        player.Info.ReadIRC = false;
                        player.Message("You are now ignoring &iIRC");
                        string message = String.Format("\u212C&SPlayer {0}&S is now Ignoring IRC", player.ClassyName);
                        if (!player.Info.IsHidden) {
                            IRC.SendChannelMessage(message);
                        }
                    } else {
                        player.Message("You are already ignoring &iIRC");
                    }
                    return;
                }
                if (cmd.HasNext) {
                    CdIgnore.PrintUsage(player);
                    return;
                }
                PlayerInfo targetInfo = PlayerDB.FindPlayerInfoOrPrintMatches(player, name, SearchOptions.ReturnSelfIfOnlyMatch);
                if (targetInfo == null) return;

                if (player.Ignore(targetInfo)) {
                    player.Message("You are now ignoring {0}", targetInfo.ClassyName);
                } else {
                    player.Message("You are already ignoring {0}", targetInfo.ClassyName);
                }

            } else {
                PlayerInfo[] ignoreList = player.IgnoreList;
                if (ignoreList.Length > 0) {
                    player.Message("Ignored players: {0}", ignoreList.JoinToClassyString());
                } else {
                    player.Message("You are not currently ignoring anyone.");
                }
            }
        }
开发者ID:Magi1053,项目名称:ProCraft,代码行数:38,代码来源:ChatCommands.cs


注:本文中的fCraft.Player.Ignore方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。