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


C# RealmPacketOut类代码示例

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


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

示例1: Send_SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA

        public static void Send_SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA(Character chr)
        {
            using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA, 0))
            {
				chr.Send(packet);
            }
        }
开发者ID:Jeroz,项目名称:WCell,代码行数:7,代码来源:VehicleHandler.cs

示例2: SendBattlegroundWindow

        /// <summary>
        /// Sends the packet to show the battleground window
        /// </summary>
        /// <param name="client"></param>
        /// <param name="speaker"></param>
        /// <param name="character"></param>
        /// <returns></returns>
        public bool SendBattlegroundWindow(IRealmClient client, NPC speaker, Character character)
        {
            using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_BATTLEFIELD_LIST))
            {
                packet.WriteULong(speaker != null ? speaker.EntityId.Full : 0);
                packet.WriteUInt((uint)m_bgqueue.Template.BgID);
                packet.WriteByte(m_battlegroupId); //Battle group
				// TODO: Add sync'ing?
                //m_syncLock.EnterReadLock();
                try
                {
                    packet.WriteUInt(m_battlegrounds.Count); //Count

                    foreach (var bg in m_battlegrounds.Values)
                    {
                        packet.WriteUInt(bg.InstanceId);
                    }
                }
                finally
                {
                    //m_syncLock.ExitReadLock();
                }
                client.Send(packet);
                return true;
            }
        }
开发者ID:pallmall,项目名称:WCell,代码行数:33,代码来源:BattleRange.cs

示例3: SendInBounds

		public static void SendInBounds(Character duelist)
		{
            using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_DUEL_INBOUNDS,4))
            {
                duelist.Send(packet);
            }
		}
开发者ID:ray2006,项目名称:WCell,代码行数:7,代码来源:DuelHandler.cs

示例4: SendCancelAutoRepeat

 public static void SendCancelAutoRepeat(IPacketReceiver client, IEntity entity)
 {
     using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_CANCEL_AUTO_REPEAT))
     {
         entity.EntityId.WritePacked(packet);
         client.Send(packet);
     }
 }
开发者ID:Zakkgard,项目名称:WCell,代码行数:8,代码来源:MiscHandler.cs

示例5: SendBreakTarget

		public static void SendBreakTarget(IPacketReceiver rcvr, IEntity target)
		{
			using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_BREAK_TARGET, 8))
			{
				packet.Write(target.EntityId);
				rcvr.Send(packet);
			}
		}
开发者ID:remixod,项目名称:netServer,代码行数:8,代码来源:VehicleHandler.cs

示例6: GetMail

 public void GetMail(TestCharacter getter)
 {
     using (var packet = new RealmPacketOut(RealmServerOpCode.CMSG_GET_MAIL_LIST))
     {
         packet.Write(EntityId.Zero);
         getter.FakeClient.ReceiveCMSG(packet, true);
     }
 }
开发者ID:KroneckerX,项目名称:WCell,代码行数:8,代码来源:MailTests.cs

示例7: SendInstanceReset

 /// <summary>
 /// An instance has been reset
 /// </summary>
 public static void SendInstanceReset(IPacketReceiver client, MapId mapId)
 {
     using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_UPDATE_LAST_INSTANCE, 4))
     {
         packet.Write((int)mapId);
         client.Send(packet);
     }
 }
开发者ID:ebakkedahl,项目名称:WCell,代码行数:11,代码来源:InstanceHandler.cs

示例8: SendUpdateWorldState

 public static void SendUpdateWorldState(IPacketReceiver rcv, WorldStateId key, int value)
 {
     using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_UPDATE_WORLD_STATE, 300))
     {
         packet.Write((uint)key);
         packet.Write(value);
         rcv.Send(packet);
     }
 }
开发者ID:ebakkedahl,项目名称:WCell,代码行数:9,代码来源:WorldStateHandler.cs

示例9: SendTitleEarned

 public static void SendTitleEarned(Character character, CharacterTitleEntry titleEntry, bool lost)
 {
     using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_TITLE_EARNED, 4 + 4))
     {
         packet.WriteUInt((uint) titleEntry.BitIndex);
         packet.WriteUInt(lost ? 0 : 1);
         character.Send(packet);
     }
 }
