Пример #1
0
 protected override void WriteMovementUpdate(PrimitiveWriter writer, UpdateFieldFlags relation)
 {
     writer.Write(this.Position.X);
     writer.Write(this.Position.Y);
     writer.Write(this.Position.Z);
     writer.WriteFloat(this.Orientation);
 }
Пример #2
0
        protected override void WriteMovementUpdate(PrimitiveWriter packet, UpdateFieldFlags relation)
        {
            WriteMovementPacketInfo(packet);

            #region Speed Block

            packet.Write(WalkSpeed);
            packet.Write(RunSpeed);
            packet.Write(RunBackSpeed);
            packet.Write(SwimSpeed);
            packet.Write(SwimBackSpeed);
            packet.Write(FlightSpeed);
            packet.Write(FlightBackSpeed);
            packet.Write(TurnSpeed);
            packet.Write(PitchRate);

            #endregion

            #region Spline Info
            if (MovementFlags.HasFlag(MovementFlags.SplineEnabled))
            {
                // TODO: Write spline flags
                //var splineFlags = SplineFlags.None;
            }

            #endregion
        }
Пример #3
0
        protected override void WriteMovementUpdate(PrimitiveWriter packet, UpdateFieldFlags relation)
        {
            WriteMovementPacketInfo(packet);

            #region Speed Block

            packet.Write(WalkSpeed);
            packet.Write(RunSpeed);
            packet.Write(RunBackSpeed);
            packet.Write(SwimSpeed);
            packet.Write(SwimBackSpeed);
            packet.Write(FlightSpeed);
            packet.Write(FlightBackSpeed);
            packet.Write(TurnSpeed);
            packet.Write(PitchRate);

            #endregion Speed Block

            #region Spline Info

            if (MovementFlags.HasFlag(MovementFlags.SplineEnabled))
            {
                // TODO: Write spline flags
                //var splineFlags = SplineFlags.None;
            }

            #endregion Spline Info
        }
Пример #4
0
 protected override UpdateType GetCreationUpdateType(UpdateFieldFlags relation)
 {
     if (relation.HasAnyFlag(UpdateFieldFlags.Private | UpdateFieldFlags.OwnerOnly))
     {
         return(UpdateType.CreateSelf);
     }
     return(UpdateType.Create);
 }
Пример #5
0
 protected override void WriteMovementUpdate(PrimitiveWriter writer, UpdateFieldFlags relation)
 {
     // UpdateFlag.HasPosition
     writer.Write(Position.X);
     writer.Write(Position.Y);
     writer.Write(Position.Z);
     writer.WriteFloat(Orientation);
 }
Пример #6
0
 protected override UpdateType GetCreationUpdateType(UpdateFieldFlags relation)
 {
     if (m_entry is GODuelFlagEntry)
     {
         return(UpdateType.CreateSelf);
     }
     return(UpdateType.Create);
 }
Пример #7
0
 protected override void WriteMovementUpdate(PrimitiveWriter writer, UpdateFieldFlags relation)
 {
     // UpdateFlag.HasPosition
 	writer.Write(Position.X);
 	writer.Write(Position.Y);
 	writer.Write(Position.Z);
     writer.WriteFloat(Orientation);
 }
        private void FlagFinder(UpdateFieldFlags toSearch)
        {
            var query = from field in m_updateFieldList
                        where (field.Flags & toSearch) == toSearch
                        select field;

            Console.WriteLine("Flag: {0}", toSearch);
            foreach (var field in query)
            {
                Console.WriteLine("{0}: {1} - {2}", field.Size, field.Name, field.Flags);
            }
        }
Пример #9
0
 protected override void WriteMovementUpdate(PrimitiveWriter packet, UpdateFieldFlags relation)
 {
     if (UpdateFlags.HasAnyFlag(UpdateFlags.StationaryObjectOnTransport))
     {
         EntityId.Zero.WritePacked(packet);
         packet.Write(Position);
         packet.Write(Position);
         packet.Write(Orientation);
         packet.Write(0.0f);
     }
     else
     {
         if (!UpdateFlags.HasAnyFlag(UpdateFlags.StationaryObject))
         {
             return;
         }
         packet.Write(Position);
         packet.WriteFloat(Orientation);
     }
 }
