Skip to content

Commit

Permalink
Changes to support PCAP exported data being used in database (#1116)
Browse files Browse the repository at this point in the history
* Add PCAPRecorded properties and enums

* Adjust CalculateObjDesc to read and use Biota data if present and no EquippedObjects are found

* Fix issue with telepoi command

* Update changelog.md
  • Loading branch information
LtRipley36706 committed Dec 7, 2018
1 parent d750664 commit 5dbd24e
Show file tree
Hide file tree
Showing 10 changed files with 109 additions and 5 deletions.
8 changes: 8 additions & 0 deletions Source/ACE.Database/SQLFormatters/SQLWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,14 @@ protected string GetValueEnumName(PropertyDataId property, uint value)
}
}
break;
case PropertyDataId.PCAPRecordedObjectDesc:
return ((ObjectDescriptionFlag)value).ToString();
case PropertyDataId.PCAPRecordedPhysicsDesc:
return ((PhysicsDescriptionFlag)value).ToString();
case PropertyDataId.PCAPRecordedWeenieHeader:
return ((WeenieHeaderFlag)value).ToString();
case PropertyDataId.PCAPRecordedWeenieHeader2:
return ((WeenieHeaderFlag2)value).ToString();
}

return property.GetValueEnumName(value);
Expand Down
3 changes: 3 additions & 0 deletions Source/ACE.Entity/Enum/Properties/PositionType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -177,5 +177,8 @@ public enum PositionType : ushort
/// </summary>
RelativeDestination = 26,
TeleportedCharacter = 27,

[ServerOnly]
PCAPRecordedLocation = 8040
}
}
34 changes: 34 additions & 0 deletions Source/ACE.Entity/Enum/Properties/PropertyDataId.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,37 @@ public enum PropertyDataId : ushort
[ServerOnly]
OlthoiDeathTreasureType = 61,

[ServerOnly]
PCAPRecordedWeenieHeader = 8001,
[ServerOnly]
PCAPRecordedWeenieHeader2 = 8002,
[ServerOnly]
PCAPRecordedObjectDesc = 8003,
[ServerOnly]
PCAPRecordedPhysicsDesc = 8005,
[ServerOnly]
PCAPRecordedParentLocation = 8003,
[ServerOnly]
PCAPRecordedDefaultScript = 8019,
[ServerOnly]
PCAPRecordedTimestamp1 = 8021,
[ServerOnly]
PCAPRecordedTimestamp2 = 8022,
[ServerOnly]
PCAPRecordedTimestamp3 = 8023,
[ServerOnly]
PCAPRecordedTimestamp4 = 8024,
[ServerOnly]
PCAPRecordedTimestamp5 = 8025,
[ServerOnly]
PCAPRecordedTimestamp6 = 8026,
[ServerOnly]
PCAPRecordedTimestamp7 = 8027,
[ServerOnly]
PCAPRecordedTimestamp8 = 8028,
[ServerOnly]
PCAPRecordedTimestamp9 = 8029

//[ServerOnly]
//HairTexture = 9001,
//[ServerOnly]
Expand Down Expand Up @@ -169,6 +200,9 @@ public static string GetValueEnumName(this PropertyDataId property, uint value)
case PropertyDataId.DeathTreasureType:
// todo
break;

case PropertyDataId.PCAPRecordedParentLocation:
return System.Enum.GetName(typeof(ParentLocation), value);
}

return null;
Expand Down
23 changes: 22 additions & 1 deletion Source/ACE.Entity/Enum/Properties/PropertyFloat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,28 @@ public enum PropertyFloat : ushort
[SendOnLogin]
WeaponAuraElemental = 170,
[SendOnLogin]
WeaponAuraManaConv = 171
WeaponAuraManaConv = 171,

[ServerOnly]
PCAPRecordedWorkmanship = 8004,
[ServerOnly]
PCAPRecordedVelocityX = 8010,
[ServerOnly]
PCAPRecordedVelocityY = 8011,
[ServerOnly]
PCAPRecordedVelocityZ = 8012,
[ServerOnly]
PCAPRecordedAccelerationX = 8013,
[ServerOnly]
PCAPRecordedAccelerationY = 8014,
[ServerOnly]
PCAPRecordedAccelerationZ = 8015,
[ServerOnly]
PCAPRecordeOmegaX = 8016,
[ServerOnly]
PCAPRecordeOmegaY = 8017,
[ServerOnly]
PCAPRecordeOmegaZ = 8018
}

