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


C# Command.NextAll方法代码示例

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


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

示例1: TrollHandler

 static void TrollHandler(Player player, Command cmd)
 {
     string Name = cmd.Next();
     if (Name == null)
     {
         player.Message("Player not found. Please specify valid name.");
         return;
     }
     if (!Player.IsValidName(Name))
         return;
     Player target = Server.FindPlayerOrPrintMatches(player, Name, true, true);
     if (target == null)
         return;
     string options = cmd.Next();
     if (options == null)
     {
         CdTroll.PrintUsage(player);
         return;
     }
     string Message = cmd.NextAll();
     if (Message.Length < 1 && options.ToLower() != "leave")
     {
         player.Message("&WError: Please enter a message for {0}.", target.ClassyName);
         return;
     }
     switch (options.ToLower())
     {
         case "pm":
             if (player.Can(Permission.UseColorCodes) && Message.Contains("%"))
             {
                 Message = Color.ReplacePercentCodes(Message);
             }
             Server.Players.Message("&Pfrom {0}: {1}",
                 target.Name, Message);
             break;
         case "ac":
             Chat.SendAdmin(target, Message);
             break;
         case "st":
         case "staff":
             Chat.SendStaff(target, Message);
             break;
         case "i":
         case "impersonate":
         case "msg":
         case "message":
         case "m":
             Server.Message("{0}&S&F: {1}",
                               target.ClassyName, Message);
             break;
         case "leave":
         case "disconnect":
         case "gtfo":
             Server.Players.Message("&SPlayer {0}&S left the server.",
                 target.ClassyName);
             break;
         default: player.Message("Invalid option. Please choose st, ac, pm, message or leave");
             break;
     }
 }
开发者ID:727021,项目名称:800craft,代码行数:60,代码来源:TrollPlugin.cs

示例2: BRB

        internal static void BRB(Player player, Command cmd)
        {
            StreamReader streamReader = new StreamReader("plugins/brbMessage.txt");
            string message = streamReader.ReadToEnd();
            streamReader.Close();

            string msg = cmd.NextAll().Trim();
            if (player.Info.IsMuted)
            {
                player.MessageMuted();
                return;
            }
            if (msg.Length > 0)
            {
                Server.Message("{0}&S &EWill Brb &9({1})",
                                  player.ClassyName, msg);
                player.IsAway = true;
                return;
            }
            else
            {
                Server.Players.Message("&S{0} &EWill Brb &9(" + message + ")", player.ClassyName);
                player.IsAway = true;
            }
        }
开发者ID:FonGames,项目名称:BRB-Plugin--800Craft,代码行数:25,代码来源:Class1.cs

示例3: QuitHandler

        static void QuitHandler(Player player, Command cmd)
        {
            string Msg = cmd.NextAll();

            if (Msg.Length < 1)
            {
                CdQuit.PrintUsage(player);
                return;
            }
            else
            {
                player.Info.LeaveMsg = "left the server: &C" + Msg;
                player.Message("Your quit message is now set to: {0}", Msg);
            }
        }
开发者ID:venofox,项目名称:AtomicCraft,代码行数:15,代码来源:ChatCommands.cs

示例4: SayHandler

        static void SayHandler( Player player, Command cmd ) {
            if( player.Info.IsMuted ) {
                player.MessageMuted();
                return;
            }

            if( player.DetectChatSpam() ) return;

            if( player.Can( Permission.Say ) ) {
                string msg = cmd.NextAll().Trim();
                if( msg.Length > 0 ) {
                    Chat.SendSay( player, msg );
                } else {
                    CdSay.PrintUsage( player );
                }
            } else {
                player.MessageNoAccess( Permission.Say );
            }
        }
开发者ID:fragmer,项目名称:fCraft,代码行数:19,代码来源:ChatCommands.cs

示例5: BanHandler

 static void BanHandler( Player player, Command cmd ) {
     string targetName = cmd.Next();
     if( targetName == null ) {
         CdBan.PrintUsage( player );
         return;
     }
     PlayerInfo target = PlayerDB.FindPlayerInfoOrPrintMatches( player, targetName );
     if( target == null ) return;
     string reason = cmd.NextAll();
     try {
         Player targetPlayer = target.PlayerObject;
         target.Ban( player, reason, true, true );
         WarnIfOtherPlayersOnIP( player, target, targetPlayer );
     } catch( PlayerOpException ex ) {
         player.Message( ex.MessageColored );
         if( ex.ErrorCode == PlayerOpExceptionCode.ReasonRequired ) {
             FreezeIfAllowed( player, target );
         }
     }
 }
