本文整理汇总了C#中NetUser.Kick方法的典型用法代码示例。如果您正苦于以下问题:C# NetUser.Kick方法的具体用法?C# NetUser.Kick怎么用?C# NetUser.Kick使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NetUser
的用法示例。
在下文中一共展示了NetUser.Kick方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: uLink_OnPlayerConnected
public void uLink_OnPlayerConnected(uLink.NetworkPlayer player)
{
connectingPlayer = (NetUser)player.localData;
String playerSteamURL = "http://steamcommunity.com/profiles/" + connectingPlayer.userID.ToString();
WebClient wc = new WebClient ();
wc.DownloadStringCompleted += (sender, e) =>
{
userProfilePage = e.Result;
if (lockGroup != "none")
{
if (userProfilePage.IndexOf("http://steamcommunity.com/groups/" + lockGroup) == -1)
{
connectingPlayer.Kick(NetError.Facepunch_Kick_Ban, true);
}
}
Match vacMatch = Regex.Match(userProfilePage, @"^([0-9]{1,5}) day\(s\) since last ban$");
if (vacMatch.Success)
{
int daysSinceBan = Convert.ToInt32(vacMatch.Groups[1].Value);
if (daysSinceBan < minVacDays)
{
connectingPlayer.Kick(NetError.Facepunch_Kick_Ban, true);
}
}
};
wc.DownloadStringAsync(new Uri(playerSteamURL));
}
示例2: IOnGetClientMove
private object IOnGetClientMove(NetUser netUser, Vector3 pos)
{
if (float.IsNaN(pos.x) || float.IsInfinity(pos.x) || float.IsNaN(pos.y) || float.IsInfinity(pos.y) || float.IsNaN(pos.z) || float.IsInfinity(pos.z))
{
Interface.Oxide.LogInfo($"Banned {netUser.displayName} [{netUser.userID}] for sending bad packets (possible teleport hack)");
BanList.Add(netUser.userID, netUser.displayName, "Sending bad packets (possible teleport hack)");
netUser.Kick(NetError.ConnectionBanned, true);
return false;
}
return null;
}
示例3: otherKick
public static void otherKick(NetUser target, string reason)
{
if (target != null)
{
kickQueue.Add(target.userID.ToString());
Broadcast.broadcastTo(target.networkPlayer, "You were kicked! Reason: " + reason);
Vars.conLog.Error("Player " + target.displayName + " (" + target.userID + ") was kicked for: " + reason);
target.Kick(NetError.Facepunch_Kick_Ban, false);
}
}
示例4: kickPlayer
public static void kickPlayer(NetUser target, string reason, bool isBan)
{
if (target != null)
{
kickQueue.Add(target.userID.ToString());
Broadcast.broadcastTo(target.networkPlayer, (isBan ? "You were banned! Reason: " : "You were kicked! Reason: ") + reason);
if (isBan)
Vars.conLog.Error("Banned player " + target.displayName + " (" + target.userID + ") attempted to join.");
target.Kick(NetError.Facepunch_Kick_Ban, false);
if (!isBan)
{
Broadcast.broadcastAll("Player " + target.displayName + " was kicked. Reason: " + reason);
Vars.conLog.Error("Player " + target.displayName + " (" + target.userID + ") was kicked for: " + reason);
}
}
}
示例5: whitelistKick
public static void whitelistKick(NetUser target, string reason)
{
if (target != null)
{
kickQueue.Add(target.userID.ToString());
Broadcast.broadcastTo(target.networkPlayer, "You were kicked! Reason: " + reason);
Vars.conLog.Error("Nonwhitelisted player " + target.displayName + " (" + target.userID + ") attempted to join.");
target.Kick(NetError.Facepunch_Kick_Ban, false);
}
}
示例6: KickUser
public static void KickUser(NetUser player, NetError reason, bool notify)
{
// reson = NetError.Facepunch_Kick_Violation
player.Kick(reason, notify);
//player.playerClient.netUser.Kick(reason, notify);
}
示例7: loginNotice
public static bool loginNotice(NetUser user)
{
try
{
if (Core.blackList.Contains(user.userID))
{
Core.tempConnect.Add(user.userID);
user.Kick(NetError.Facepunch_Connector_VAC_Banned, true);
return false;
}
if (((Core.config.GetSetting("WhiteList", "enabled") != null) && (Core.config.GetSetting("WhiteList", "enabled").ToLower() == "true")) && !Core.whiteList.Contains(user.userID))
{
user.Kick(NetError.Facepunch_Connector_AuthFailure, true);
}
if (!Core.userCache.ContainsKey(user.userID))
{
Core.userCache.Add(user.userID, user.displayName);
}
else if (user.displayName != Core.userCache[user.userID])
{
Core.userCache[user.userID] = user.displayName;
}
if (Administrator.IsAdmin(user.userID) && Administrator.GetAdmin(user.userID).HasPermission("RCON"))
{
user.admin = true;
}
Core.motd(user.networkPlayer);
if (Core.config.GetSetting("Settings", "join_notice").ToLower() == "true")
{
foreach (PlayerClient client in PlayerClient.All)
{
if (client.userID != user.userID)
{
Util.sayUser(client.netPlayer, Core.Name, user.displayName + " has joined the server");
}
}
}
}
catch
{
}
return true;
}