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); }
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 }
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); }
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); } }
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 } }
protected virtual void WriteUpdateFlag_0x10(PrimitiveWriter writer, UpdateFieldFlags relation) { writer.Write(1); }
protected virtual void WriteUpdateFlag_0x8(PrimitiveWriter writer, UpdateFieldFlags relation) { writer.Write(EntityId.LowRaw); }
/// <summary> /// Writes all the blocks to the packet /// </summary> /// <param name="packet">The packet to write to</param> public void WriteFull(PrimitiveWriter packet) { packet.Write((byte)m_maxBlockCount); for (int i = 0; i < m_maxBlockCount; i++) { packet.Write(m_blocks[i]); } }
/// <summary> /// Writes the bit mask of all required fields /// </summary> /// <param name="packet">The packet to write to</param> public void WriteTo(PrimitiveWriter packet) { //var valueCount = (m_highestIndex + 31) >> 5; var valueCount = (m_highestIndex >> 5) + 1; packet.Write((byte)valueCount); for (var i = 0; i < valueCount; i++) { packet.Write(m_blocks[i]); } }
public void WriteReconnectChallenge(PrimitiveWriter packet) { ReconnectProof = new byte[16]; new System.Random(System.Environment.TickCount).NextBytes(ReconnectProof); packet.Write(ReconnectProof); // 16 bytes of 0's packet.Write(0L); packet.Write(0L); }
protected override void WriteTypeSpecificMovementUpdate(PrimitiveWriter writer, UpdateFieldFlags relation, UpdateFlags updateFlags) { // Probably specific to Unit if (updateFlags.HasFlag(UpdateFlags.AttackingTarget)) { writer.Write((byte)0); // pguid } }
/// <summary> /// Writes the data shared in movement packets and the create block of the update packet /// This is used in /// <list type="String"> /// SMSG_UPDATE_OBJECT /// MSG_MOVE_* /// MSG_MOVE_SET_*_SPEED /// </list> /// </summary> /// <param name="packet"></param> public void WriteMovementPacketInfo(PrimitiveWriter packet, ref Vector3 pos, float orientation) { var moveFlags = MovementFlags; var moveFlags2 = MovementFlags2; if (moveFlags.HasAnyFlag(MovementFlags.OnTransport) && TransportInfo == null) { // should never happen moveFlags ^= MovementFlags.OnTransport; } packet.Write((uint)moveFlags); packet.Write((ushort)moveFlags2); packet.Write(Utility.GetSystemTime()); packet.Write(pos.X); packet.Write(pos.Y); packet.Write(pos.Z); packet.Write(orientation); if (moveFlags.HasAnyFlag(MovementFlags.OnTransport)) { // ReSharper disable PossibleNullReferenceException TransportInfo.EntityId.WritePacked(packet); // ReSharper restore PossibleNullReferenceException packet.Write(TransportPosition.X); packet.Write(TransportPosition.Y); packet.Write(TransportPosition.Z); packet.Write(TransportOrientation); packet.Write(TransportTime); packet.Write(TransportSeat); } if (moveFlags.HasAnyFlag(MovementFlags.Swimming | MovementFlags.Flying) || moveFlags2.HasFlag(MovementFlags2.AlwaysAllowPitching)) { packet.Write(PitchRate); } packet.Write(0); // air time if (moveFlags.HasAnyFlag(MovementFlags.Falling)) { // yet somewhat unknown values (Client sends them) packet.Write(0f); packet.Write(8f); packet.Write(0.2f); packet.Write(1f); } if (moveFlags.HasAnyFlag(MovementFlags.SplineElevation)) { packet.Write(0.0f); } }
protected override void WriteUpdateFlag_0x10(PrimitiveWriter writer, UpdateFieldFlags relation) { writer.Write(150754760); // TODO - wtf? //base.WriteUpdateFlag_0x10(writer, relation); }
protected override void WriteMovementUpdate(PrimitiveWriter writer, UpdateFieldFlags relation) { // UpdateFlag.StationaryObject writer.Write(Position); writer.WriteFloat(Orientation); }
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 } }
protected override void WriteUpdateFlag_0x10(PrimitiveWriter writer, UpdateFieldFlags relation) { writer.Write(150754760); // ? }