开发者ID:fragmer,项目名称:fCraft,代码行数:20,代码来源:ModerationCommands.cs

示例6: Say

        internal static void Say( Player player, Command cmd ) {
            if( player.Info.IsMuted ) {
                player.MutedMessage();
                return;
            }

            if( player.Can( Permission.Say ) ) {
                string msg = cmd.NextAll();
                if( player.Can( Permission.UseColorCodes ) && msg.Contains( "%" ) ) {
                    msg = Color.ReplacePercentCodes( msg );
                }
                if( msg != null && msg.Trim().Length > 0 ) {
                    player.Info.LinesWritten++;
                    Server.SendToAllExceptIgnored( player, "&Y{0}", null, msg.Trim() );
                    IRC.SendAction( String.Format( "&Y{0}", msg.Trim() ) );
                } else {
                    cdSay.PrintUsage( player );
                }
            } else {
                player.NoAccessMessage( Permission.Say );
            }
        }
开发者ID:fragmer,项目名称:fCraft,代码行数:22,代码来源:ChatCommands.cs

示例7: MassRankHandler

        static void MassRankHandler( Player player, Command cmd )
        {
            string fromRankName = cmd.Next();
            string toRankName = cmd.Next();
            string reason = cmd.NextAll();
            if( fromRankName == null || toRankName == null ) {
                CdMassRank.PrintUsage( player );
                return;
            }

            Rank fromRank = RankManager.FindRank( fromRankName );
            if( fromRank == null ) {
                player.MessageNoRank( fromRankName );
                return;
            }

            Rank toRank = RankManager.FindRank( toRankName );
            if( toRank == null ) {
                player.MessageNoRank( toRankName );
                return;
            }

            if( fromRank == toRank ) {
                player.Message( "Ranks must be different" );
                return;
            }

            int playerCount = fromRank.PlayerCount;
            string verb = (fromRank > toRank ? "demot" : "promot");

            if( !cmd.IsConfirmed ) {
                player.Confirm( cmd, "About to {0}e {1} players.", verb, playerCount );
                return;
            }

            player.Message( "MassRank: {0}ing {1} players...",
                            verb, playerCount );

            int affected = PlayerDB.MassRankChange( player, fromRank, toRank, reason );
            player.Message( "MassRank: done, {0} records affected.", affected );
        }
开发者ID:Blingpancakeman,项目名称:800craft,代码行数:41,代码来源:MaintenanceCommands.cs

示例8: BanXHandler

        static void BanXHandler(Player player, Command cmd)
        {
            string ban = cmd.Next();

            if (ban == null)
            {
                player.Message("&WError: Enter a player name to BanX");
                return;
            }

            //parse
            if (ban == "-")
            {
                if (player.LastUsedPlayerName != null)
                {
                    ban = player.LastUsedPlayerName;
                }
                else
                {
                    player.Message("Cannot repeat player name: you haven't used any names yet.");
                    return;
                }
            }
            PlayerInfo target = PlayerDB.FindPlayerInfoOrPrintMatches(player, ban);
            if (target == null) return;
            if (!Player.IsValidName(ban))
            {
                CdBanx.PrintUsage(player);
                return;
            }else{
                UndoPlayerHandler2(player, new Command("/undox " + target.Name + " 100000"));

                string reason = cmd.NextAll();

                if (reason.Length < 1)
                    reason = "Reason Undefined: BanX";
                try{
                    Player targetPlayer = target.PlayerObject;
                    target.Ban(player, reason, false, true);
                }catch (PlayerOpException ex){
                    player.Message(ex.MessageColored);
                    return;
                }
                    if (player.Can(Permission.Demote, target.Rank))
                    {
                        if (target.Rank != RankManager.LowestRank)
                        {
                            player.LastUsedPlayerName = target.Name;
                            target.ChangeRank(player, RankManager.LowestRank, cmd.NextAll(), false, true, false);
                        }
                        Server.Players.Message("{0}&S was BanX'd by {1}&S (with auto-demote):&W {2}", target.ClassyName, player.ClassyName, reason);
                        IRC.PlayerSomethingMessage(player, "BanX'd (with auto-demote)", target, reason);
                        return;
                    }
                    else
                    {
                        player.Message("&WAuto demote failed: You didn't have the permissions to demote the target player");
                        Server.Players.Message("{0}&S was BanX'd by {1}: &W{2}", target.ClassyName, player.ClassyName, reason);
                        IRC.PlayerSomethingMessage(player, "BanX'd", target, reason);
                    }
                player.Message("&SConfirm the undo with &A/ok");
            }
        }
