当前位置: 首页>>代码示例>>C#>>正文


C# CmdTrigger类代码示例

本文整理汇总了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.");
 }
开发者ID:ebakkedahl,项目名称:WCell,代码行数:7,代码来源:TestCommands.cs

示例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.");
				}
			}
开发者ID:Pepsee,项目名称:WCell.SpecialTools,代码行数:26,代码来源:UpdateCommand.cs

示例3: Process

		public override void Process(CmdTrigger<RealmServerCmdArgs> trigger)
		{
			var chr = ((Character)trigger.Args.Target);
			var xp = trigger.Text.NextInt(1);

			chr.GainXp(xp);
		}
开发者ID:KroneckerX,项目名称:WCell,代码行数:7,代码来源:CharacterCommands.cs

示例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;
		}
开发者ID:NVN,项目名称:WCell,代码行数:34,代码来源:RealmCommands.cs

示例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.");
					}
				}));
			}
		}
开发者ID:ray2006,项目名称:WCell,代码行数:27,代码来源:PlayerCommands.cs

示例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.");
                }
            }
开发者ID:WCell,项目名称:WCell-IrcAddon,代码行数:29,代码来源:RealmServerCommands.cs

示例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"));
			}
开发者ID:KroneckerX,项目名称:WCell,代码行数:34,代码来源:AICommands.cs

示例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");
            }
        }
开发者ID:pallmall,项目名称:WCell,代码行数:25,代码来源:CollisionCommands.cs

示例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, " ");
			}
开发者ID:remixod,项目名称:netServer,代码行数:32,代码来源:PacketAnalyzerCommand.cs

示例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);
                }
            }
开发者ID:ebakkedahl,项目名称:WCell,代码行数:28,代码来源:SkillCommands.cs

示例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");
					}
				}
			}
开发者ID:ray2006,项目名称:WCell,代码行数:30,代码来源:BattlegroundCommand.cs

示例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);
                }
            }
开发者ID:KroneckerX,项目名称:WCell,代码行数:29,代码来源:UpdateCommand.cs

示例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.");
					}
				}
			}
开发者ID:WCellFR,项目名称:WCellFR,代码行数:28,代码来源:IPCCommands.cs

示例14: Process

		public override void Process(CmdTrigger<AuthServerCmdArgs> trigger)
		{
			foreach (var line in AuthStats.Instance.GetFullStats())
			{
				trigger.Reply(line);
			}
		}
开发者ID:KroneckerX,项目名称:WCell,代码行数:7,代码来源:MiscCommands.cs

示例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);
			}
开发者ID:KroneckerX,项目名称:WCell,代码行数:32,代码来源:ItemCommands.cs


注:本文中的CmdTrigger类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。