开发者ID:remixod,项目名称:netServer,代码行数:9,代码来源:TitleHandler.cs

示例10: SendSpellsAndCooldowns

		/// <summary>
		/// Sends initially all spells and item cooldowns to the character
		/// </summary>
		public static void SendSpellsAndCooldowns(Character chr)
		{
			var spells = chr.PlayerSpells;

			var len = 5 + (4 * spells.Count); // +(14 * cooldowns);
			using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_INITIAL_SPELLS, len))
			{
				packet.Write((byte) 0);
				packet.Write((ushort) spells.Count);

				foreach (var spell in spells.AllSpells)
				{
					packet.Write(spell.Id);
					//packet.Write((ushort)0xEEEE);
					packet.Write((ushort) 0);
				}

				var countPos = packet.Position;
				ushort cooldownCount = 0;
				packet.Position = countPos + 2;

				// cooldowns
				var now = DateTime.Now.Ticks;
				foreach (var idCd in spells.IdCooldowns)
				{
					var delay = (int)(idCd.Until.Ticks - now);
					if (delay > 10)
					{
						cooldownCount++;
						packet.Write(idCd.SpellId);
						packet.Write((ushort) idCd.ItemId);
						packet.Write((ushort) 0);
						packet.Write(Utility.ToMilliSecondsInt(delay));
						packet.Write(0);
					}
				}
				
				foreach (var catCd in spells.CategoryCooldowns)
				{
					var delay = (int)(catCd.Until.Ticks - now);
					if (delay > 10)
					{
						cooldownCount++;
						packet.Write(catCd.SpellId);
						packet.Write((ushort) catCd.ItemId);
						packet.Write((ushort) catCd.CategoryId);
						packet.Write(0);
						packet.Write(Utility.ToMilliSecondsInt(delay));
					}
				}

				packet.Position = countPos;
				packet.Write(cooldownCount);

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

示例11: SendCombatStart

		/// <summary>
		/// Make sure, we have a valid target before calling this method
		/// </summary>
		public static void SendCombatStart(Unit chr, Unit opponent, bool includeSelf)
		{
			using (RealmPacketOut packet = new RealmPacketOut(RealmServerOpCode.SMSG_ATTACKSTART, 16)) {
				chr.EntityId.WritePacked(packet);
				opponent.EntityId.WritePacked(packet);

				chr.PushPacketToSurroundingArea(packet, includeSelf, false);
			}
		}
开发者ID:pallmall,项目名称:WCell,代码行数:12,代码来源:CombatMgr.cs

示例12: SendTutorialFlags

		public static void SendTutorialFlags(Character chr)
		{
			using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_TUTORIAL_FLAGS, 32))
			{
				packet.Write(chr.TutorialFlags.FlagData);

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

示例13: SendGameObjectTextPage

        public static void SendGameObjectTextPage(IPacketReceiver rcv, IEntity obj)
        {
            using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_GAMEOBJECT_PAGETEXT, 8))
            {
                packet.Write(obj.EntityId);

                rcv.Send(packet);
            }
        }
开发者ID:Zakkgard,项目名称:WCell,代码行数:9,代码来源:MiscHandler.cs

示例14: AddPacket

        public void AddPacket(RealmPacketOut packet)
        {
            if (packet.ContentLength > 255)
                throw new InvalidDataException("Packets added to a compressed stream must have length less than 255");

            backingStream.Write((byte)packet.ContentLength);
            backingStream.Write((ushort)packet.OpCode);
            backingStream.Write(packet.GetFinalizedPacket(), packet.HeaderSize, packet.ContentLength);
        }
开发者ID:KroneckerX,项目名称:WCell,代码行数:9,代码来源:CompressedPacket.cs

示例15: SendOutOfBounds

		public static void SendOutOfBounds(Character duelist, uint cancelDelayMillis)
		{
            using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_DUEL_OUTOFBOUNDS, 4))
            {
                packet.Write(cancelDelayMillis);

                duelist.Send(packet);
            }
		}
开发者ID:ray2006,项目名称:WCell,代码行数:9,代码来源:DuelHandler.cs


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