本文整理汇总了C#中MUDEngine.CharData.Authorized方法的典型用法代码示例。如果您正苦于以下问题:C# CharData.Authorized方法的具体用法?C# CharData.Authorized怎么用?C# CharData.Authorized使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MUDEngine.CharData
的用法示例。
在下文中一共展示了CharData.Authorized方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GodMode
public static void GodMode(CharData ch, string[] str)
{
if( ch == null ) return;
if (ch.IsNPC())
return;
if (!ch.Authorized("godmode"))
return;
if (ch.HasActionBit(PC.PLAYER_GODMODE))
{
ch.RemoveActionBit(PC.PLAYER_GODMODE);
ch.SendText("God mode off.\r\n");
}
else
{
ch.SetActionBit(PC.PLAYER_GODMODE);
ch.SendText("God mode on.\r\n");
}
return;
}
示例2: Fog
/// <summary>
/// Fog: Immortal command to turn combat vulnerability on or off.
/// </summary>
/// <param name="ch"></param>
/// <param name="str"></param>
public static void Fog(CharData ch, string[] str)
{
if( ch == null ) return;
if (ch.IsNPC())
{
return;
}
if (!ch.Authorized("fog"))
{
return;
}
ch.ToggleActionBit(PC.PLAYER_FOG);
if (ch.HasActionBit(PC.PLAYER_FOG))
{
ch.SendText("Fog is now on.\r\n");
}
else
{
ch.SendText("Fog is now off.\r\n");
}
return;
}
示例3: PlayerTell
/// <summary>
/// Command for gods to respond to the players.
/// </summary>
/// <param name="ch"></param>
/// <param name="str"></param>
public static void PlayerTell(CharData ch, string[] str)
{
if( ch == null ) return;
if (!ch.Authorized("ptell"))
{
ch.SendText("&+LYou cannot respond to &+Bpetitions&+L.&n\r\n");
return;
}
if (str.Length < 2)
{
ch.SendText("Tell what to who?\r\n");
}
/*
* Can tell to PC's anywhere, but NPC's only in same room.
*/
CharData victim = ch.GetCharWorld(str[0]);
if (!victim)
{
ch.SendText("They aren't here.\r\n");
return;
}
if (!victim.Socket)
{
SocketConnection.Act("$N&n is &+Llinkdead&n.", ch, null, victim, SocketConnection.MessageTarget.character);
return;
}
string text = String.Join(" ", str, 1, (str.Length - 1));
text = DrunkSpeech.MakeDrunk(text, ch);
SocketConnection.Act("&n&+rYou tell $N&n&+r '&+R$t&n&+r'&n", ch, text, victim, SocketConnection.MessageTarget.character);
int position = victim.CurrentPosition;
victim.CurrentPosition = Position.standing;
SocketConnection.Act("&n&+r$n&n&+r responds to your petition with '&+R$t&n&+r'&n", ch, text, victim, SocketConnection.MessageTarget.victim);
string buf = String.Format("&+r{0} responds to {1}'s petition with '&+R{2}&n&+r'&n", ch.Name, victim.Name, text);
ImmortalChat.SendImmortalChat(ch, ImmortalChat.IMMTALK_PETITION, Limits.LEVEL_AVATAR, buf);
victim.CurrentPosition = position;
victim.ReplyTo = ch;
if (victim.HasActionBit(PC.PLAYER_AFK))
SocketConnection.Act("Just so you know, $E is &+RAFK&n.", ch, null, victim, SocketConnection.MessageTarget.character);
else if (victim.HasActionBit(PC.PLAYER_BOTTING))
SocketConnection.Act("Just so you know, $E is a &+YBOT&n", ch, null, victim, SocketConnection.MessageTarget.character);
return;
}
示例4: Peace
/// <summary>
/// Immortal commnand to stop all fights in the current room.
/// </summary>
/// <param name="ch"></param>
/// <param name="str"></param>
public static void Peace(CharData ch, string[] str)
{
if( ch == null ) return;
ch = ch.GetChar();
if (!ch.Authorized("peace"))
{
return;
}
foreach (CharData roomChar in ch.InRoom.People)
{
if (roomChar.Fighting)
{
Combat.StopFighting(roomChar, true);
}
roomChar.StopHatingAll();
Combat.StopHunting(roomChar);
Combat.StopFearing(roomChar);
}
ch.SendText("Done.\r\n");
return;
}
示例5: NameSucks
public static void NameSucks(CharData ch, string[] str)
{
if( ch == null ) return;
if (!ch.Authorized("namesucks"))
{
return;
}
if (str.Length == 0)
{
ch.SendText("Whose name sucks?\r\n");
return;
}
if (MUDString.NameContainedIn(str[0], Database.SystemData.BannedNames))
{
ch.SendText("That name is already banned.\r\n");
return;
}
Database.SystemData.BannedNames += str[0];
Database.SystemData.BannedNames += " ";
string buf = String.Format("{0} is now considered an illegal name.", str[0]);
SocketConnection.Act(buf, ch, null, null, SocketConnection.MessageTarget.character);
Log.Trace(ch.Name + ": " + buf);
Sysdata.Save();
}
示例6: Invis
/// <summary>
/// Immortal invisibility command.
/// </summary>
/// <param name="ch"></param>
/// <param name="str"></param>
public static void Invis(CharData ch, string[] str)
{
if( ch == null ) return;
if (ch.IsNPC())
return;
if (!ch.Authorized("wizinvis"))
return;
if (ch.HasActionBit(PC.PLAYER_WIZINVIS))
{
ch.RemoveActionBit(PC.PLAYER_WIZINVIS);
ch.SendText("You slowly fade back into existence.\r\n");
SocketConnection.Act("$n slowly fades into existence.", ch, null, null, SocketConnection.MessageTarget.room);
}
else
{
ch.SendText("You slowly vanish into thin air.\r\n");
SocketConnection.Act("$n slowly fades into thin air.", ch, null, null, SocketConnection.MessageTarget.room);
ch.SetActionBit(PC.PLAYER_WIZINVIS);
}
return;
}