Пример #10
0
        protected override void WriteMovementUpdate(PrimitiveWriter packet, UpdateFieldFlags relation)
        {
            if (UpdateFlags.HasAnyFlag(UpdateFlags.StationaryObjectOnTransport))
            {
                // corpses had this, but seemed to just send their own info for both
                EntityId.Zero.WritePacked(packet);
                packet.Write(Position);
                packet.Write(Position); // transport position, but server seemed to send normal position except orientation
                packet.Write(Orientation);
                packet.Write(Orientation);
            }
            else if (UpdateFlags.HasAnyFlag(UpdateFlags.StationaryObject))
            {
                #region UpdateFlag.Flag_0x40 (StationaryObject)

                packet.Write(Position);
                packet.WriteFloat(Orientation);

                #endregion
            }
        }
Пример #11
0
 protected override UpdateType GetCreationUpdateType(UpdateFieldFlags relation)
 {
     return(UpdateType.Create);
 }
Пример #12
0
		public static bool HasAnyFlag(this UpdateFieldFlags flags, UpdateFieldFlags otherFlags)
		{
			return (flags & otherFlags) != 0;
		}
Пример #13
0
		protected override void WriteTypeSpecificMovementUpdate(PrimitiveWriter writer, UpdateFieldFlags relation, UpdateFlags updateFlags)
		{
			// Will only be GameObjects
			if (updateFlags.HasAnyFlag(UpdateFlags.Transport))
			{
				writer.Write(Utility.GetSystemTime());
			}
			if (updateFlags.HasAnyFlag(UpdateFlags.HasRotation))
			{
				writer.Write(Rotation);
			}
		}
Пример #14
0
 public static bool HasAnyFlag(this UpdateFieldFlags flags, UpdateFieldFlags otherFlags)
 {
     return((flags & otherFlags) != UpdateFieldFlags.None);
 }
Пример #15
0
 protected override void WriteUpdateFlag_0x10(PrimitiveWriter writer, UpdateFieldFlags relation)
 {
     writer.Write(150754760); // ?
 }
Пример #16
0
		protected override UpdateType GetCreationUpdateType(UpdateFieldFlags flags)
		{
			return (flags & UpdateFieldFlags.Private) != 0 ? UpdateType.CreateSelf : UpdateType.Create;
		}
Пример #17
0
 /// <summary>
 /// Writes the major portion of the create block.
 /// This handles flags 0x20, 0x40, and 0x100, they are exclusive to each other
 /// The content depends on the object's type
 /// </summary>
 /// <param name="writer"></param>
 /// <param name="relation"></param>
 protected virtual void WriteMovementUpdate(PrimitiveWriter writer, UpdateFieldFlags relation)
 {
 }
Пример #18
0
		protected override UpdateType GetCreationUpdateType(UpdateFieldFlags relation)
		{
			return UpdateType.Create;
		}
Пример #19
0
 protected override void WriteMovementUpdate(PrimitiveWriter writer, UpdateFieldFlags relation)
 {
     // UpdateFlag.StationaryObject
     writer.Write(Position);
     writer.WriteFloat(Orientation);
 }
Пример #20
0
 protected virtual void WriteUpdateFlag_0x10(PrimitiveWriter writer, UpdateFieldFlags relation)
 {
     writer.Write(1);
 }
Пример #21
0
 protected override void WriteTypeSpecificMovementUpdate(PrimitiveWriter writer, UpdateFieldFlags relation, UpdateFlags updateFlags)
 {
     // Probably specific to Unit
     if (updateFlags.HasFlag(UpdateFlags.AttackingTarget))
     {
         writer.Write((byte)0);                 // pguid
     }
 }
Пример #22
0
		protected override void WriteMovementUpdate(PrimitiveWriter packet, UpdateFieldFlags relation)
		{
            if (UpdateFlags.Has(UpdateFlags.StationaryObjectOnTransport))
            {
                // corpses had this, but seemed to just send their own info for both
                EntityId.Zero.WritePacked(packet);
                packet.Write(Position);
                packet.Write(Position); // transport position, but server seemed to send normal position except orientation
                packet.Write(Orientation);
                packet.Write(Orientation);
            }
            else if (UpdateFlags.Has(UpdateFlags.StationaryObject))
            {
                #region UpdateFlag.Flag_0x40 (StationaryObject)

                packet.Write(Position);
                packet.WriteFloat(Orientation);

                #endregion
            }
		}
Пример #23
0
 protected override void WriteUpdateFlag_0x10(PrimitiveWriter writer, UpdateFieldFlags relation)
 {
     writer.Write(150754760); // TODO - wtf?
     //base.WriteUpdateFlag_0x10(writer, relation);
 }
