本文整理汇总了C#中CmdTrigger类的典型用法代码示例。如果您正苦于以下问题:C# CmdTrigger类的具体用法?C# CmdTrigger怎么用?C# CmdTrigger使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CmdTrigger类属于命名空间,在下文中一共展示了CmdTrigger类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Process
public override void Process(CmdTrigger<RealmServerCmdArgs> trigger)
{
var spell = trigger.Text.NextEnum(SpellId.None);
var reason = trigger.Text.NextEnum(SpellFailedReason.Interrupted);
//SpellHandler.SendCastFailed(trigger.Args.Target, trigger.Args.Character.Client, spell, reason);
trigger.Reply("Done.");
}
示例2: Process
public override void Process(CmdTrigger<ToolCmdArgs> trigger)
{
var mod = trigger.Text.NextModifiers();
if (mod == "e")
{
WCellEnumWriter.WriteAllEnums();
}
else if (!mod.Contains("f") && VersionUpdater.WoWFile.Version <= WCellInfo.RequiredVersion)
{
trigger.Reply("WCell does already have the same or higher version as the given client: " +
WCellInfo.RequiredVersion);
trigger.Reply("Use the -f switch (force) to update again.");
}
else
{
var dumpDBCs = trigger.Text.NextBool() || !Directory.Exists(VersionUpdater.DBCFolder);
if (dumpDBCs)
{
trigger.Reply("Dumping DBC files...");
VersionUpdater.DumpDBCs();
}
trigger.Reply("Updating changes for client: {0} ...", VersionUpdater.WoWFile);
VersionUpdater.DoUpdate();
trigger.Reply("Done.");
}
}
示例3: Process
public override void Process(CmdTrigger<RealmServerCmdArgs> trigger)
{
var chr = ((Character)trigger.Args.Target);
var xp = trigger.Text.NextInt(1);
chr.GainXp(xp);
}
示例4: GetRealm
/// <summary>
/// Returns the realm, specified by the next word or number, if the Realm could be found, else sends a reply.
/// </summary>
/// <param name="trigger"></param>
/// <returns></returns>
public static RealmEntry GetRealm(CmdTrigger<AuthServerCmdArgs> trigger)
{
var arg = trigger.Text.Remainder;
uint no;
var count = AuthenticationServer.RealmCount;
if (count > 0)
{
if (uint.TryParse(arg, out no))
{
if (count < no)
{
trigger.Reply("Invalid Realm Number - Must be between 1 and {0}", count);
}
else
{
return AuthenticationServer.GetRealmByNumber((int)no);
}
}
else
{
return AuthenticationServer.GetRealmByName(arg);
}
}
else
{
trigger.Reply("There are no registered Realms.");
}
return null;
}
示例5: Process
public override void Process(CmdTrigger<RealmServerCmdArgs> trigger)
{
var email = trigger.Text.NextWord();
if (!Utility.IsValidEMailAddress(email))
{
trigger.Reply("Invalid Mail address.");
}
else
{
trigger.Reply("Setting mail address to " + email + "...");
RealmServer.Instance.AddMessage(new Message(() =>
{
var chr = ((Character)trigger.Args.Target);
if (chr.Account.SetEmail(email))
{
trigger.Reply("Done.");
}
else
{
trigger.Reply("Could not change email-address.");
}
}));
}
}
示例6: Process
public override void Process(CmdTrigger<RealmServerCmdArgs> trigger)
{
string accName = trigger.Text.NextWord();
if (accName != null)
{
RealmAccount acc = ServerApp<RealmServer>.Instance.GetOrRequestAccount(accName);
if (acc != null)
{
if (acc.IsActive)
{
trigger.Reply("Account '" + acc.Name + "' is not banned.");
}
else
{
trigger.Reply(acc.StatusUntil.Value.ToLongDateString());
}
}
else
{
trigger.Reply("Account '" + accName + "' does not exist.");
}
}
else
{
trigger.Reply("Please include the account name.");
}
}
示例7: Process
public override void Process(CmdTrigger<RealmServerCmdArgs> trigger)
{
bool newState;
var target = trigger.Args.Target;
if (target == trigger.Args.Character)
{
target = trigger.Args.Character.Target;
}
if (!(target is NPC))
{
trigger.Reply("Must target NPC.");
return;
}
var brain = target.Brain;
if (brain == null)
{
trigger.Reply(target.Name + " doesn't have a brain.");
return;
}
if (trigger.Text.HasNext)
{
newState = trigger.Text.NextBool();
}
else
{
newState = !brain.IsRunning;
}
brain.IsRunning = newState;
trigger.Reply(target.Name + "'s Brain is now: " + (newState ? "Activated" : "Deactivated"));
}
示例8: Process
public override void Process(CmdTrigger<RealmServerCmdArgs> trigger)
{
var curChar = trigger.Args.Character;
var target = trigger.Args.SelectedUnitOrGO;
float? dist;
if (target != null)
{
dist = curChar.Region.Terrain.QueryWMOCollision(curChar.Position, target.Position);
}
else
{
var targetPos = new Vector3(curChar.Position.X + 10.0f, curChar.Position.Y + 10.0f, curChar.Position.Z);
dist = curChar.Region.Terrain.QueryWMOCollision(curChar.Position, targetPos);
}
if (dist == null)
{
trigger.Reply("Has LOS.");
}
else
{
trigger.Reply("No LOS");
}
}
示例9: RemoveSelectedFiles
public void RemoveSelectedFiles(CmdTrigger<ToolCmdArgs> trigger, IEnumerable<string> parts)
{
List<int> indices = null;
int index;
foreach (var part in parts)
{
if (int.TryParse(part, out index))
{
if (indices == null)
{
indices = new List<int>();
}
indices.Add(index);
}
else
{
if (!PATool.RemoveSelectedFile(part.Trim()))
{
trigger.Reply(" File was not selected: " + part.Trim());
}
}
}
if (indices != null)
{
if (!PATool.RemoveSelectedFiles(indices.ToArray()))
{
trigger.Reply(" One or more indices were invalid: " + indices.ToString(", "));
}
}
trigger.Reply("Done - Selected files:");
DisplaySelectedFiles(trigger, " ");
}
示例10: Process
public override void Process(CmdTrigger<RealmServerCmdArgs> trigger)
{
var id = trigger.Text.NextEnum(SkillId.None);
var skillLine = SkillHandler.Get(id);
if (skillLine != null)
{
var chr = ((Character)trigger.Args.Target);
var amount = trigger.Text.NextInt(1);
//var max = Math.Max(trigger.Text.NextInt(1), amount);
var tier = skillLine.GetTierForLevel(amount);
var skill = chr.Skills.GetOrCreate(id, true);
skill.CurrentValue = (ushort)amount;
//skill.MaxValue = (ushort)skillLine.Tiers.GetMaxValue(tier);
var spell = skillLine.GetSpellForTier(tier);
if (spell != null)
{
chr.Spells.AddSpell(spell);
}
trigger.Reply(RealmLangKey.CmdSkillSetResponse, skillLine, amount, tier);
}
else
{
trigger.Reply(RealmLangKey.CmdSkillSetError, id);
}
}
示例11: Process
public override void Process(CmdTrigger<RealmServerCmdArgs> trigger)
{
if (trigger.Text.NextModifiers() == "f")
{
var bgId = trigger.Text.NextEnum(BattlegroundId.End);
if (bgId == BattlegroundId.End)
{
trigger.Reply("Invalid BattlegroundId.");
return;
}
List(trigger, BattlegroundMgr.GetInstances(bgId).Values);
}
else
{
var total = 0;
for (var i = 0; i < BattlegroundMgr.Instances.Length; i++)
{
var bgs = BattlegroundMgr.Instances[i];
if (bgs != null)
{
total += List(trigger, bgs.Values);
}
}
if (total == 0)
{
trigger.Reply("There are no active Battleground instances");
}
}
}
示例12: Process
public override void Process(CmdTrigger<ToolCmdArgs> trigger)
{
var mod = trigger.Text.NextModifiers();
string dir;
if (mod == "a")
{
dir = DBCTool.FindWowDir(null);
}
else
{
dir = Path.GetFullPath(trigger.Text.Remainder);
if (trigger.Text.Remainder.EndsWith(".exe"))
{
dir = Path.GetDirectoryName(dir);
}
}
if (!Directory.Exists(dir))
{
trigger.Reply("Directory does not exist: " + dir);
}
else
{
ToolConfig.WoWDir = dir;
ToolConfig.Instance.Save();
VersionUpdater.SetWowDir(ToolConfig.WoWFileLocation);
trigger.Reply("Selected client: {0}", VersionUpdater.WoWFile);
}
}
示例13: Process
public override void Process(CmdTrigger<AuthServerCmdArgs> trigger)
{
var open = trigger.Text.NextBool() | !IPCServiceHost.IsOpen;
if (open)
{
if (IPCServiceHost.IsOpen)
{
trigger.Reply("IPC Service already running - You need to close it before being able to re-open it.");
}
else
{
IPCServiceHost.StartService();
trigger.Reply("Done.");
}
}
else
{
if (!IPCServiceHost.IsOpen)
{
trigger.Reply("IPC Service is already closed.");
}
else
{
IPCServiceHost.StopService();
trigger.Reply("Done.");
}
}
}
示例14: Process
public override void Process(CmdTrigger<AuthServerCmdArgs> trigger)
{
foreach (var line in AuthStats.Instance.GetFullStats())
{
trigger.Reply(line);
}
}
示例15: Process
public override void Process(CmdTrigger<RealmServerCmdArgs> trigger)
{
var mods = trigger.Text.NextModifiers();
var entry = trigger.Text.NextEnum(ItemId.None);
var templ = ItemMgr.GetTemplate(entry);
if (templ == null)
{
trigger.Reply("Invalid ItemId.");
return;
}
if (templ.IsCharter)
{
trigger.Reply("Charters cannot be added by command.");
return;
}
var amount = trigger.Text.NextInt(1);
var stacks = trigger.Text.NextUInt(1);
var ensure = mods.Contains("e");
var autoEquip = mods.Contains("a");
for (var i = 0; i < stacks; i++)
{
if (!AddItem((Character)trigger.Args.Target, templ, amount, autoEquip, ensure))
{
break;
}
}
//trigger.Reply("{0}/{1} stacks of {2} created{3}", x, stacks, templ, err == InventoryError.OK ? "." : ": " + err);
}