public static class PropertyFloatExtensions
Expand Down
7 changes: 6 additions & 1 deletion Source/ACE.Entity/Enum/Properties/PropertyInstanceId.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,12 @@ public enum PropertyInstanceId : ushort
TeleportedCharacter = 42,
Pet = 43,
PetOwner = 44,
PetDevice = 45
PetDevice = 45,

[ServerOnly]
PCAPRecordedObjectIID = 8000,
[ServerOnly]
PCAPRecordedParentIID = 8008
}

public static class PropertyInstanceIdExtensions
Expand Down
3 changes: 3 additions & 0 deletions Source/ACE.Entity/Enum/Properties/PropertyInt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,9 @@ public enum PropertyInt : ushort
[SendOnLogin]
Enlightenment = 390,

[ServerOnly]
PCAPRecordedAutonomousMovement = 8007,

//[ServerOnly]
//TotalLogins = 9001,
//[ServerOnly]
Expand Down
5 changes: 4 additions & 1 deletion Source/ACE.Entity/Enum/Properties/PropertyString.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@ public enum PropertyString : ushort
UseSendsSignal = 51,

[Description("Gear Plating Name")]
GearPlatingName = 52
GearPlatingName = 52,

[ServerOnly]
PCAPRecordedCurrentMotionState = 8006
}

public static class PropertyStringExtensions
Expand Down
4 changes: 3 additions & 1 deletion Source/ACE.Server/Command/Handlers/AdminCommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,9 @@ public static void HandleTeleportPoi(Session session, params string[] parameters
if (teleportPOI == null)
return;
var weenie = DatabaseManager.World.GetCachedWeenie(teleportPOI.WeenieClassId);
session.Player.Teleport(weenie.GetPosition(PositionType.Destination));
var portalDest = new Position(weenie.GetPosition(PositionType.Destination));
session.Player.AdjustDungeon(portalDest);
session.Player.Teleport(portalDest);
}
}

Expand Down
21 changes: 20 additions & 1 deletion Source/ACE.Server/WorldObjects/Creature_Networking.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,26 @@ public override ACE.Entity.ObjDesc CalculateObjDesc()
}
}

foreach (var w in EquippedObjects.Values.Where(x => (x.CurrentWieldedLocation & (EquipMask.Clothing | EquipMask.Armor | EquipMask.Cloak)) != 0).OrderBy(x => x.Priority))
var eo = EquippedObjects.Values.Where(x => (x.CurrentWieldedLocation & (EquipMask.Clothing | EquipMask.Armor | EquipMask.Cloak)) != 0).OrderBy(x => x.Priority).ToList();

if (eo.Count == 0)
{
if (Biota.BiotaPropertiesAnimPart.Count > 0 || Biota.BiotaPropertiesPalette.Count > 0 || Biota.BiotaPropertiesTextureMap.Count > 0)
{
foreach (var animPart in Biota.BiotaPropertiesAnimPart.OrderBy(b => b.Order))
objDesc.AnimPartChanges.Add(new ACE.Entity.AnimationPartChange { PartIndex = animPart.Index, PartID = animPart.AnimationId });

foreach (var subPalette in Biota.BiotaPropertiesPalette)
objDesc.SubPalettes.Add(new ACE.Entity.SubPalette { SubID = subPalette.SubPaletteId, Offset = subPalette.Offset, NumColors = subPalette.Length });

foreach (var textureMap in Biota.BiotaPropertiesTextureMap.OrderBy(b => b.Order))
objDesc.TextureChanges.Add(new ACE.Entity.TextureMapChange { PartIndex = textureMap.Index, OldTexture = textureMap.OldId, NewTexture = textureMap.NewId });

return objDesc;
}
}

foreach (var w in eo)
{
if ((w.CurrentWieldedLocation == EquipMask.HeadWear) && !showHelm && (this is Player))
continue;
Expand Down
6 changes: 6 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# ACEmulator Change Log

### 2018-12-07
[Ripley]
* Added some properties so the SQL writers could annotate them for readability (PCAP imported properties, used for dev reference only)
* Updated Creature.CalculateObjDesc to support reading in of PCAP'd ObjDesc data. This bootstraps weenie appearance without the need to divine clothing data (base and objects(palette + shade))
* Fix issue with telepoi command

### 2018-11-29
[Mag-nus]
* Improved design and performance for SequenceManager
Expand Down

0 comments on commit 5dbd24e

Please sign in to comment.