Пример #24
0
 protected override void WriteTypeSpecificMovementUpdate(PrimitiveWriter writer, UpdateFieldFlags relation, UpdateFlags updateFlags)
 {
     // Probably specific to Unit
     if (updateFlags.HasFlag(UpdateFlags.AttackingTarget))
     {
         writer.Write((byte)0); // pguid
     }
 }
Пример #25
0
		protected abstract UpdateType GetCreationUpdateType(UpdateFieldFlags relation);
Пример #26
0
 protected override void WriteTypeSpecificMovementUpdate(PrimitiveWriter writer, UpdateFieldFlags relation, UpdateFlags updateFlags)
 {
     base.WriteTypeSpecificMovementUpdate(writer, relation, updateFlags);
     writer.Write(m_entry.VehicleId);
     writer.Write(m_entry.VehicleAimAdjustment);
 }
Пример #27
0
		protected override UpdateType GetCreationUpdateType(UpdateFieldFlags flags)
		{
			return flags.HasAnyFlag(UpdateFieldFlags.Private) ? UpdateType.CreateSelf : UpdateType.Create;
		}
Пример #28
0
 protected override void WriteUpdateFlag_0x10(Core.Network.PrimitiveWriter writer, UpdateFieldFlags relation)
 {
     //base.WriteUpdateFlag_0x10(writer, relation);
     writer.Write(2f);
 }
Пример #29
0
 protected override UpdateType GetCreationUpdateType(UpdateFieldFlags relation)
 {
     return(this.m_entry is GODuelFlagEntry ? UpdateType.CreateSelf : UpdateType.Create);
 }
Пример #30
0
		protected override UpdateType GetCreationUpdateType(UpdateFieldFlags relation)
		{
			if (m_entry is GODuelFlagEntry)
			{
				return UpdateType.CreateSelf;
			}
			return UpdateType.Create;
		}
Пример #31
0
        protected void WriteUpdateValues(bool forCreation, Character receiver, UpdateFieldFlags relation)
        {
            UpdateMask mask;

            if (forCreation)
            {
                // completely new
                var pos = receiver.m_updatePacket.Position;
                mask = new UpdateMask(m_highestUsedUpdateIndex);
                receiver.m_updatePacket.Position = pos + 1 + (4 * mask.MaxBlockCount);                  // skip over the index block
                for (var i = 0; i <= m_highestUsedUpdateIndex; i++)
                {
                    var flags = _UpdateFieldInfos.FieldFlags[i];
                    if (flags.HasAnyFlag(relation) && m_updateValues[i].UInt32 != 0)
                    {
                        mask.SetBit(i);
                        WriteUpdateValue(receiver.m_updatePacket, receiver, i);
                    }
                }
                var newPos = receiver.m_updatePacket.Position;
                receiver.m_updatePacket.Position = pos;
                mask.WriteFull(receiver.m_updatePacket);                                                                                // write the full index block
                receiver.m_updatePacket.Position = newPos;
                return;
                //WriteUpdateValues(receiver, relation, 0, _UpdateFieldInfos.Fields.Length, true);
            }

            if (relation.HasAnyFlag(UpdateFieldFlags.Private))
            {
                // Private
                mask = m_privateUpdateMask;
            }
            else if (relation.HasAnyFlag(UpdateFieldFlags.OwnerOnly | UpdateFieldFlags.GroupOnly))
            {
                // Group or Owner
                var pos = receiver.m_updatePacket.Position;
                mask = new UpdateMask(m_privateUpdateMask.m_highestIndex);
                receiver.m_updatePacket.Position = pos + 1 + (4 * mask.MaxBlockCount);          // skip over the index block
                for (var i = m_privateUpdateMask.m_lowestIndex; i <= m_privateUpdateMask.m_highestIndex; i++)
                {
                    var flags = _UpdateFieldInfos.FieldFlags[i];
                    if (flags.HasAnyFlag(relation) &&
                        (!flags.HasAnyFlag(UpdateFieldFlags.Public) || m_publicUpdateMask.GetBit(i)))
                    {
                        mask.SetBit(i);
                        WriteUpdateValue(receiver.m_updatePacket, receiver, i);
                    }
                }
                var newPos = receiver.m_updatePacket.Position;
                receiver.m_updatePacket.Position = pos;
                mask.WriteFull(receiver.m_updatePacket);                                                                        // write the full index block
                receiver.m_updatePacket.Position = newPos;
                //WriteUpdateValues(receiver, relation, m_privateUpdateMask.m_lowestIndex, m_privateUpdateMask.m_highestIndex, false);
                return;
            }
            else
            {
                // Public
                mask = m_publicUpdateMask;
            }

            mask.WriteTo(receiver.m_updatePacket);

            for (var i = mask.m_lowestIndex; i <= mask.m_highestIndex; i++)
            {
                if (mask.GetBit(i))
                {
                    WriteUpdateValue(receiver.m_updatePacket, receiver, i);
                }
            }
        }
