當前位置: 首頁>>代碼示例>>C#>>正文


C# Player.Unignore方法代碼示例

本文整理匯總了C#中fCraft.Player.Unignore方法的典型用法代碼示例。如果您正苦於以下問題:C# Player.Unignore方法的具體用法?C# Player.Unignore怎麽用?C# Player.Unignore使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在fCraft.Player的用法示例。


在下文中一共展示了Player.Unignore方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: UnignoreHandler

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

                if( player.Unignore( targetInfo ) ) {
                    player.MessageNow( "You are no longer ignoring {0}", targetInfo.ClassyName );
                } else {
                    player.MessageNow( "You are not currently 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,代碼行數:25,代碼來源:ChatCommands.cs

示例2: UnignoreHandler

        static void UnignoreHandler( Player player, CommandReader cmd ) {
            string name = cmd.Next();
            if( name != null ) {
                if( cmd.HasNext ) {
                    // too many parameters given
                    CdUnignore.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 (or &H/Unignore&S) yourself." );
                    return;
                }

                if( player.Unignore( targetInfo ) ) {
                    player.MessageNow( "You are no longer ignoring {0}", targetInfo.ClassyName );
                } else {
                    player.MessageNow( "You are not currently ignoring {0}", targetInfo.ClassyName );
                }
            } else {
                ListIgnoredPlayers( player );
            }
        }
開發者ID:fragmer,項目名稱:fCraft,代碼行數:25,代碼來源:ChatCommands.cs

示例3: Unignore

 internal static void Unignore( 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.Unignore( targetInfo ) ) {
             player.MessageNow( "You are no longer ignoring {0}", targetInfo.GetClassyName() );
         } else {
             player.MessageNow( "You are not currently 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,代碼行數:34,代碼來源:ChatCommands.cs

示例4: UnignoreHandler

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

                if (player.Unignore(targetInfo)) {
                    player.Message("You are no longer ignoring {0}", targetInfo.ClassyName);
                } else {
                    player.Message("You are not currently 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,代碼行數:37,代碼來源:ChatCommands.cs


注:本文中的fCraft.Player.Unignore方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。