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


C# CmdTrigger.Reply方法代码示例

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


在下文中一共展示了CmdTrigger.Reply方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: 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:KroneckerX,项目名称:WCell,代码行数:28,代码来源:IPCCommands.cs

示例2: 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

示例3: 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:KroneckerX,项目名称:WCell,代码行数:34,代码来源:RealmCommands.cs

示例4: 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

示例5: 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

示例6: 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

示例7: 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

示例8: 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

示例9: Process

        public override void Process(CmdTrigger<RealmServerCmdArgs> trigger)
        {
            var target = trigger.Args.Character;
            var position = target.Position;

            WorldMap.DumpMapTileChunk(target.RegionId, position);
            
            trigger.Reply(String.Format("Region: {0}", target.Region));

            var zone = target.Zone;
            string zoneStr;
            if (zone != null)
            {
                zoneStr = zone.Id.ToString();

                while ((zone = zone.ParentZone) != null)
                {
                    zoneStr += " in " + zone;
                }
            }
            else
            {
                zoneStr = "<null>";
            }
            trigger.Reply(String.Format("Zone: {0}", zoneStr));
            trigger.Reply(String.Format("Position X: {0}, Y: {1}, Z: {2}, O: {3}", target.Position.X, target.Position.Y,
                                        target.Position.Z, target.Orientation));
            trigger.Reply("Chunk Dumped.");
        }
开发者ID:pallmall,项目名称:WCell,代码行数:29,代码来源:CollisionCommands.cs

示例10: 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

示例11: 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

示例12: AddSelectedFiles

			public void AddSelectedFiles(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.AddSelectedFile(part.Trim()))
						{
							trigger.Reply(" File was invalid or already selected: " + part.Trim());
						}
					}
				}

				if (indices != null)
				{
					if (!PATool.AddSelectedFiles(indices.ToArray()))
					{
						trigger.Reply(" One or more indices were invalid: " + indices.ToString(", "));
					}
				}
				trigger.Reply("Done - Selected files:");
				DisplaySelectedFiles(trigger, " ");
			}
开发者ID:remixod,项目名称:netServer,代码行数:33,代码来源:PacketAnalyzerCommand.cs

示例13: Process

			public override void Process(CmdTrigger<RealmServerCmdArgs> trigger)
			{
				Map map;
				if (trigger.Text.HasNext)
				{
					var mod = trigger.Text.NextModifiers();
					if (mod == "a")
					{
						// spawn all
						SpawnAllMaps(trigger);
						trigger.Reply(RealmLangKey.CmdMapSpawnResponse1);
						return;
					}
					else
					{
						var mapId = trigger.Text.NextEnum(MapId.End);
						map = World.GetNonInstancedMap(mapId);
						if (map == null)
						{
							trigger.Reply(RealmLangKey.CmdMapSpawnError1);
							return;
						}
					}
				}
				else
				{
					if (trigger.Args.Target == null)
					{
						trigger.Reply(RealmLangKey.CmdMapSpawnError2);
						return;
					}
					map = trigger.Args.Target.Map;
				}

				if (map.IsSpawned)
				{
					trigger.Reply(RealmLangKey.CmdMapSpawnError3);
				}
				else
				{
					trigger.Reply(RealmLangKey.CmdMapSpawnResponse2, map.Name);
					if (!GOMgr.Loaded)
					{
						trigger.Reply(RealmLangKey.CmdMapSpawnError4);
					}

					if (!NPCMgr.Loaded)
					{
						trigger.Reply(RealmLangKey.CmdMapSpawnError5);
					}

					map.AddMessage(() =>
					{
						map.SpawnMap();
						trigger.Reply(RealmLangKey.CmdMapSpawnResponse3, map);
					});
				}
			}
开发者ID:KroneckerX,项目名称:WCell,代码行数:58,代码来源:MapCommands.cs

示例14: Process

			public override void Process(CmdTrigger<AuthServerCmdArgs> trigger)
			{
				var databaseProvider = AuthDBMgr.DatabaseProvider;
				var session = databaseProvider.Session;

				trigger.Reply("DB Provider: " + databaseProvider.CurrentDialect.GetType().Name);
				trigger.Reply(" State: " + session.Connection.State);
				trigger.Reply(" Database: " + session.Connection.Database);
				trigger.Reply(" Connection String: " + session.Connection.ConnectionString);
			}
开发者ID:remixod,项目名称:netServer,代码行数:10,代码来源:AdminCommands.cs

示例15: Process

		public override void Process(CmdTrigger<AuthServerCmdArgs> trigger)
		{
			var subAlias = trigger.Text.NextWord();

			SubCommand subCmd;
			if (m_subCommands.TryGetValue(subAlias, out subCmd))
			{
				if (((AccountSubCommand)subCmd).RequiresAccount)
				{
					var acc = trigger.Args.Account;
					if (acc == null)
					{
						if (!trigger.Text.HasNext)
						{
							trigger.Reply("You did not specify an Account.");
							trigger.Reply(subCmd.CreateUsage(trigger));
							return;
						}

						var mods = trigger.Text.NextModifiers();

						if (mods == "i")
						{
							var id = trigger.Text.NextInt();
							acc = AccountMgr.GetAccount(id);

							if (acc == null)
							{
								trigger.Reply("There is no Account with Id: " + id);
								return;
							}
						}
						else
						{
							var name = trigger.Text.NextWord();
							acc = AccountMgr.GetAccount(name);
							if (acc == null)
							{
								trigger.Reply("There is no Account with Name: " + name);
								return;
							}
						}

						trigger.Args.Account = acc;
					}
				}
				subCmd.Process(trigger);
			}
			else
			{
				trigger.Reply("SubCommand not found: " + subAlias);
				trigger.Text.Skip(trigger.Text.Length);
				mgr.DisplayCmd(trigger, this, false, false);
			}
		}
开发者ID:Jeroz,项目名称:WCell,代码行数:55,代码来源:AccountCommands.cs


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