Пример #32
0
 protected virtual void WriteUpdateFlag_0x8(PrimitiveWriter writer, UpdateFieldFlags relation)
 {
     writer.Write(EntityId.LowRaw);
 }
Пример #33
0
		protected override void WriteMovementUpdate(PrimitiveWriter writer, UpdateFieldFlags relation)
		{
			// UpdateFlag.StationaryObject
			writer.Write(Position);
			writer.WriteFloat(Orientation);
		}
Пример #34
0
 protected virtual void WriteTypeSpecificMovementUpdate(PrimitiveWriter writer, UpdateFieldFlags relation, UpdateFlags updateFlags)
 {
 }
Пример #35
0
 protected override UpdateType GetCreationUpdateType(UpdateFieldFlags flags)
 {
     return(flags.HasAnyFlag(UpdateFieldFlags.Private) ? UpdateType.CreateSelf : UpdateType.Create);
 }
Пример #36
0
		protected void WriteUpdateValues(bool forCreation, Character receiver, UpdateFieldFlags relation)
		{
			UpdateMask mask;
			if (forCreation)
			{
				// completely new
				var pos = receiver.m_updatePacket.Position;
				mask = new UpdateMask(m_highestUsedUpdateIndex);
				receiver.m_updatePacket.Position = pos + 1 + (4 * mask.MaxBlockCount);	// skip over the index block
				for (var i = 0; i <= m_highestUsedUpdateIndex; i++)
				{
					var flags = _UpdateFieldInfos.FieldFlags[i];
					if (flags.HasAnyFlag(relation) && m_updateValues[i].UInt32 != 0)
					{
						mask.SetBit(i);
						WriteUpdateValue(receiver.m_updatePacket, receiver, i);
					}
				}
				var newPos = receiver.m_updatePacket.Position;
				receiver.m_updatePacket.Position = pos;
				mask.WriteFull(receiver.m_updatePacket);								// write the full index block
				receiver.m_updatePacket.Position = newPos;
				return;
				//WriteUpdateValues(receiver, relation, 0, _UpdateFieldInfos.Fields.Length, true);
			}

			if (relation.HasAnyFlag(UpdateFieldFlags.Private))
		    {
		        // Private
		        mask = m_privateUpdateMask;
		    }
		    else if (relation.HasAnyFlag(UpdateFieldFlags.OwnerOnly | UpdateFieldFlags.GroupOnly))
		    {
		        // Group or Owner
		        var pos = receiver.m_updatePacket.Position;
		        mask = new UpdateMask(m_privateUpdateMask.m_highestIndex);
		        receiver.m_updatePacket.Position = pos + 1 + (4 * mask.MaxBlockCount);	// skip over the index block
		        for (var i = m_privateUpdateMask.m_lowestIndex; i <= m_privateUpdateMask.m_highestIndex; i++)
		        {
		            var flags = _UpdateFieldInfos.FieldFlags[i];
					if (flags.HasAnyFlag(relation) &&
						(!flags.HasAnyFlag(UpdateFieldFlags.Public) || m_publicUpdateMask.GetBit(i)))
                    {
                        mask.SetBit(i);
                        WriteUpdateValue(receiver.m_updatePacket, receiver, i);
                    }
		        }
		        var newPos = receiver.m_updatePacket.Position;
		        receiver.m_updatePacket.Position = pos;
		        mask.WriteFull(receiver.m_updatePacket);								// write the full index block
		        receiver.m_updatePacket.Position = newPos;
		        //WriteUpdateValues(receiver, relation, m_privateUpdateMask.m_lowestIndex, m_privateUpdateMask.m_highestIndex, false);
		        return;
		    }
		    else
		    {
		        // Public
		        mask = m_publicUpdateMask;
		    }

		    mask.WriteTo(receiver.m_updatePacket);

		    for (var i = mask.m_lowestIndex; i <= mask.m_highestIndex; i++)
		    {
		        if (mask.GetBit(i))
		        {
		            WriteUpdateValue(receiver.m_updatePacket, receiver, i);
		        }
		    }
		}
