diff --git a/UdpHosts/GameServer/StaticDB/Loaders/ISDBLoader.cs b/UdpHosts/GameServer/StaticDB/Loaders/ISDBLoader.cs index b6e012e2..2a9b1b14 100644 --- a/UdpHosts/GameServer/StaticDB/Loaders/ISDBLoader.cs +++ b/UdpHosts/GameServer/StaticDB/Loaders/ISDBLoader.cs @@ -4,8 +4,11 @@ namespace GameServer.Data.SDB; using Records.apt; using Records.aptfs; using Records.dbcharacter; +using Records.dbencounterdata; using Records.dbitems; -using Records.dbviusalrecords; +using Records.dbphysicsmaterials; +using Records.dbvisualrecords; +using Records.dbzonemetadata; using Records.vcs; public interface ISDBLoader @@ -14,11 +17,30 @@ public interface ISDBLoader Dictionary LoadCharCreateLoadout(); Dictionary> LoadCharCreateLoadoutSlots(); Dictionary LoadDeployable(); + Dictionary LoadDeployableFunction(); + Dictionary LoadDeployableCategory(); + Dictionary LoadFaction(); + List LoadFactionRelations(); + Dictionary> LoadFactionReputations(); Dictionary LoadMonster(); Dictionary LoadTurret(); + Dictionary LoadPoseType(); + Dictionary LoadCharInfo(); + Dictionary LoadDamageType(); + Dictionary LoadDamageResponse(); + Dictionary LoadDamageResponseDamageType(); + Dictionary LoadTinyObject(); + + // dbencounterdata + Dictionary LoadMapMarkerInfo(); + Dictionary LoadSinCardTemplate(); + + // dbphysicsmaterials + Dictionary LoadPhysicsMaterial(); // dbvisualrecords Dictionary LoadWarpaintPalettes(); + Dictionary LoadVisualRecord(); // dbitems Dictionary LoadAttributeCategory(); @@ -35,11 +57,22 @@ public interface ISDBLoader Dictionary LoadWeaponScope(); Dictionary LoadWeaponUnderbarrel(); Dictionary LoadAmmo(); + Dictionary LoadLevelBand(); + Dictionary LoadResourceNodeBeacon(); + Dictionary, LevelCategoryScalars> LoadLevelCategoryScalars(); + Dictionary LoadFrameProgressionLevel(); + Dictionary LoadBlueprints(); + Dictionary> LoadBlueprintItems(); + Dictionary> LoadBattleframeVisuals(); + + // dbzonemetadata + Dictionary LoadZoneRecord(); // apt Dictionary LoadBaseCommandDef(); Dictionary LoadCommandType(); Dictionary LoadAbilityData(); + Dictionary LoadActiveInitiationCommandDef(); Dictionary LoadImpactApplyEffectCommandDef(); Dictionary LoadConditionalBranchCommandDef(); Dictionary LoadWhileLoopCommandDef(); @@ -51,6 +84,7 @@ public interface ISDBLoader Dictionary LoadInstantActivationCommandDef(); Dictionary LoadStagedActivationCommandDef(); Dictionary LoadStatusEffectData(); + Dictionary> LoadStatusEffectTags(); Dictionary LoadTargetPBAECommandDef(); Dictionary LoadTargetConeAECommandDef(); Dictionary LoadTargetClearCommandDef(); @@ -230,4 +264,5 @@ public interface ISDBLoader Dictionary LoadTurretComponentDef(); Dictionary LoadDeployableComponentDef(); Dictionary LoadSpawnPointComponentDef(); + Dictionary LoadHullSegmentDef(); } \ No newline at end of file diff --git a/UdpHosts/GameServer/StaticDB/Loaders/StaticDBLoader.cs b/UdpHosts/GameServer/StaticDB/Loaders/StaticDBLoader.cs index 83d3cd76..50290504 100644 --- a/UdpHosts/GameServer/StaticDB/Loaders/StaticDBLoader.cs +++ b/UdpHosts/GameServer/StaticDB/Loaders/StaticDBLoader.cs @@ -7,8 +7,11 @@ namespace GameServer.Data.SDB; using Records.apt; using Records.aptfs; using Records.dbcharacter; +using Records.dbencounterdata; using Records.dbitems; -using Records.dbviusalrecords; +using Records.dbphysicsmaterials; +using Records.dbvisualrecords; +using Records.dbzonemetadata; using Records.vcs; using Serilog; using Shared.Common; @@ -51,6 +54,37 @@ public Dictionary LoadDeployable() .ToDictionary(row => row.Id); } + public Dictionary LoadDeployableFunction() + { + return LoadStaticDB("dbcharacter::DeployableFunction") + .ToDictionary(row => row.Id); + } + + public Dictionary LoadDeployableCategory() + { + return LoadStaticDB("dbcharacter::DeployableCategory") + .ToDictionary(row => row.Id); + } + + public Dictionary LoadFaction() + { + return LoadStaticDB("dbcharacter::Faction") + .ToDictionary(row => row.Id); + } + + public List LoadFactionRelations() + { + return LoadStaticDB("dbcharacter::FactionRelations") + .ToList(); + } + + public Dictionary> LoadFactionReputations() + { + return LoadStaticDB("dbcharacter::FactionReputations") + .GroupBy(row => row.FactionId) + .ToDictionary(group => group.Key, group => group.ToList()); + } + public Dictionary LoadMonster() { return LoadStaticDB("dbcharacter::Monster") @@ -63,12 +97,30 @@ public Dictionary LoadTurret() .ToDictionary(row => row.Id); } + public Dictionary LoadMapMarkerInfo() + { + return LoadStaticDB("dbencounterdata::MapMarkerInfo") + .ToDictionary(row => row.Id); + } + + public Dictionary LoadSinCardTemplate() + { + return LoadStaticDB("dbencounterdata::SinCardTemplate") + .ToDictionary(row => row.Id); + } + public Dictionary LoadWarpaintPalettes() { return LoadStaticDB("dbvisualrecords::WarpaintPalette") .ToDictionary(row => row.Id); } + public Dictionary LoadVisualRecord() + { + return LoadStaticDB("dbvisualrecords::VisualRecord") + .ToDictionary(row => row.Id); + } + public Dictionary LoadAttributeCategory() { return LoadStaticDB("dbitems::AttributeCategory") @@ -113,6 +165,13 @@ public Dictionary LoadBattleframe() .ToDictionary(row => row.Id); } + public Dictionary> LoadBattleframeVisuals() + { + return LoadStaticDB("dbitems::BattleframeVisuals") + .GroupBy(row => row.VisualGroup) + .ToDictionary(group => group.Key, group => group.ToList()); + } + public Dictionary LoadAbilityModule() { return LoadStaticDB("dbitems::AbilityModule") @@ -143,6 +202,12 @@ public Dictionary LoadAbilityData() .ToDictionary(row => row.Id); } + public Dictionary LoadActiveInitiationCommandDef() + { + return LoadStaticDB("apt::ActiveInitiationCommandDef") + .ToDictionary(row => row.Id); + } + public Dictionary LoadImpactApplyEffectCommandDef() { return LoadStaticDB("apt::ImpactApplyEffectCommandDef") @@ -877,6 +942,12 @@ public Dictionary LoadSpawnPointComponentDef() .ToDictionary(row => row.Id); } + public Dictionary LoadHullSegmentDef() + { + return LoadStaticDB("vcs::HullSegmentDef") + .ToDictionary(row => row.Id); + } + public Dictionary LoadTargetSingleCommandDef() { return LoadStaticDB("apt::TargetSingleCommandDef") @@ -1309,12 +1380,93 @@ public Dictionary LoadAmmo() .ToDictionary(row => row.Id); } + public Dictionary LoadLevelBand() + { + return LoadStaticDB("dbitems::LevelBand") + .ToDictionary(row => row.Id); + } + + public Dictionary LoadZoneRecord() + { + return LoadStaticDB("dbzonemetadata::ZoneRecord") + .ToDictionary(row => row.Id); + } + public Dictionary LoadResourceNodeBeacon() { return LoadStaticDB("dbitems::ResourceNodeBeacon") .ToDictionary(row => row.Id); } + public Dictionary, LevelCategoryScalars> LoadLevelCategoryScalars() + { + return LoadStaticDB("dbitems::LevelCategoryScalars") + .GroupBy(row => new KeyValuePair(row.AttributeCategory, row.Level)) + .ToDictionary(group => group.Key, group => group.First()); + } + + public Dictionary LoadFrameProgressionLevel() + { + return LoadStaticDB("dbitems::FrameProgressionLevel") + .GroupBy(row => row.Level) + .ToDictionary(group => group.Key, group => group.First()); + } + + public Dictionary LoadBlueprints() + { + return LoadStaticDB("dbitems::Blueprints") + .ToDictionary(row => row.Id); + } + + public Dictionary> LoadBlueprintItems() + { + return LoadStaticDB("dbitems::Blueprint_Items") + .GroupBy(row => row.BlueprintId) + .ToDictionary(group => group.Key, group => group.ToList()); + } + + public Dictionary LoadPhysicsMaterial() + { + return LoadStaticDB("dbphysicsmaterials::PhysicsMaterial") + .ToDictionary(row => row.Id); + } + + public Dictionary LoadDamageType() + { + return LoadStaticDB("dbcharacter::DamageType") + .ToDictionary(row => row.Id); + } + + public Dictionary LoadDamageResponse() + { + return LoadStaticDB("dbcharacter::DamageResponse") + .ToDictionary(row => row.Id); + } + + public Dictionary LoadDamageResponseDamageType() + { + return LoadStaticDB("dbcharacter::DamageResponseDamageType") + .ToDictionary(row => row.Id); + } + + public Dictionary LoadTinyObject() + { + return LoadStaticDB("dbcharacter::TinyObject") + .ToDictionary(row => row.Id); + } + + public Dictionary LoadPoseType() + { + return LoadStaticDB("dbcharacter::PoseType") + .ToDictionary(row => row.PoseId); + } + + public Dictionary LoadCharInfo() + { + return LoadStaticDB("dbcharacter::CharInfo") + .ToDictionary(row => row.Id); + } + private static T[] LoadStaticDB(string tableName) where T : class, new() { @@ -1350,7 +1502,17 @@ private static T[] LoadStaticDB(string tableName) { if (prop.Index != -1) { - prop.PropInfo.SetValue(entry, row[prop.Index], null); + if (prop.PropInfo.PropertyType == typeof(string)) + { + // FauFau SDB parser leaves null characters in strings, which can break things for us if we try to send one of these strings in a network message, so let's make sure that can't happen. + string rawStr = (string)row[prop.Index]; + string cleanStr = rawStr.Replace("\0", string.Empty); + prop.PropInfo.SetValue(entry, cleanStr, null); + } + else + { + prop.PropInfo.SetValue(entry, row[prop.Index], null); + } } else { diff --git a/UdpHosts/GameServer/StaticDB/Records/apt/UpdateWaitAndFireOnceCommandDef.cs b/UdpHosts/GameServer/StaticDB/Records/apt/UpdateWaitAndFireOnceCommandDef.cs index 52f168e1..d8a096a7 100644 --- a/UdpHosts/GameServer/StaticDB/Records/apt/UpdateWaitAndFireOnceCommandDef.cs +++ b/UdpHosts/GameServer/StaticDB/Records/apt/UpdateWaitAndFireOnceCommandDef.cs @@ -2,7 +2,7 @@ namespace GameServer.Data.SDB.Records.apt; public record class UpdateWaitAndFireOnceCommandDef : ICommandDef { public uint Chain { get; set; } - public uint Duration { get; set; } + public uint Duration { get; set; } public uint Id { get; set; } public byte Regop { get; set; } } \ No newline at end of file diff --git a/UdpHosts/GameServer/StaticDB/Records/dbcharacter/DamageType.cs b/UdpHosts/GameServer/StaticDB/Records/dbcharacter/DamageType.cs index 030e2145..4cb4c458 100644 --- a/UdpHosts/GameServer/StaticDB/Records/dbcharacter/DamageType.cs +++ b/UdpHosts/GameServer/StaticDB/Records/dbcharacter/DamageType.cs @@ -1,10 +1,11 @@ namespace GameServer.Data.SDB.Records.dbcharacter; + public record class DamageType { public uint LocalizedNameId { get; set; } public string Color { get; set; } public uint IconAssetId { get; set; } public string Name { get; set; } - public ushort DamageReduction { get; set; } + public ushort DamageReductionAttribute { get; set; } public byte Id { get; set; } } \ No newline at end of file diff --git a/UdpHosts/GameServer/StaticDB/Records/dbcharacter/Faction.cs b/UdpHosts/GameServer/StaticDB/Records/dbcharacter/Faction.cs index ba92461e..64e83fb9 100644 --- a/UdpHosts/GameServer/StaticDB/Records/dbcharacter/Faction.cs +++ b/UdpHosts/GameServer/StaticDB/Records/dbcharacter/Faction.cs @@ -7,7 +7,7 @@ public record class Faction public uint JobBoardIconId { get; set; } public uint DescriptionId { get; set; } public int MaxReputation { get; set; } - public uint AbbreviatedName { get; set; } + public uint AbbreviatedNameId { get; set; } public int MinReputation { get; set; } public uint Id { get; set; } public byte DefaultStancePriority { get; set; } diff --git a/UdpHosts/GameServer/StaticDB/Records/dbcharacter/TinyObject.cs b/UdpHosts/GameServer/StaticDB/Records/dbcharacter/TinyObject.cs index e3b03115..56a080a8 100644 --- a/UdpHosts/GameServer/StaticDB/Records/dbcharacter/TinyObject.cs +++ b/UdpHosts/GameServer/StaticDB/Records/dbcharacter/TinyObject.cs @@ -2,11 +2,11 @@ namespace GameServer.Data.SDB.Records.dbcharacter; public record class TinyObject { public float Size { get; set; } - public int SpawnPfxId { get; set; } - public int PosefileId { get; set; } - public int PfxId { get; set; } - public int SpawnStatusfxId { get; set; } - public int Id { get; set; } - public int HitStatusfxId { get; set; } - public int Flags { get; set; } + public uint SpawnPfxId { get; set; } + public uint PosefileId { get; set; } + public uint PfxId { get; set; } + public uint SpawnStatusfxId { get; set; } + public uint Id { get; set; } + public uint HitStatusfxId { get; set; } + public uint Flags { get; set; } } \ No newline at end of file diff --git a/UdpHosts/GameServer/StaticDB/Records/dbfabrication/Ingredient.cs b/UdpHosts/GameServer/StaticDB/Records/dbfabrication/Ingredient.cs index b32a4f19..0625982b 100644 --- a/UdpHosts/GameServer/StaticDB/Records/dbfabrication/Ingredient.cs +++ b/UdpHosts/GameServer/StaticDB/Records/dbfabrication/Ingredient.cs @@ -2,10 +2,10 @@ namespace GameServer.Data.SDB.Records.dbfabrication; public record class Ingredient { public uint IngredientId { get; set; } - + public uint IngredientGroupId { get; set; } - + public uint ItemId { get; set; } - + public uint Id { get; set; } } \ No newline at end of file diff --git a/UdpHosts/GameServer/StaticDB/Records/dbfabrication/IngredientGroup.cs b/UdpHosts/GameServer/StaticDB/Records/dbfabrication/IngredientGroup.cs index bf3755cf..c8dbe8f4 100644 --- a/UdpHosts/GameServer/StaticDB/Records/dbfabrication/IngredientGroup.cs +++ b/UdpHosts/GameServer/StaticDB/Records/dbfabrication/IngredientGroup.cs @@ -2,8 +2,8 @@ namespace GameServer.Data.SDB.Records.dbfabrication; public record class IngredientGroup { public uint NameId { get; set; } - + public uint DescriptionId { get; set; } - + public uint Id { get; set; } } \ No newline at end of file diff --git a/UdpHosts/GameServer/StaticDB/Records/dbitems/Backpack.cs b/UdpHosts/GameServer/StaticDB/Records/dbitems/Backpack.cs index 48e10a24..63cd38e6 100644 --- a/UdpHosts/GameServer/StaticDB/Records/dbitems/Backpack.cs +++ b/UdpHosts/GameServer/StaticDB/Records/dbitems/Backpack.cs @@ -1,6 +1,6 @@ namespace GameServer.Data.SDB.Records.dbitems; public record class Backpack - { +{ public uint VisualGroup { get; set; } public uint Id { get; set; } } \ No newline at end of file diff --git a/UdpHosts/GameServer/StaticDB/Records/dbitems/BattleframeVisuals.cs b/UdpHosts/GameServer/StaticDB/Records/dbitems/BattleframeVisuals.cs index 213dcc62..62dda392 100644 --- a/UdpHosts/GameServer/StaticDB/Records/dbitems/BattleframeVisuals.cs +++ b/UdpHosts/GameServer/StaticDB/Records/dbitems/BattleframeVisuals.cs @@ -6,6 +6,6 @@ public record class BattleframeVisuals public uint VisualrecId { get; set; } public uint VisualGroup { get; set; } public uint AnimnetworkId { get; set; } - public string Gender { get; set; } + public char Gender { get; set; } public byte Race { get; set; } } \ No newline at end of file diff --git a/UdpHosts/GameServer/StaticDB/Records/dbvisualrecords/WarpaintPalette.cs b/UdpHosts/GameServer/StaticDB/Records/dbvisualrecords/WarpaintPalette.cs index 587a483d..7f248053 100644 --- a/UdpHosts/GameServer/StaticDB/Records/dbvisualrecords/WarpaintPalette.cs +++ b/UdpHosts/GameServer/StaticDB/Records/dbvisualrecords/WarpaintPalette.cs @@ -1,4 +1,4 @@ -namespace GameServer.Data.SDB.Records.dbviusalrecords; +namespace GameServer.Data.SDB.Records.dbvisualrecords; public record class WarpaintPalette { public uint Id { get; set; } diff --git a/UdpHosts/GameServer/StaticDB/Records/vcs/DriverComponentDef.cs b/UdpHosts/GameServer/StaticDB/Records/vcs/DriverComponentDef.cs index 68f90360..6361771f 100644 --- a/UdpHosts/GameServer/StaticDB/Records/vcs/DriverComponentDef.cs +++ b/UdpHosts/GameServer/StaticDB/Records/vcs/DriverComponentDef.cs @@ -1,7 +1,10 @@ +using FauFau.Util.CommmonDataTypes; + namespace GameServer.Data.SDB.Records.vcs; + public record class DriverComponentDef { - // public Vec3 DriverPoseFileOffset { get; set; } + public Vector3 DriverPoseFileOffset { get; set; } public uint CockpitVisualrec { get; set; } public uint DriverPoseFile { get; set; } public string Hardpoint { get; set; } diff --git a/UdpHosts/GameServer/StaticDB/Records/vcs/PassengerComponentDef.cs b/UdpHosts/GameServer/StaticDB/Records/vcs/PassengerComponentDef.cs index 1fffc2c3..ae2e768d 100644 --- a/UdpHosts/GameServer/StaticDB/Records/vcs/PassengerComponentDef.cs +++ b/UdpHosts/GameServer/StaticDB/Records/vcs/PassengerComponentDef.cs @@ -1,7 +1,10 @@ +using FauFau.Util.CommmonDataTypes; + namespace GameServer.Data.SDB.Records.vcs; + public record class PassengerComponentDef { - // public Vec3 PassengerPoseFileOffset { get; set; } + public Vector3 PassengerPoseFileOffset { get; set; } public string HardpointPrefix { get; set; } public uint MaxPassengers { get; set; } public float EjectionForce { get; set; } diff --git a/UdpHosts/GameServer/StaticDB/Records/vcs/TurretComponentDef.cs b/UdpHosts/GameServer/StaticDB/Records/vcs/TurretComponentDef.cs index 2e6f7c07..b5273026 100644 --- a/UdpHosts/GameServer/StaticDB/Records/vcs/TurretComponentDef.cs +++ b/UdpHosts/GameServer/StaticDB/Records/vcs/TurretComponentDef.cs @@ -1,7 +1,10 @@ +using FauFau.Util.CommmonDataTypes; + namespace GameServer.Data.SDB.Records.vcs; + public record class TurretComponentDef { - // public Vec3 GunnerPoseFileOffset { get; set; } + public Vector3 GunnerPoseFileOffset { get; set; } public uint VisualrecId { get; set; } public uint AnimnetId { get; set; } public uint GunnerPoseFile { get; set; } diff --git a/UdpHosts/GameServer/StaticDB/SDBInterface.cs b/UdpHosts/GameServer/StaticDB/SDBInterface.cs index ca166959..8334cb7f 100644 --- a/UdpHosts/GameServer/StaticDB/SDBInterface.cs +++ b/UdpHosts/GameServer/StaticDB/SDBInterface.cs @@ -6,8 +6,11 @@ namespace GameServer.Data.SDB; using Records.apt; using Records.aptfs; using Records.dbcharacter; +using Records.dbencounterdata; using Records.dbitems; -using Records.dbviusalrecords; +using Records.dbphysicsmaterials; +using Records.dbvisualrecords; +using Records.dbzonemetadata; using Records.vcs; public class SDBInterface @@ -16,11 +19,30 @@ public class SDBInterface private static Dictionary CharCreateLoadout; private static Dictionary> CharCreateLoadoutSlots; private static Dictionary Deployable; + private static Dictionary DeployableFunction; + private static Dictionary DeployableCategory; + private static Dictionary Faction; + private static List FactionRelations; + private static Dictionary> FactionReputations; private static Dictionary Monster; private static Dictionary Turret; + private static Dictionary PoseType; + private static Dictionary CharInfo; + private static Dictionary DamageType; + private static Dictionary DamageResponse; + private static Dictionary DamageResponseDamageType; + private static Dictionary TinyObject; + + // dbencounterdata + private static Dictionary MapMarkerInfo; + private static Dictionary SinCardTemplate; + + // dbphysicsmaterials + private static Dictionary PhysicsMaterial; // dbvisualrecords private static Dictionary WarpaintPalettes; + private static Dictionary VisualRecord; // dbitems private static Dictionary AttributeCategory; @@ -38,7 +60,16 @@ public class SDBInterface private static Dictionary WeaponScope; private static Dictionary WeaponUnderbarrel; private static Dictionary Ammo; + private static Dictionary LevelBand; private static Dictionary ResourceNodeBeacon; + private static Dictionary, LevelCategoryScalars> LevelCategoryScalars; + private static Dictionary FrameProgressionLevel; + private static Dictionary Blueprints; + private static Dictionary> BlueprintItems; + private static Dictionary> BattleframeVisuals; + + // dbzonemetadata + private static Dictionary ZoneRecord; // apt private static Dictionary BaseCommandDef; @@ -46,6 +77,7 @@ public class SDBInterface private static Dictionary StatusEffectData; private static Dictionary> StatusEffectTag; private static Dictionary AbilityData; + private static Dictionary ActiveInitiationCommandDef; private static Dictionary ImpactApplyEffectCommandDef; private static Dictionary ImpactToggleEffectCommandDef; private static Dictionary ConditionalBranchCommandDef; @@ -236,6 +268,7 @@ public class SDBInterface private static Dictionary TurretComponentDef; private static Dictionary DeployableComponentDef; private static Dictionary SpawnPointComponentDef; + private static Dictionary HullSegmentDef; public static void Init(StaticDB instance) { @@ -245,11 +278,30 @@ public static void Init(StaticDB instance) CharCreateLoadout = loader.LoadCharCreateLoadout(); CharCreateLoadoutSlots = loader.LoadCharCreateLoadoutSlots(); Deployable = loader.LoadDeployable(); + DeployableFunction = loader.LoadDeployableFunction(); + DeployableCategory = loader.LoadDeployableCategory(); + Faction = loader.LoadFaction(); + FactionRelations = loader.LoadFactionRelations(); + FactionReputations = loader.LoadFactionReputations(); Monster = loader.LoadMonster(); Turret = loader.LoadTurret(); + PoseType = loader.LoadPoseType(); + CharInfo = loader.LoadCharInfo(); + DamageType = loader.LoadDamageType(); + DamageResponse = loader.LoadDamageResponse(); + DamageResponseDamageType = loader.LoadDamageResponseDamageType(); + TinyObject = loader.LoadTinyObject(); + + // dbencounterdata + MapMarkerInfo = loader.LoadMapMarkerInfo(); + SinCardTemplate = loader.LoadSinCardTemplate(); + + // dbphysicsmaterials + PhysicsMaterial = loader.LoadPhysicsMaterial(); // dbvisualrecords WarpaintPalettes = loader.LoadWarpaintPalettes(); + VisualRecord = loader.LoadVisualRecord(); // dbitems AttributeCategory = loader.LoadAttributeCategory(); @@ -267,7 +319,16 @@ public static void Init(StaticDB instance) WeaponScope = loader.LoadWeaponScope(); WeaponUnderbarrel = loader.LoadWeaponUnderbarrel(); Ammo = loader.LoadAmmo(); + LevelBand = loader.LoadLevelBand(); ResourceNodeBeacon = loader.LoadResourceNodeBeacon(); + LevelCategoryScalars = loader.LoadLevelCategoryScalars(); + FrameProgressionLevel = loader.LoadFrameProgressionLevel(); + Blueprints = loader.LoadBlueprints(); + BlueprintItems = loader.LoadBlueprintItems(); + BattleframeVisuals = loader.LoadBattleframeVisuals(); + + // dbzonemetadata + ZoneRecord = loader.LoadZoneRecord(); // apt StatusEffectData = loader.LoadStatusEffectData(); @@ -275,6 +336,7 @@ public static void Init(StaticDB instance) BaseCommandDef = loader.LoadBaseCommandDef(); CommandType = loader.LoadCommandType(); AbilityData = loader.LoadAbilityData(); + ActiveInitiationCommandDef = loader.LoadActiveInitiationCommandDef(); ImpactApplyEffectCommandDef = loader.LoadImpactApplyEffectCommandDef(); ImpactToggleEffectCommandDef = loader.LoadImpactToggleEffectCommandDef(); WhileLoopCommandDef = loader.LoadWhileLoopCommandDef(); @@ -465,6 +527,7 @@ public static void Init(StaticDB instance) TurretComponentDef = loader.LoadTurretComponentDef(); DeployableComponentDef = loader.LoadDeployableComponentDef(); SpawnPointComponentDef = loader.LoadSpawnPointComponentDef(); + HullSegmentDef = loader.LoadHullSegmentDef(); } // dbcharacter @@ -502,11 +565,32 @@ public static Dictionary GetItemAttributeRange(uint item public static Dictionary GetCharCreateLoadoutSlots(uint id) => CharCreateLoadoutSlots.GetValueOrDefault(id); public static Deployable GetDeployable(uint id) => Deployable.GetValueOrDefault(id); + public static DeployableFunction GetDeployableFunction(uint id) => DeployableFunction.GetValueOrDefault(id); + public static DeployableCategory GetDeployableCategory(uint id) => DeployableCategory.GetValueOrDefault(id); + public static DamageType GetDamageType(byte id) => DamageType.GetValueOrDefault(id); + public static DamageResponse GetDamageResponse(byte id) => DamageResponse.GetValueOrDefault(id); + public static DamageResponseDamageType GetDamageResponseDamageType(uint id) => DamageResponseDamageType.GetValueOrDefault(id); + public static TinyObject GetTinyObject(uint id) => TinyObject.GetValueOrDefault(id); + public static Faction GetFaction(uint id) => Faction.GetValueOrDefault(id); + public static List GetFactions() => Faction.Select(pair => pair.Value).ToList(); + public static List GetFactionRelations() => FactionRelations; + public static List GetFactionReputations(uint id) => FactionReputations.GetValueOrDefault(id); + public static Monster GetMonster(uint id) => Monster.GetValueOrDefault(id); public static Turret GetTurret(uint id) => Turret.GetValueOrDefault(id); + public static PoseType GetPoseType(uint id) => PoseType.GetValueOrDefault(id); + public static CharInfo GetCharInfo(uint id) => CharInfo.GetValueOrDefault(id); + + // dbencounterdata + public static MapMarkerInfo GetMapMarkerInfo(uint id) => MapMarkerInfo.GetValueOrDefault(id); + public static SinCardTemplate GetSinCardTemplate(uint id) => SinCardTemplate.GetValueOrDefault(id); + + // dbphysicsMaterial + public static PhysicsMaterial GetPhysicsMaterial(uint id) => PhysicsMaterial.GetValueOrDefault(id); - // dbvisaulrecords + // dbvisualrecords public static WarpaintPalette GetWarpaintPalette(uint id) => WarpaintPalettes.GetValueOrDefault(id); + public static VisualRecord GetVisualRecord(uint id) => VisualRecord.GetValueOrDefault(id); // dbitems public static RootItem GetRootItem(uint id) => RootItem.GetValueOrDefault(id); @@ -519,12 +603,22 @@ public static Dictionary GetItemAttributeRange(uint item public static WeaponScope GetWeaponScope(uint id) => WeaponScope.GetValueOrDefault(id); public static WeaponUnderbarrel GetWeaponUnderbarrel(uint id) => WeaponUnderbarrel.GetValueOrDefault(id); public static Ammo GetAmmo(uint id) => Ammo.GetValueOrDefault(id); + public static LevelBand GetLevelBand(uint id) => LevelBand.GetValueOrDefault(id); public static ResourceNodeBeacon GetResourceNodeBeacon(uint id) => ResourceNodeBeacon.GetValueOrDefault(id); + public static LevelCategoryScalars GetLevelCategoryScalar(uint attributeCategory, uint level) => LevelCategoryScalars.GetValueOrDefault(new KeyValuePair(attributeCategory, level)); + public static FrameProgressionLevel GetFrameProgressionLevel(uint level) => FrameProgressionLevel.GetValueOrDefault(level); + public static Blueprints GetBlueprint(uint id) => Blueprints.GetValueOrDefault(id); + public static List GetBlueprintItems(uint blueprintId) => BlueprintItems.GetValueOrDefault(blueprintId); + public static List GetBattleframeVisuals(uint id) => BattleframeVisuals.GetValueOrDefault(id); + + // dbzonemetadata + public static ZoneRecord GetZoneRecord(uint id) => ZoneRecord.GetValueOrDefault(id); // apt public static BaseCommandDef GetBaseCommandDef(uint id) => BaseCommandDef.GetValueOrDefault(id); public static CommandType GetCommandType(uint id) => CommandType.GetValueOrDefault(id); public static AbilityData GetAbilityData(uint id) => AbilityData.GetValueOrDefault(id); + public static ActiveInitiationCommandDef GetActiveInitiationCommandDef(uint id) => ActiveInitiationCommandDef.GetValueOrDefault(id); public static StatusEffectData GetStatusEffectData(uint id) => StatusEffectData.GetValueOrDefault(id); public static HashSet GetStatusEffectTag(uint id) => StatusEffectTag.GetValueOrDefault(id); public static ImpactApplyEffectCommandDef GetImpactApplyEffectCommandDef(uint id) => ImpactApplyEffectCommandDef.GetValueOrDefault(id); @@ -717,4 +811,5 @@ public static Dictionary GetItemAttributeRange(uint item public static TurretComponentDef GetTurretComponentDef(uint id) => TurretComponentDef.GetValueOrDefault(id); public static DeployableComponentDef GetDeployableComponentDef(uint id) => DeployableComponentDef.GetValueOrDefault(id); public static SpawnPointComponentDef GetSpawnPointComponentDef(uint id) => SpawnPointComponentDef.GetValueOrDefault(id); + public static HullSegmentDef GetHullSegmentComponentDef(uint id) => HullSegmentDef.GetValueOrDefault(id); } \ No newline at end of file diff --git a/UdpHosts/GameServer/StaticDB/SDBUtils.cs b/UdpHosts/GameServer/StaticDB/SDBUtils.cs index 9a8bfc49..06d6894e 100644 --- a/UdpHosts/GameServer/StaticDB/SDBUtils.cs +++ b/UdpHosts/GameServer/StaticDB/SDBUtils.cs @@ -3,6 +3,7 @@ namespace GameServer.Data.SDB; using System; using System.Collections.Generic; using System.Linq; +using System.Numerics; using AeroMessages.GSS.V66.Character; using Records.dbcharacter; using Records.dbitems; @@ -13,6 +14,11 @@ public class SDBUtils { private static readonly ILogger _logger = Log.ForContext(); + public static Vector3 Vector3FromFauFau(FauFau.Util.CommmonDataTypes.Vector3 input) + { + return new Vector3(input.x, input.y, input.z); + } + public static Dictionary GetDefaultLoadoutSlots(uint loadoutId) { var loadout = SDBInterface.GetCharCreateLoadout(loadoutId); @@ -223,6 +229,11 @@ public static VehicleInfoResult GetDetailedVehicleInfo(ushort vehicleId) StatusFxId = 0, Turrets = new List(), Deployables = new List(), + HullSegment = null, + DriverPoseFile = 0, + PasengerPoseFile = 0, + PassengerPoseOffset = Vector3.Zero, + DriverPoseOffset = Vector3.Zero, }; foreach (var baseComponent in baseComponents.Values) @@ -244,6 +255,8 @@ public static VehicleInfoResult GetDetailedVehicleInfo(ushort vehicleId) var driverComponent = SDBInterface.GetDriverComponentDef(componentId); result.HasDriverSeat = true; result.DriverPosture = driverComponent.Posture; + result.DriverPoseFile = driverComponent.DriverPoseFile; + result.DriverPoseOffset = Vector3FromFauFau(driverComponent.DriverPoseFileOffset); break; case ComponentType.Passenger: @@ -252,6 +265,8 @@ public static VehicleInfoResult GetDetailedVehicleInfo(ushort vehicleId) result.PassengerPosture = passengerComponent.Posture; result.HasActivePassenger = passengerComponent.ActivePassenger == 1; result.SkipOnePassenger = passengerComponent.LeadingZero == 1; + result.PasengerPoseFile = passengerComponent.PassengerPoseFile; + result.PassengerPoseOffset = Vector3FromFauFau(passengerComponent.PassengerPoseFileOffset); break; case ComponentType.Ability: @@ -286,6 +301,10 @@ public static VehicleInfoResult GetDetailedVehicleInfo(ushort vehicleId) // var spawnPointComponent = SDBInterface.GetSpawnPointComponentDef(componentId); break; + case ComponentType.HullSegment: + result.HullSegment = SDBInterface.GetHullSegmentComponentDef(componentId); + break; + default: _logger.Debug("Unhandled vehicle component, id: {componentId}, type: {componentType}", componentId, componentType); break; @@ -617,6 +636,11 @@ public class VehicleInfoResult public uint StatusFxId; public List Turrets; public List Deployables; + public HullSegmentDef HullSegment; + public uint DriverPoseFile; + public uint PasengerPoseFile; + public Vector3 PassengerPoseOffset; + public Vector3 DriverPoseOffset; } public class ChassisWarpaintResult