Skip to content

Commit

Permalink
[Packet parser] Updated parser
Browse files Browse the repository at this point in the history
  • Loading branch information
BAndysc committed Jul 4, 2022
1 parent 8d05d68 commit 5a0c00d
Show file tree
Hide file tree
Showing 15 changed files with 191 additions and 35 deletions.
2 changes: 1 addition & 1 deletion LoaderAvalonia/LoaderAvalonia.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</PropertyGroup>
<Import Project="..\Module.props" />

<Target Name="CustomAfterBuild" AfterTargets="Build">
<Target Condition="$([MSBuild]::IsOSPlatform('OSX'))" Name="CustomAfterBuild" AfterTargets="Build">
<Copy SourceFiles="$(OutputPath)\runtimes\osx-universal\native\libcimgui.dylib" DestinationFolder="$(OutputPath)\runtimes\osx\native\" ContinueOnError="false" />
</Target>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>
<Import Project="..\..\Avalonia.props" />

<Target Name="CustomAfterBuild" AfterTargets="Build">
<Target Condition="$([MSBuild]::IsOSPlatform('OSX'))" Name="CustomAfterBuild" AfterTargets="Build">
<Copy SourceFiles="$(OutputPath)\runtimes\osx-universal\native\libcimgui.dylib" DestinationFolder="$(OutputPath)\runtimes\osx\native\" ContinueOnError="false" />
</Target>

Expand Down
2 changes: 1 addition & 1 deletion Rendering/RenderingTester/RenderingTester.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<Nullable>enable</Nullable>
</PropertyGroup>

<Target Name="CustomAfterBuild" AfterTargets="Build">
<Target Condition="$([MSBuild]::IsOSPlatform('OSX'))" Name="CustomAfterBuild" AfterTargets="Build">
<Copy SourceFiles="$(OutputPath)\runtimes\osx-universal\native\libcimgui.dylib" DestinationFolder="$(OutputPath)\runtimes\osx\native\" ContinueOnError="false" />
</Target>

Expand Down
82 changes: 75 additions & 7 deletions WDE.MySqlDatabaseCommon/CommonModels/MySqlCreatureAddon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,15 @@

namespace WDE.MySqlDatabaseCommon.CommonModels;

public class MySqlBaseCreatureAddon : IBaseCreatureAddon
public abstract class MySqlBaseCreatureAddon : IBaseCreatureAddon
{
[Column(Name = "path_id")]
public uint PathId { get; set; }
public abstract uint PathId { get; set; }

[Column(Name = "mount")]
public uint Mount { get; set; }

[Column(Name = "MountCreatureID")]
public uint MountCreatureId { get; set; }


public abstract uint MountCreatureId { get; set; }

[Column(Name = "bytes1")]
public uint Bytes1 { get; set; }

Expand Down Expand Up @@ -41,6 +39,12 @@ public class MySqlCreatureAddon : MySqlBaseCreatureAddon, ICreatureAddon
[Identity]
[Column(Name = "guid")]
public uint Guid { get; set; }

[Column(Name = "path_id")]
public override uint PathId { get; set; }

[Column(Name = "MountCreatureID")]
public override uint MountCreatureId { get; set; }
}

[Table(Name = "creature_template_addon")]
Expand All @@ -50,4 +54,68 @@ public class MySqlCreatureTemplateAddon : MySqlBaseCreatureAddon, ICreatureTempl
[Identity]
[Column(Name = "entry")]
public uint Entry { get; set; }

[Column(Name = "path_id")]
public override uint PathId { get; set; }

[Column(Name = "MountCreatureID")]
public override uint MountCreatureId { get; set; }
}


[Table(Name = "creature_addon")]
public class MySqlCreatureAddonCata : MySqlBaseCreatureAddon, ICreatureAddon
{
[PrimaryKey]
[Identity]
[Column(Name = "guid")]
public uint Guid { get; set; }

[Column(Name = "waypointPathId")]
public override uint PathId { get; set; }

public override uint MountCreatureId { get; set; }
}