Пример #37
0
 protected abstract UpdateType GetCreationUpdateType(UpdateFieldFlags relation);
Пример #38
0
 protected override UpdateType GetCreationUpdateType(UpdateFieldFlags relation)
 {
     if (relation.HasAnyFlag(UpdateFieldFlags.Private | UpdateFieldFlags.OwnerOnly))
     {
         return UpdateType.CreateSelf;
     }
     return UpdateType.Create;
 }
Пример #39
0
 protected virtual void WriteUpdateFlag_0x8(PrimitiveWriter writer, UpdateFieldFlags relation)
 {
     writer.Write(this.EntityId.LowRaw);
 }
Пример #40
0
 protected override void WriteTypeSpecificMovementUpdate(PrimitiveWriter writer, UpdateFieldFlags relation,
                                                         UpdateFlags updateFlags)
 {
     if (updateFlags.HasAnyFlag(UpdateFlags.Transport))
     {
         writer.Write(Utility.GetSystemTime());
     }
     if (!updateFlags.HasAnyFlag(UpdateFlags.HasRotation))
     {
         return;
     }
     writer.Write(Rotation);
 }
Пример #41
0
 protected virtual void WriteUpdateFlag_0x10(PrimitiveWriter writer, UpdateFieldFlags relation)
 {
     writer.Write(1);
 }
Пример #42
0
		protected override void WriteMovementUpdate(PrimitiveWriter packet, UpdateFieldFlags relation)
		{
			// StationaryObjectOnTransport
			if (UpdateFlags.HasAnyFlag(UpdateFlags.StationaryObjectOnTransport))
			{
				EntityId.Zero.WritePacked(packet);
				packet.Write(Position);
				packet.Write(Position); // transport position, but server seemed to send normal position except orientation
				packet.Write(Orientation);
				packet.Write(0.0f);
			}
			else if (UpdateFlags.HasAnyFlag(UpdateFlags.StationaryObject))
			{
				#region UpdateFlag.Flag_0x40 (StationaryObject)

				packet.Write(Position);
				packet.WriteFloat(Orientation);

				#endregion
			}
		}
Пример #43
0
 protected virtual void WriteTypeSpecificMovementUpdate(PrimitiveWriter writer, UpdateFieldFlags relation,
                                                        UpdateFlags updateFlags)
 {
 }
Пример #44
0
		protected override void WriteTypeSpecificMovementUpdate(PrimitiveWriter writer, UpdateFieldFlags relation, UpdateFlags updateFlags)
		{
			base.WriteTypeSpecificMovementUpdate(writer, relation, updateFlags);
			writer.Write(m_entry.VehicleId);
			writer.Write(m_entry.VehicleAimAdjustment);
		}
Пример #45
0
 /// <summary>
 /// Writes the major portion of the create block.
 /// This handles flags 0x20, 0x40, and 0x100, they are exclusive to each other
 /// The content depends on the object's type
 /// </summary>
 /// <param name="writer"></param>
 /// <param name="relation"></param>
 protected virtual void WriteMovementUpdate(PrimitiveWriter writer, UpdateFieldFlags relation)
 {
 }
Пример #46
0
 protected override void WriteUpdateFlag_0x10(PrimitiveWriter writer, UpdateFieldFlags relation)
 {
     writer.Write(150754760);
 }
Пример #47
0
 protected override void WriteUpdateFlag_0x10(PrimitiveWriter writer, UpdateFieldFlags relation)
 {
     writer.Write(150754760); // TODO - wtf?
     //base.WriteUpdateFlag_0x10(writer, relation);
 }
Пример #48
0
 protected override void WriteUpdateFlag_0x10(Core.Network.PrimitiveWriter writer, UpdateFieldFlags relation)
 {
     //base.WriteUpdateFlag_0x10(writer, relation);
     writer.Write(2f);
 }
		private void FlagFinder(UpdateFieldFlags toSearch)
		{
			var query = from field in m_updateFieldList
			            where (field.Flags & toSearch) == toSearch
			            select field;

			Console.WriteLine("Flag: {0}", toSearch);
			foreach (var field in query)
			{
				Console.WriteLine("{0}: {1} - {2}", field.Size, field.Name, field.Flags);
			}
		}