From bd6e660d195995bd15af6f2e3ef01503b019b351 Mon Sep 17 00:00:00 2001 From: Jay Malhotra <5047192+SapiensAnatis@users.noreply.github.com> Date: Mon, 26 Feb 2024 22:12:12 +0000 Subject: [PATCH] Default-initialize reward record and grow record (#684) This was being done before #676, and with it removed and placed in a service, we started seeing NullReferenceExceptions in /dungeon_record/record. Let's try reverting it back to exactly how it was before... --- .../Features/Dungeon/Record/DungeonRecordService.cs | 2 -- .../DragaliaAPI/Models/Generated/Components.cs | 6 ------ .../DragaliaAPI/Models/Generated/IngameResultData.cs | 12 ++++++++++++ 3 files changed, 12 insertions(+), 8 deletions(-) create mode 100644 DragaliaAPI/DragaliaAPI/Models/Generated/IngameResultData.cs diff --git a/DragaliaAPI/DragaliaAPI/Features/Dungeon/Record/DungeonRecordService.cs b/DragaliaAPI/DragaliaAPI/Features/Dungeon/Record/DungeonRecordService.cs index 987715537..8ccc2487d 100644 --- a/DragaliaAPI/DragaliaAPI/Features/Dungeon/Record/DungeonRecordService.cs +++ b/DragaliaAPI/DragaliaAPI/Features/Dungeon/Record/DungeonRecordService.cs @@ -50,8 +50,6 @@ DungeonSession session TotalPlayDamage = playRecord.TotalPlayDamage, ClearTime = playRecord.Time, IsClear = true, - RewardRecord = new(), - GrowRecord = new(), }; await this.ProcessStaminaConsumption(session); diff --git a/DragaliaAPI/DragaliaAPI/Models/Generated/Components.cs b/DragaliaAPI/DragaliaAPI/Models/Generated/Components.cs index 489edc2b1..6146cc02f 100644 --- a/DragaliaAPI/DragaliaAPI/Models/Generated/Components.cs +++ b/DragaliaAPI/DragaliaAPI/Models/Generated/Components.cs @@ -8977,12 +8977,6 @@ public partial class IngameResultData [Key("quest_id")] public int QuestId { get; set; } - [Key("reward_record")] - public RewardRecord RewardRecord { get; set; } - - [Key("grow_record")] - public GrowRecord GrowRecord { get; set; } - [Key("start_time")] public DateTimeOffset StartTime { get; set; } diff --git a/DragaliaAPI/DragaliaAPI/Models/Generated/IngameResultData.cs b/DragaliaAPI/DragaliaAPI/Models/Generated/IngameResultData.cs new file mode 100644 index 000000000..eaa888dda --- /dev/null +++ b/DragaliaAPI/DragaliaAPI/Models/Generated/IngameResultData.cs @@ -0,0 +1,12 @@ +using MessagePack; + +namespace DragaliaAPI.Models.Generated; + +public partial class IngameResultData +{ + [Key("reward_record")] + public RewardRecord RewardRecord { get; set; } = new(); + + [Key("grow_record")] + public GrowRecord GrowRecord { get; set; } = new(); +}