-
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implements: - /quest/get_quest_clear_party - /quest/get_quest_clear_party_multi - /quest/set_quest_clear_party - /quest/set_quest_clear_party_multi Includes a new database table for saved clear units, and also logic to detect when entities from saved parties are missing. Saved clear parties are exempted from the save import deletion process, as they are not contained in a save, so wiping them on every import seemed harsh. As a result, they may contain entities which the user no longer owns. Fortunately, the game provides a mechanism to handle this in the form of "lost_unit_list", which shows a pop-up indicating what entities cannot be retrieved from the clear party. This is probably intended for entities which can normally be lost, like dragons or portrait prints, but seems to work sort of okay with weapons and wyrmprints: <img src="https://github.com/SapiensAnatis/Dawnshard/assets/5047192/f769492b-ced9-4fe5-81a0-651f8f161267" width="30%" height="30%"/> There is however no entity type for missing shared skills, and missing characters will cause the button to be disabled entirely.
- Loading branch information
1 parent
153c1de
commit 61176d8
Showing
36 changed files
with
5,119 additions
and
318 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using DragaliaAPI.Shared.Definitions.Enums; | ||
|
||
namespace DragaliaAPI.Database.Entities.Abstract; | ||
|
||
/// <summary> | ||
/// Base class for party units with edit skills / weapon skins equipped. | ||
/// </summary> | ||
public abstract class DbPartyUnitBase : DbUnitBase | ||
{ | ||
public int EquipWeaponSkinId { get; set; } | ||
|
||
public Charas EditSkill1CharaId { get; set; } | ||
|
||
public Charas EditSkill2CharaId { get; set; } | ||
|
||
public required int UnitNo { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using DragaliaAPI.Shared.Definitions.Enums; | ||
|
||
namespace DragaliaAPI.Database.Entities.Abstract; | ||
|
||
/// <summary> | ||
/// Base class for party units and unit equipment set entries. | ||
/// </summary> | ||
public abstract class DbUnitBase | ||
{ | ||
public Charas CharaId { get; set; } | ||
|
||
public long EquipDragonKeyId { get; set; } | ||
|
||
public WeaponBodies EquipWeaponBodyId { get; set; } | ||
|
||
public AbilityCrests EquipCrestSlotType1CrestId1 { get; set; } | ||
|
||
public AbilityCrests EquipCrestSlotType1CrestId2 { get; set; } | ||
|
||
public AbilityCrests EquipCrestSlotType1CrestId3 { get; set; } | ||
|
||
public AbilityCrests EquipCrestSlotType2CrestId1 { get; set; } | ||
|
||
public AbilityCrests EquipCrestSlotType2CrestId2 { get; set; } | ||
|
||
public AbilityCrests EquipCrestSlotType3CrestId1 { get; set; } | ||
|
||
public AbilityCrests EquipCrestSlotType3CrestId2 { get; set; } | ||
|
||
public long EquipTalismanKeyId { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
using System.ComponentModel.DataAnnotations; | ||
using System.ComponentModel.DataAnnotations.Schema; | ||
using DragaliaAPI.Database.Entities.Abstract; | ||
using DragaliaAPI.Shared.Definitions.Enums; | ||
using Microsoft.EntityFrameworkCore; | ||
|
||
namespace DragaliaAPI.Database.Entities; | ||
|
||
[PrimaryKey(nameof(DeviceAccountId), nameof(QuestId), nameof(IsMulti), nameof(UnitNo))] | ||
public class DbQuestClearPartyUnit : DbPartyUnitBase, IDbHasAccountId | ||
{ | ||
public virtual DbPlayer? Owner { get; set; } | ||
|
||
[ForeignKey(nameof(Owner))] | ||
public required string DeviceAccountId { get; set; } | ||
|
||
public required int QuestId { get; set; } | ||
|
||
public required bool IsMulti { get; set; } | ||
|
||
public Dragons EquippedDragonEntityId { get; set; } | ||
|
||
public Talismans EquippedTalismanEntityId { get; set; } | ||
|
||
/// <summary> | ||
/// Reset this entity back to a state representing an empty slot. | ||
/// </summary> | ||
public void Clear() | ||
{ | ||
this.CharaId = Charas.Empty; | ||
|
||
this.EquipWeaponBodyId = WeaponBodies.Empty; | ||
this.EquipWeaponSkinId = 0; | ||
|
||
this.EquipDragonKeyId = 0; | ||
this.EquipTalismanKeyId = 0; | ||
this.EquippedDragonEntityId = Dragons.Empty; | ||
this.EquippedTalismanEntityId = Talismans.Empty; | ||
|
||
this.EquipCrestSlotType1CrestId1 = AbilityCrests.Empty; | ||
this.EquipCrestSlotType1CrestId2 = AbilityCrests.Empty; | ||
this.EquipCrestSlotType1CrestId3 = AbilityCrests.Empty; | ||
|
||
this.EquipCrestSlotType2CrestId1 = AbilityCrests.Empty; | ||
this.EquipCrestSlotType2CrestId2 = AbilityCrests.Empty; | ||
|
||
this.EquipCrestSlotType3CrestId1 = AbilityCrests.Empty; | ||
this.EquipCrestSlotType3CrestId2 = AbilityCrests.Empty; | ||
|
||
this.EditSkill1CharaId = Charas.Empty; | ||
this.EditSkill2CharaId = Charas.Empty; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,23 @@ | ||
using System.ComponentModel.DataAnnotations; | ||
using System.ComponentModel.DataAnnotations.Schema; | ||
using DragaliaAPI.Database.Entities.Abstract; | ||
using DragaliaAPI.Shared.Definitions.Enums; | ||
using Microsoft.EntityFrameworkCore; | ||
|
||
namespace DragaliaAPI.Database.Entities; | ||
|
||
//TODO: This and PartyUnit share a lot of properties, maybe extract those and make these into subclasses which inherit them | ||
[Table("PlayerSetUnit")] | ||
[Index(nameof(DeviceAccountId))] | ||
public class DbSetUnit : IDbHasAccountId | ||
public class DbSetUnit : DbUnitBase, IDbHasAccountId | ||
{ | ||
/// <inheritdoc /> | ||
public virtual DbPlayer? Owner { get; set; } | ||
|
||
/// <inheritdoc /> | ||
[ForeignKey(nameof(Owner))] | ||
public required string DeviceAccountId { get; set; } | ||
|
||
[Required] | ||
public Charas CharaId { get; set; } | ||
|
||
[Required] | ||
public int UnitSetNo { get; set; } | ||
|
||
public required string UnitSetName { get; set; } | ||
|
||
public long EquipDragonKeyId { get; set; } | ||
|
||
public int EquipWeaponBodyId { get; set; } | ||
|
||
public int EquipCrestSlotType1CrestId1 { get; set; } | ||
|
||
public int EquipCrestSlotType1CrestId2 { get; set; } | ||
|
||
public int EquipCrestSlotType1CrestId3 { get; set; } | ||
|
||
public int EquipCrestSlotType2CrestId1 { get; set; } | ||
|
||
public int EquipCrestSlotType2CrestId2 { get; set; } | ||
|
||
public int EquipCrestSlotType3CrestId1 { get; set; } | ||
|
||
public int EquipCrestSlotType3CrestId2 { get; set; } | ||
|
||
public long EquipTalismanKeyId { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.