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


C# RealmPacketOut.Fill方法代码示例

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


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

示例1: SendNPCTextUpdateSimple

		/// <summary>
		/// Sends a simple npc text update to the character
		/// </summary>
		/// <param name="character">recieving character</param>
		/// <param name="id">id of text to update</param>
		/// <param name="title">gossip window's title</param>
		/// <param name="text">gossip window's text</param>
		public static void SendNPCTextUpdateSimple(Character character, uint id, string title, string text)
		{
			using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_NPC_TEXT_UPDATE))
			{
				packet.Write(id);

				packet.WriteFloat(1);
				packet.WriteCString(title);
				packet.WriteCString(text);
				packet.Fill(0, 4 * 7);

				for (var i = 1; i < 8; i++)
				{
					packet.WriteFloat(0);
					packet.WriteByte(0);
					packet.WriteByte(0);
					packet.Fill(0, 4 * 7);
				}

				character.Client.Send(packet);
			}
		}
开发者ID:Jeroz,项目名称:WCell,代码行数:29,代码来源:QueryHandler.cs

示例2: SendNPCTextUpdate

		/// <summary>
		/// Sends a npc text update to the character
		/// </summary>
		/// <param name="character">recieving character</param>
		/// <param name="text">class holding all info about text</param>
		public static void SendNPCTextUpdate(Character character, IGossipEntry text)
		{
			using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_NPC_TEXT_UPDATE))
			{
				packet.Write(text.GossipId);

				var i = 0;
				for (; i < text.GossipTexts.Length; i++)
				{
					var entry = text.GossipTexts[i];
					packet.WriteFloat(entry.Probability);

					var maleText = entry.GetTextMale(character.GossipConversation);
					string femaleText;
					if (text.IsDynamic)
					{
						// generated dynamically anyway
						femaleText = maleText;
					}
					else
					{
						femaleText = entry.GetTextFemale(character.GossipConversation);
					}
					packet.WriteCString(maleText);
					packet.WriteCString(femaleText);


					packet.Write((uint)entry.Language);

					for (int emoteIndex = 0; emoteIndex < 3; emoteIndex++)
					{
						// TODO: Emotes
						//packet.Write((uint)entry.Emotes[emoteIndex]);
						//packet.Write(entry.EmoteDelays[emoteIndex]);
						packet.Write(0L);
					}
				}

				for (; i < 8; i++)
				{
					packet.WriteFloat(0);
					packet.WriteByte(0);
					packet.WriteByte(0);
					packet.Fill(0, 4 * 7);
				}

				character.Client.Send(packet);
			}
		}
开发者ID:Jeroz,项目名称:WCell,代码行数:54,代码来源:QueryHandler.cs

示例3: SendEmptyUpdate

		/// <summary>
		/// Send Empty Group List
		/// </summary>
		protected virtual void SendEmptyUpdate(Character chr)
		{
			using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_GROUP_LIST))
			{
				//packet.ContentLength = 24;
				packet.Fill(0, 24);

				chr.Client.Send(packet);
			}
		}
开发者ID:ray2006,项目名称:WCell,代码行数:13,代码来源:Group.cs

示例4: CreateGuildQueryResponsePacket

		private static RealmPacketOut CreateGuildQueryResponsePacket(Guild guild)
		{
			var packet = new RealmPacketOut(RealmServerOpCode.SMSG_GUILD_QUERY_RESPONSE);

			packet.WriteUInt((byte)guild.Id);
			packet.WriteCString(guild.Name);

			var guildRanks = guild.Ranks;

			if (guildRanks.Length >= GuildMgr.MAX_GUILD_RANKS)
				return null;

			for (int i = 0; i < guildRanks.Length; i++)
			{
				packet.WriteCString(guildRanks[i].Name);
			}

			packet.Fill(0, GuildMgr.MAX_GUILD_RANKS - guildRanks.Length);

			packet.Write(guild.Tabard.EmblemStyle);
			packet.Write(guild.Tabard.EmblemColor);
			packet.Write(guild.Tabard.BorderStyle);
			packet.Write(guild.Tabard.BorderColor);
			packet.Write(guild.Tabard.BackgroundColor);
			packet.Write(0); // NEW 3.0.2

			return packet;
		}
开发者ID:MeaNone,项目名称:WCell,代码行数:28,代码来源:GuildHandler.cs

示例5: SendNPCTextUpdate

		/// <summary>
		/// Sends a npc text update to the character
		/// </summary>
		/// <param name="character">recieving character</param>
		/// <param name="text">class holding all info about text</param>
		public static void SendNPCTextUpdate(Character character, IGossipEntry text)
		{
			using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_NPC_TEXT_UPDATE))
			{
				packet.Write(text.GossipId);

				var i = 0;
				for (; i < text.GossipEntries.Length; i++)
				{
					var entry = text.GossipEntries[i];
					packet.WriteFloat(entry.Probability);

					var isMaleTextEmpty = string.IsNullOrEmpty(entry.TextMale);
					var isFemaleTextEmpty = string.IsNullOrEmpty(entry.TextFemale);

					if (isMaleTextEmpty && isFemaleTextEmpty)
					{
						packet.WriteCString(" ");
						packet.WriteCString(" ");
					}
					else if (isMaleTextEmpty)
					{
						packet.WriteCString(entry.TextFemale);
						packet.WriteCString(entry.TextFemale);
					}
					else if (isFemaleTextEmpty)
					{
						packet.WriteCString(entry.TextMale);
						packet.WriteCString(entry.TextMale);
					}
					else
					{
						packet.WriteCString(entry.TextMale);
						packet.WriteCString(entry.TextFemale);
					}

					packet.Write((uint)entry.Language);

					for (int emoteIndex = 0; emoteIndex < 3; emoteIndex++)
					{
						// TODO: Emotes
						//packet.Write((uint)entry.Emotes[emoteIndex]);
						//packet.Write(entry.EmoteDelays[emoteIndex]);
						packet.Write(0L);
					}
				}

				for (; i < 8; i++)
				{
					packet.WriteFloat(0);
					packet.WriteByte(0);
					packet.WriteByte(0);
					packet.Fill(0, 4 * 7);
				}

				character.Client.Send(packet);
			}
		}
开发者ID:ray2006,项目名称:WCell,代码行数:63,代码来源:QueryHandler.cs


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