[Table(Name = "creature_template_addon")]
public class MySqlCreatureTemplateAddonCata : MySqlBaseCreatureAddon, ICreatureTemplateAddon
{
[PrimaryKey]
[Identity]
[Column(Name = "entry")]
public uint Entry { get; set; }

[Column(Name = "waypointPathId")]
public override uint PathId { get; set; }

public override uint MountCreatureId { get; set; }
}


[Table(Name = "creature_addon")]
public class MySqlCreatureAddonAC: MySqlBaseCreatureAddon, ICreatureAddon
{
[PrimaryKey]
[Identity]
[Column(Name = "guid")]
public uint Guid { get; set; }

[Column(Name = "path_id")]
public override uint PathId { get; set; }

public override uint MountCreatureId { get; set; }
}

[Table(Name = "creature_template_addon")]
public class MySqlCreatureTemplateAddonAC : MySqlBaseCreatureAddon, ICreatureTemplateAddon
{
[PrimaryKey]
[Identity]
[Column(Name = "entry")]
public uint Entry { get; set; }

[Column(Name = "path_id")]
public override uint PathId { get; set; }

public override uint MountCreatureId { get; set; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -202,4 +202,28 @@ public override async Task<IList<ICreatureModelInfo>> GetCreatureModelInfoAsync(
await using var model = Database();
return await model.Creature.FirstOrDefaultAsync(x => x.Guid == guid);
}

public override async Task<IList<ICreatureAddon>> GetCreatureAddons()
{
await using var model = Database();
return await model.CreatureAddon.ToListAsync<ICreatureAddon>();
}

public override async Task<IList<ICreatureTemplateAddon>> GetCreatureTemplateAddons()
{
await using var model = Database();
return await model.CreatureTemplateAddon.ToListAsync<ICreatureTemplateAddon>();
}

public override async Task<ICreatureAddon?> GetCreatureAddon(uint guid)
{
await using var model = Database();
return await model.CreatureAddon.FirstOrDefaultAsync<ICreatureAddon>(x => x.Guid == guid);
}

public override async Task<ICreatureTemplateAddon?> GetCreatureTemplateAddon(uint entry)
{
await using var model = Database();
return await model.CreatureTemplateAddon.FirstOrDefaultAsync<ICreatureTemplateAddon>(x => x.Entry == entry);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -598,17 +598,13 @@ public async Task<List<IEventScriptLine>> GetEventScript(EventScriptType type, u
return await model.SceneTemplates.ToListAsync<ISceneTemplate>();
}

public async Task<IList<ICreatureAddon>> GetCreatureAddons()
{
await using var model = Database();
return await model.CreatureAddon.ToListAsync<ICreatureAddon>();
}
public abstract Task<IList<ICreatureAddon>> GetCreatureAddons();

public async Task<IList<ICreatureTemplateAddon>> GetCreatureTemplateAddons()
{
await using var model = Database();
return await model.CreatureTemplateAddon.ToListAsync<ICreatureTemplateAddon>();
}
public abstract Task<IList<ICreatureTemplateAddon>> GetCreatureTemplateAddons();

public abstract Task<ICreatureAddon?> GetCreatureAddon(uint guid);

public abstract Task<ICreatureTemplateAddon?> GetCreatureTemplateAddon(uint entry);

public async Task<IList<ICreatureEquipmentTemplate>?> GetCreatureEquipmentTemplates()
{
Expand Down Expand Up @@ -652,18 +648,6 @@ public async Task<IList<IGameEventGameObject>> GetGameEventGameObjectsAsync()

public abstract Task<ICreature?> GetCreaturesByGuidAsync(uint guid);

public async Task<ICreatureAddon?> GetCreatureAddon(uint guid)
{
await using var model = Database();
return await model.CreatureAddon.FirstOrDefaultAsync<ICreatureAddon>(x => x.Guid == guid);
}

public async Task<ICreatureTemplateAddon?> GetCreatureTemplateAddon(uint entry)
{
await using var model = Database();
return await model.CreatureTemplateAddon.FirstOrDefaultAsync<ICreatureTemplateAddon>(x => x.Entry == entry);
}

public async Task<IList<IAuthRbacPermission>> GetRbacPermissionsAsync()
{
if (!Supports<IAuthRbacPermission>())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,4 +238,28 @@ public override async Task<IList<ICreatureModelInfo>> GetCreatureModelInfoAsync(
await using var model = Database();
return await model.Creature.FirstOrDefaultAsync(x => x.Guid == guid);
}

public override async Task<IList<ICreatureAddon>> GetCreatureAddons()
{
await using var model = Database();
return await model.CreatureAddon.ToListAsync<ICreatureAddon>();
}

public override async Task<IList<ICreatureTemplateAddon>> GetCreatureTemplateAddons()
{
await using var model = Database();
return await model.CreatureTemplateAddon.ToListAsync<ICreatureTemplateAddon>();
}

public override async Task<ICreatureAddon?> GetCreatureAddon(uint guid)
{
await using var model = Database();
return await model.CreatureAddon.FirstOrDefaultAsync<ICreatureAddon>(x => x.Guid == guid);
}

public override async Task<ICreatureTemplateAddon?> GetCreatureTemplateAddon(uint entry)
{
await using var model = Database();
return await model.CreatureTemplateAddon.FirstOrDefaultAsync<ICreatureTemplateAddon>(x => x.Entry == entry);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -213,4 +213,29 @@ public override async Task<IList<ICreatureModelInfo>> GetCreatureModelInfoAsync(
await using var model = Database();
return await model.Creature.FirstOrDefaultAsync(x => x.Guid == guid);
}


public override async Task<IList<ICreatureAddon>> GetCreatureAddons()
{
await using var model = Database();
return await model.CreatureAddon.ToListAsync<ICreatureAddon>();
}

public override async Task<IList<ICreatureTemplateAddon>> GetCreatureTemplateAddons()
{
await using var model = Database();
return await model.CreatureTemplateAddon.ToListAsync<ICreatureTemplateAddon>();
}

public override async Task<ICreatureAddon?> GetCreatureAddon(uint guid)
{
await using var model = Database();
return await model.CreatureAddon.FirstOrDefaultAsync<ICreatureAddon>(x => x.Guid == guid);
}

public override async Task<ICreatureTemplateAddon?> GetCreatureTemplateAddon(uint entry)
{
await using var model = Database();
return await model.CreatureTemplateAddon.FirstOrDefaultAsync<ICreatureTemplateAddon>(x => x.Entry == entry);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -208,4 +208,29 @@ public override async Task<IList<ICreatureModelInfo>> GetCreatureModelInfoAsync(
await using var model = Database();
return await model.Creature.FirstOrDefaultAsync(x => x.Guid == guid);
}


public override async Task<IList<ICreatureAddon>> GetCreatureAddons()
{
await using var model = Database();
return await model.CreatureAddon.ToListAsync<ICreatureAddon>();
}

public override async Task<IList<ICreatureTemplateAddon>> GetCreatureTemplateAddons()
{
await using var model = Database();
return await model.CreatureTemplateAddon.ToListAsync<ICreatureTemplateAddon>();
}

public override async Task<ICreatureAddon?> GetCreatureAddon(uint guid)
{
await using var model = Database();
return await model.CreatureAddon.FirstOrDefaultAsync<ICreatureAddon>(x => x.Guid == guid);
}

public override async Task<ICreatureTemplateAddon?> GetCreatureTemplateAddon(uint entry)
{
await using var model = Database();
return await model.CreatureTemplateAddon.FirstOrDefaultAsync<ICreatureTemplateAddon>(x => x.Entry == entry);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@ public class AzerothDatabase : BaseTrinityDatabase
public ITable<MySqlGameObjectWrath> GameObject => GetTable<MySqlGameObjectWrath>();
public ITable<MySqlItemTemplate> ItemTemplate => GetTable<MySqlItemTemplate>();
public ITable<MySqlCreatureModelInfo> CreatureModelInfo => GetTable<MySqlCreatureModelInfo>();
public ITable<MySqlCreatureAddonAC> CreatureAddon => GetTable<MySqlCreatureAddonAC>();
public ITable<MySqlCreatureTemplateAddonAC> CreatureTemplateAddon => GetTable<MySqlCreatureTemplateAddonAC>();
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ public BaseTrinityDatabase() : base("Trinity")
public ITable<MySqlSpellScriptLine> SpellScripts => GetTable<MySqlSpellScriptLine>();
public ITable<MySqlAreaTriggerCreateProperties> AreaTriggerCreateProperties => GetTable<MySqlAreaTriggerCreateProperties>();
public ITable<MySqlSceneTemplate> SceneTemplates => GetTable<MySqlSceneTemplate>();
public ITable<MySqlCreatureAddon> CreatureAddon => GetTable<MySqlCreatureAddon>();
public ITable<MySqlCreatureTemplateAddon> CreatureTemplateAddon => GetTable<MySqlCreatureTemplateAddon>();
public ITable<MySqlCreatureEquipmentTemplate> EquipmentTemplate => GetTable<MySqlCreatureEquipmentTemplate>();
public ITable<MySqlGameEventCreature> GameEventCreature => GetTable<MySqlGameEventCreature>();
public ITable<MySqlGameEventGameObject> GameEventGameObject => GetTable<MySqlGameEventGameObject>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@ public class TrinityCataDatabase : BaseTrinityDatabase
public ITable<MySqlCataQuestTemplate> CataQuestTemplate => GetTable<MySqlCataQuestTemplate>();
public ITable<MySqlCataQuestTemplateAddon> CataQuestTemplateAddon => GetTable<MySqlCataQuestTemplateAddon>();
public ITable<MySqlCreatureModelInfo> CreatureModelInfo => GetTable<MySqlCreatureModelInfo>();
public ITable<MySqlCreatureAddonCata> CreatureAddon => GetTable<MySqlCreatureAddonCata>();
public ITable<MySqlCreatureTemplateAddonCata> CreatureTemplateAddon => GetTable<MySqlCreatureTemplateAddonCata>();
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ public class TrinityMasterDatabase : BaseTrinityDatabase
public ITable<TrinityMasterMySqlServersideSpell> SpellDbc => GetTable<TrinityMasterMySqlServersideSpell>();
public ITable<MySqlGameObjectCata> GameObject => GetTable<MySqlGameObjectCata>();
public ITable<MySqlCreatureModelInfoShadowlands> CreatureModelInfo => GetTable<MySqlCreatureModelInfoShadowlands>();
public ITable<MySqlCreatureAddon> CreatureAddon => GetTable<MySqlCreatureAddon>();
public ITable<MySqlCreatureTemplateAddon> CreatureTemplateAddon => GetTable<MySqlCreatureTemplateAddon>();
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ public class TrinityWrathDatabase : BaseTrinityDatabase
public ITable<MySqlItemTemplate> ItemTemplate => GetTable<MySqlItemTemplate>();
public ITable<MySqlSpawnGroupTemplate> SpawnGroupTemplate => GetTable<MySqlSpawnGroupTemplate>();
public ITable<MySqlCreatureModelInfo> CreatureModelInfo => GetTable<MySqlCreatureModelInfo>();
public ITable<MySqlCreatureAddon> CreatureAddon => GetTable<MySqlCreatureAddon>();
public ITable<MySqlCreatureTemplateAddon> CreatureTemplateAddon => GetTable<MySqlCreatureTemplateAddon>();
}

0 comments on commit 5a0c00d

Please sign in to comment.