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


C# Player.Kick方法代码示例

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


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

示例1: 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, "Ragequit", LeaveReason.RageQuit, false, false, false);
                IRC.IRCAnnounceCustom(String.Format("{0} &4Ragequit from the server", player.ClassyName));
                return;
            }

            else
            {
                Server.Players.Message("{0} &4Ragequit from the server: &C{1}",
                                player.ClassyName, reason);
                IRC.IRCAnnounceCustom(String.Format("{0} &4Ragequit from the server: &C{1}",
                                player.ClassyName, reason));
                player.Kick(Player.Console, reason, LeaveReason.RageQuit, false, false, false);
            }
        }
开发者ID:Bedrok,项目名称:800craft,代码行数:21,代码来源:ChatCommands.cs

示例2: 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

示例3: QuitHandler

 static void QuitHandler(Player player, CommandReader cmd) {
     string Msg = "/Quit" + (cmd.HasNext ? " " + cmd.NextAll() : "");
     player.usedquit = true;
     player.quitmessage = (Msg.Length > 70 ? Msg.Remove(70) : Msg);
     player.Kick(Msg, LeaveReason.ClientQuit);
     Logger.Log(LogType.UserActivity,
                 "{0} left the server. Reason: {1}", player.Name, player.quitmessage);
 }
开发者ID:Magi1053,项目名称:ProCraft,代码行数:8,代码来源:ChatCommands.cs


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