本文整理汇总了C#中NetUser.CanAdmin方法的典型用法代码示例。如果您正苦于以下问题:C# NetUser.CanAdmin方法的具体用法?C# NetUser.CanAdmin怎么用?C# NetUser.CanAdmin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NetUser
的用法示例。
在下文中一共展示了NetUser.CanAdmin方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: hasVip
bool hasVip(NetUser netuser, string vipname)
{
if (netuser.CanAdmin()) return true;
return permission.UserHasPermission(netuser.playerClient.userID.ToString(), vipname);
}
示例2: hasAccess
bool hasAccess(NetUser netuser)
{
if (netuser.CanAdmin())
return true;
return false;
}
示例3: hasAccess
bool hasAccess(NetUser netuser)
{
if (netuser.CanAdmin()) return true;
return permission.UserHasPermission(netuser.playerClient.userID.ToString(), "canclean");
}
示例4: hasAccess
bool hasAccess(NetUser player)
{
if (!player.CanAdmin())
{
SendReply(player, "You are not allowed to use this command");
return false;
}
return true;
}
示例5: OnPlayerConnected
private void OnPlayerConnected(NetUser netUser)
{
// Let covalence know
covalence.PlayerManager.NotifyPlayerConnect(netUser);
// Do permission stuff
if (permission.IsLoaded)
{
var id = netUser.userID.ToString();
permission.UpdateNickname(id, netUser.displayName);
// Add player to default group
if (!permission.UserHasGroup(id, DefaultGroups[0])) permission.AddUserGroup(id, DefaultGroups[0]);
// Add player to admin group if admin
if (netUser.CanAdmin() && !permission.UserHasGroup(id, DefaultGroups[2])) permission.AddUserGroup(id, DefaultGroups[2]);
}
// Call covalence hook
Interface.Call("OnUserConnected", covalence.PlayerManager.GetPlayer(netUser.userID.ToString()));
}