开发者ID:Eeyle,项目名称:LegendCraftSource,代码行数:63,代码来源:BuildingCommands.cs

示例9: GuildChatHandler

 private static void GuildChatHandler( Player player, Command cmd )
 {
     Guild guild = GuildManager.PlayersGuild( player.Info );
     if ( guild == null ) {
         player.Message( "You do not have a guild" );
         return;
     }
     string msg = cmd.NextAll();
     if ( string.IsNullOrEmpty( msg ) ) {
         player.Message( "&WMessage cannot be null: /Gc [message to send]" );
         return;
     }
     guild.SendGuildMessage( player, msg );
     return;
 }
开发者ID:Jonty800,项目名称:Guilds,代码行数:15,代码来源:GuildPlugin.cs

示例10: GuildHandler

        private static void GuildHandler( Player player, Command cmd )
        {
            string Param = cmd.Next();
            if ( Param == null ) {
                CdGuild.PrintUsage( player );
                return;
            }

            Param = Param.ToLower();

            PlayerInfo target; //used to store a targetplayer in the switch case

            //this is for stuff which someone without a guild CAN do
            switch ( Param ) {
                case "create":
                    string Name = cmd.NextAll();
                    if ( string.IsNullOrEmpty( Name ) ) {
                        player.Message( "&WGuild name cannot be null: &H/Guild create Name" );
                        return;
                    }
                    if ( Cache.ForbiddenNames.Contains( Name.ToLower() ) ) {
                        player.Message( "&WName is forbidden: You cannot create a guild with this name" );
                        return;
                    }
                    GuildManager.CreateGuild( Name, player );
                    return;

                case "who":
                case "player":
                    string pp = cmd.Next();
                    if ( string.IsNullOrEmpty( pp ) ) {
                        player.Message( "&WPlayer name cannot be null: &h/Guild who playername" );
                        return;
                    }
                    target = PlayerDB.FindPlayerInfoOrPrintMatches( player, pp );
                    if ( target == null )
                        return;
                    player.Message( "{0}&s belongs to {1}", target.Name,
                        GuildManager.PlayersGuild( target ) == null ?
                        "no guild" :
                        "guild \"" + GuildManager.PlayersGuild( target ).Name + "\"" );
                    return;

                case "list":
                    string pro = cmd.Next();
                    if ( pro != null ) {
                        if ( pro.ToLower() == "provisional" ) {
                            player.Message( "Available provisional guilds:" );
                            player.Message( Cache.Guilds.Where( gg => gg.Provisional ).JoinToString() );
                            return;
                        }
                    }
                    player.Message( "Available guilds:" );
                    player.Message( Cache.Guilds.Where( gg => !gg.Provisional ).JoinToString() );
                    return;

                case "info":
                    string gstring = cmd.NextAll();
                    if ( string.IsNullOrEmpty( gstring ) ) {
                        if ( GuildManager.PlayerHasGuild( player.Info ) ) {
                            gstring = GuildManager.PlayersGuild( player.Info ).Name;
                        } else {
                            player.Message( "Guild name cannot be null: &H/Guild Info [GuildName]" );
                            return;
                        }
                    }
                    Guild gui = GuildManager.FindGuildOrPrintResults( player, gstring );
                    if ( gui == null ) {
                        return;
                    }
                    string[] Members = gui.Members.Where( p => gui.GuildMaster != p && !gui.Admins.Contains( p ) ).ToArray();
                    player.Message( "&hGuild \"{0}&h\" ({1}&h): &S\n" +
                        "{2}" +
                        "Guildmaster: {3}&S\n" +
                        "Admins: {4}\n" +
                        "Members: {5}\n" +
                        "Level: {6}\n" +
                        "PvP: {7}",
                        gui.Name,
                        !string.IsNullOrEmpty( gui.Tag ) ? gui.Tag : "No Tag",
                        gui.Open ? "This guild is open for anyone to join\n" : "",
                        gui.GuildMaster,
                        gui.Admins == null || gui.Admins.Length == 0 ? "(No Admins)" : gui.Admins.JoinToString(),
                        Members == null || Members.Length == 0 ? "(No Members)" : Members.JoinToString(),
                        gui.Level,
                        gui.PvP ? "&COn" : "&AOff" );
                    return;

                case "find":
                case "search":
                    string searchterm = cmd.NextAll(); {
                        if ( string.IsNullOrEmpty( searchterm ) ) {
                            player.Message( "&WSearch term cannot be null: &H/Guild search [search term]" );
                            return;
                        }
                        Guild[] FoundGuilds = GuildManager.FindGuilds( searchterm );
                        player.Message( "Guilds found matching {0}: {1}", searchterm, FoundGuilds.JoinToString() );
                    }
                    return;

//.........这里部分代码省略.........
开发者ID:Jonty800,项目名称:Guilds,代码行数:101,代码来源:GuildPlugin.cs

示例11: MeHandler

        static void MeHandler( Player player, Command cmd ) {
            if( player.Info.IsMuted ) {
                player.MessageMuted();
                return;
            }

            if( player.DetectChatSpam() ) return;

            string msg = cmd.NextAll().Trim();
            if( msg.Length > 0 ) {
                Chat.SendMe( player, msg );
            } else {
                CdMe.PrintUsage( player );
            }
        }
开发者ID:fragmer,项目名称:fCraft,代码行数:15,代码来源:ChatCommands.cs

示例12: KillHandler

        internal static void KillHandler(Player player, Command cmd)
        {
            string name = cmd.Next();
            string reason = cmd.NextAll();
            if (name == null)
            {
                player.Message("Please enter a name");
                return;
            }

            Player target = Server.FindPlayerOrPrintMatches(player, name, false, true);
            if (target == null) return;
            if (target.Immortal)
            {
                player.Message("&SYou failed to kill {0}&S, they are immortal", target.ClassyName);
                return;
            }

            double time = (DateTime.Now - player.Info.LastUsedKill).TotalSeconds;
            if (time < 10)
            {
                player.Message("&WYou can use /Kill again in " + Math.Round(10 - time) + " seconds.");
                return;
            }
            if (target == null)
            {
                player.Message("You need to enter a player name to Kill");
                return;
            }
            else
            {
                if (target == player)
                {
                    player.TeleportTo(player.World.Map.Spawn);
                    player.Info.LastUsedKill = DateTime.Now;
                    Server.Players.CanSee(target).Message("{0}&C killed itself in confusion!", player);
                    return;
                }

                if (player.Can(Permission.Kill, target.Info.Rank) && reason.Length < 1)
                {
                    target.TeleportTo(player.World.Map.Spawn);
                    player.Info.LastUsedKill = DateTime.Now;
                    Server.Players.CanSee(target).Message("{0}&C was &4Killed&C by {1}", target.ClassyName, player.ClassyName);
                    return;
                }
                else if (player.Can(Permission.Kill, target.Info.Rank) && reason != null)
                {
                    target.TeleportTo(player.World.Map.Spawn);
                    player.Info.LastUsedKill = DateTime.Now;
                    Server.Players.CanSee(target).Message("{0}&C was &4Killed&C by {1}&c: {2}", target.ClassyName, player.ClassyName, reason);
                }
                else
                {
                    player.Message("You can only Kill players ranked {0}&S or lower",
                                    player.Info.Rank.GetLimit(Permission.Kill).ClassyName);
                    player.Message("{0}&S is ranked {1}", target.ClassyName, target.Info.Rank.ClassyName);
                }
            }
        }
开发者ID:EricKilla,项目名称:LegendCraft,代码行数:60,代码来源:ModerationCommands.cs

示例13: RageHandler

 static void RageHandler(Player player, Command cmd)
 {
     string reason = cmd.NextAll();
     if (reason.Length < 1)
     {
         Server.Players.Message("{0} &4Ragequit from the server", player.ClassyName);
         player.Kick(Player.Console, "&4Ragequit", LeaveReason.RageQuit, false, false, false);
         IRC.SendAction(player.ClassyName + " &4Ragequit from the server");
         return;
     }
     else
     {
         Server.Players.Message("{0} &4Ragequit from the server: &C{1}",
                         player.ClassyName, reason);
         IRC.SendAction(player.ClassyName + " &WRagequit from the server: " + reason);
         player.Kick(Player.Console, reason, LeaveReason.RageQuit, false, false, false);
     }
 }
开发者ID:venofox,项目名称:AtomicCraft,代码行数:18,代码来源:ChatCommands.cs

示例14: GHandler

        static void GHandler(Player player, Command cmd)
        {
            string Msg = cmd.NextAll();
            if (!ConfigKey.GCKey.Enabled())
            {
                player.Message("Global Chat is disabled on this server.");
                return;
            }
            if (!GlobalChat.GlobalThread.GCReady)
            {
                player.Message("Global Chat is not connected.");
                return;
            }
            if (Msg == "reconnect")
            {
                if (player.Can(Permission.ManageGlobalChat))
                {
                    if (GlobalChat.GlobalThread.GCReady)
                    {
                        player.Message("&cThis server is currently connected to global chat.");
                        return;
                    }
                    else
                    {
                        GlobalChat.GlobalThread.GCReady = true;
                        Server.Message("&eAttempting to connect to LegendCraft Global Chat Network. This may take up to two minutes.");
                        GlobalChat.Init();
                        GlobalChat.Start();
                        return;

                    }
                }
            }

            var SendList = Server.Players.Where(p => p.GlobalChatAllowed && !p.IsDeaf);

            if ((!player.GlobalChatAllowed) && (Msg == "rules"))
            {
                player.Message(" &cRules: No spamming and no advertising. All chat rules that apply to your server apply here.\n" +
                    "&eServer staff have the right to kick you.\n" +
                    "&9By using the Global Chat, you accept these conditions.\n" +
                    "&eType &a/Global accept &eto connect");
                return;
            }

            else if ((player.GlobalChatAllowed) && (Msg == "rules"))
            {
                player.Message(" &cRules: No spamming and no advertising. All chat rules that apply to your server apply here.\n" +
                    "&eServer staff have the right to kick you.\n" +
                    "&9By using the Global Chat, you accept these conditions.");
                return;
            }

            else if ((!player.GlobalChatAllowed) && (Msg == "accept"))
            {
                player.GlobalChatAllowed = true;
                player.Message("&wThank you for accepting the global chat rules.\n" +
                    "&cYou now have global chat enabled.");
                GlobalChat.GlobalThread.SendChannelMessage(player.ClassyName + " &Sjoined global chat.");
                SendList.Message(player.ClassyName + " &Sjoined global chat.");
                return;
            }

            else if ((player.GlobalChatAllowed) && (Msg == "accept"))
            {
                player.Message("&You have already accepted the global chat rules.");
                return;
            }

            else if ((!player.GlobalChatIgnore) && (Msg == "ignore"))
            {
                player.GlobalChatIgnore = true;
                player.Message("&cYou have disconnected from global chat.");
                SendList.Message(player.ClassyName + " &Sdisconnected from global chat.");
                GlobalChat.GlobalThread.SendChannelMessage(player.ClassyName + " &Sdisconnected from global chat.");
                return;
            }

            else if (player.Info.IsMuted)
            {
                player.MessageMuted();
                return;
            }

            if ((!player.GlobalChatAllowed) && ((Msg.Length < 1) || (Msg.Length > 1)))
            {
                player.Message("&WYou must read and accept the global chat rules. Type &a/Global rules.");
                return;
            }

            else if ((player.GlobalChatAllowed) &&((Msg == "") || (Msg == null)))
            {
                player.Message("You must enter a message!");
                return;
            }
            else if (Msg == "help")
            {
                CdGlobal.PrintUsage(player);
                return;
            }
//.........这里部分代码省略.........
开发者ID:venofox,项目名称:AtomicCraft,代码行数:101,代码来源:ChatCommands.cs

示例15: AdminChat

 internal static void AdminChat(Player player, Command cmd)
 {
     if (player.Info.IsMuted)
     {
         player.MessageMuted();
         return;
     }
     if (DateTime.UtcNow < player.Info.MutedUntil)
     {
         player.Message("You are muted for another {0:0} seconds.",
                         player.Info.MutedUntil.Subtract(DateTime.UtcNow).TotalSeconds);
         return;
     }
     string message = cmd.NextAll().Trim();
     if (message.Length > 0)
     {
         if (player.Can(Permission.UseColorCodes) && message.Contains("%"))
         {
             message = Color.ReplacePercentCodes(message);
         }
         Chat.SendAdmin(player, message);
     }
 }
开发者ID:venofox,项目名称:AtomicCraft,代码行数:23,代码来源:ChatCommands.cs


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