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); }
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 }
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 UpdateType GetCreationUpdateType(UpdateFieldFlags relation) { if (relation.HasAnyFlag(UpdateFieldFlags.Private | UpdateFieldFlags.OwnerOnly)) { return(UpdateType.CreateSelf); } return(UpdateType.Create); }
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 UpdateType GetCreationUpdateType(UpdateFieldFlags relation) { if (m_entry is GODuelFlagEntry) { return(UpdateType.CreateSelf); } return(UpdateType.Create); }
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); } }
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); } }
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 } }
protected override UpdateType GetCreationUpdateType(UpdateFieldFlags relation) { return(UpdateType.Create); }
public static bool HasAnyFlag(this UpdateFieldFlags flags, UpdateFieldFlags otherFlags) { return (flags & otherFlags) != 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); } }
public static bool HasAnyFlag(this UpdateFieldFlags flags, UpdateFieldFlags otherFlags) { return((flags & otherFlags) != UpdateFieldFlags.None); }
protected override void WriteUpdateFlag_0x10(PrimitiveWriter writer, UpdateFieldFlags relation) { writer.Write(150754760); // ? }
protected override UpdateType GetCreationUpdateType(UpdateFieldFlags flags) { return (flags & UpdateFieldFlags.Private) != 0 ? UpdateType.CreateSelf : UpdateType.Create; }
/// <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) { }
protected override UpdateType GetCreationUpdateType(UpdateFieldFlags relation) { return UpdateType.Create; }
protected override void WriteMovementUpdate(PrimitiveWriter writer, UpdateFieldFlags relation) { // UpdateFlag.StationaryObject writer.Write(Position); writer.WriteFloat(Orientation); }
protected virtual void WriteUpdateFlag_0x10(PrimitiveWriter writer, UpdateFieldFlags relation) { writer.Write(1); }
protected override void WriteTypeSpecificMovementUpdate(PrimitiveWriter writer, UpdateFieldFlags relation, UpdateFlags updateFlags) { // Probably specific to Unit if (updateFlags.HasFlag(UpdateFlags.AttackingTarget)) { writer.Write((byte)0); // pguid } }
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); // TODO - wtf? //base.WriteUpdateFlag_0x10(writer, relation); }
protected abstract UpdateType GetCreationUpdateType(UpdateFieldFlags relation);
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 UpdateType GetCreationUpdateType(UpdateFieldFlags flags) { return flags.HasAnyFlag(UpdateFieldFlags.Private) ? UpdateType.CreateSelf : UpdateType.Create; }
protected override void WriteUpdateFlag_0x10(Core.Network.PrimitiveWriter writer, UpdateFieldFlags relation) { //base.WriteUpdateFlag_0x10(writer, relation); writer.Write(2f); }
protected override UpdateType GetCreationUpdateType(UpdateFieldFlags relation) { return(this.m_entry is GODuelFlagEntry ? UpdateType.CreateSelf : UpdateType.Create); }
protected override UpdateType GetCreationUpdateType(UpdateFieldFlags relation) { if (m_entry is GODuelFlagEntry) { return UpdateType.CreateSelf; } return UpdateType.Create; }
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); } } }
protected virtual void WriteUpdateFlag_0x8(PrimitiveWriter writer, UpdateFieldFlags relation) { writer.Write(EntityId.LowRaw); }
protected virtual void WriteTypeSpecificMovementUpdate(PrimitiveWriter writer, UpdateFieldFlags relation, UpdateFlags updateFlags) { }
protected override UpdateType GetCreationUpdateType(UpdateFieldFlags flags) { return(flags.HasAnyFlag(UpdateFieldFlags.Private) ? UpdateType.CreateSelf : UpdateType.Create); }
protected override UpdateType GetCreationUpdateType(UpdateFieldFlags relation) { if (relation.HasAnyFlag(UpdateFieldFlags.Private | UpdateFieldFlags.OwnerOnly)) { return UpdateType.CreateSelf; } return UpdateType.Create; }
protected virtual void WriteUpdateFlag_0x8(PrimitiveWriter writer, UpdateFieldFlags relation) { writer.Write(this.EntityId.LowRaw); }
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); }
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 override void WriteUpdateFlag_0x10(PrimitiveWriter writer, UpdateFieldFlags relation) { writer.Write(150754760); }