• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# CmdTrigger类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中CmdTrigger的典型用法代码示例。如果您正苦于以下问题:C# CmdTrigger类的具体用法?C# CmdTrigger怎么用?C# CmdTrigger使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



CmdTrigger类属于命名空间,在下文中一共展示了CmdTrigger类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: Process

			public override void Process(CmdTrigger<AuthServerCmdArgs> trigger)
			{
				trigger.Reply("Recreating Database Schema...");
				DatabaseUtil.CreateSchema();
				AccountMgr.Instance.ResetCache();
				trigger.Reply("Done.");
			}
开发者ID:primax,项目名称:WCell,代码行数:7,代码来源:AdminCommands.cs


示例17: GetInstance

		public static InstancedRegion GetInstance(CmdTrigger<RealmServerCmdArgs> trigger)
		{
			if (!trigger.Text.HasNext)
			{
				trigger.Reply("No MapId specified.");
			}

			var mapId = trigger.Text.NextEnum(MapId.End);
			if (mapId == MapId.End)
			{
				trigger.Reply("Invalid MapId.");
				return null;
			}

			if (!trigger.Text.HasNext)
			{
				trigger.Reply("No Instance-Id specified.");
			}

			var id = trigger.Text.NextUInt();
			var instance = World.GetInstance(mapId, id);
			if (instance == null)
			{
				trigger.Reply("Instance does not exist: {0} (#{1})", mapId, id);
			}
			return instance;
		}
开发者ID:pallmall,项目名称:WCell,代码行数:27,代码来源:InstanceCommand.cs


示例18: Process

			public override void Process(CmdTrigger<RealmServerCmdArgs> trigger)
			{
				var name = trigger.Text.NextWord();
				var chr = trigger.Args.GetCharArgumentOrTarget(trigger, name);
				var handler = trigger.Args.TicketHandler;

				if (chr != null && chr.IsInWorld)
				{
					var ticket = chr.Ticket;
					var oldHandler = ticket.Handler;
					if (oldHandler != null && oldHandler.Role > handler.Role)
					{
						trigger.Reply("Ticket is already being handled by: " + oldHandler.Name);
					}
					else
					{
						if (oldHandler != null)
						{
							trigger.Reply("Taking over Ticket from: " + oldHandler.Name);
							oldHandler.SendMessage("The Ticket you were handling by " + ticket.Owner + " is now handled by: " + handler);
						}
						ticket.Handler = handler;
					}
				}
				else
				{
					trigger.Reply("Selected player is offline or does not exist: " + name);
				}
			}
开发者ID:remixod,项目名称:netServer,代码行数:29,代码来源:TicketCommands.cs


示例19: Process

            public override void Process(CmdTrigger<RealmServerCmdArgs> trigger)
            {
                var mod = trigger.Text.NextModifiers();
                TimeSpan? duration = null;
                if (mod == "t")
                {
                    duration = trigger.Text.NextTimeSpan();
                    if (duration == null)
                    {
                        trigger.Reply("Invalid Duration specified {0}", EnglishParamInfo);
                        return;
                    }
                }
                var id = trigger.Text.NextUInt();

                var worldEvent = WorldEventMgr.GetEvent(id);
                if (worldEvent == null)
                {
                    trigger.Reply("Invalid World Event {0} specified", id);
                    if (id == 0)
                    {
                        trigger.Reply("Usage:" + EnglishParamInfo);
                    }
                    return;
                }
                worldEvent.TimeUntilNextStart = TimeSpan.Zero;
                worldEvent.TimeUntilEnd = duration ?? worldEvent.Duration;
            }
开发者ID:ebakkedahl,项目名称:WCell,代码行数:28,代码来源:WorldEventCommands.cs


示例20: Process

 public override void Process(CmdTrigger<RealmServerCmdArgs> trigger)
 {
     foreach (var doSpell in SpellHandler.DOSpells.Values)
     {
         trigger.Reply("{0} (Id: {1})", doSpell.Name, doSpell.Id);
     }
 }
开发者ID:ebakkedahl,项目名称:WCell,代码行数:7,代码来源:DOCommands.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Cmdlet类代码示例发布时间:2022-05-24
下一篇:
C# CmdRequest类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap