本文整理汇总了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);
}
}
示例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);
}
}
示例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);
}