From 91dbfca5473e8d5bd02faa9b789fc137b2b94c33 Mon Sep 17 00:00:00 2001 From: CWX Date: Sat, 25 Jan 2025 14:54:00 +0000 Subject: [PATCH] Fix Notes and remove Dupe type --- Libraries/Core/Controllers/NoteController.cs | 7 +++++++ Libraries/Core/Models/Eft/Common/Tables/BotBase.cs | 7 +------ Libraries/Core/Models/Eft/Notes/NoteActionData.cs | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Libraries/Core/Controllers/NoteController.cs b/Libraries/Core/Controllers/NoteController.cs index 2345718c..bcabb0f0 100644 --- a/Libraries/Core/Controllers/NoteController.cs +++ b/Libraries/Core/Controllers/NoteController.cs @@ -23,6 +23,9 @@ public class NoteController( NoteActionData body, string sessionId) { + Note newNote = new Note { Time = body.Note.Time, Text = body.Note.Text }; + pmcData.Notes.DataNotes.Add(newNote); + return _eventOutputHolder.GetOutput(sessionId); } @@ -38,6 +41,10 @@ public class NoteController( NoteActionData body, string sessionId) { + Note noteToEdit = pmcData.Notes.DataNotes[body.Index!.Value]; + noteToEdit.Time = body.Note.Time; + noteToEdit.Text = body.Note.Text; + return _eventOutputHolder.GetOutput(sessionId); } diff --git a/Libraries/Core/Models/Eft/Common/Tables/BotBase.cs b/Libraries/Core/Models/Eft/Common/Tables/BotBase.cs index 32ceb2e2..ae67cdef 100644 --- a/Libraries/Core/Models/Eft/Common/Tables/BotBase.cs +++ b/Libraries/Core/Models/Eft/Common/Tables/BotBase.cs @@ -1,5 +1,6 @@ using System.Text.Json.Serialization; using Core.Models.Eft.ItemEvent; +using Core.Models.Eft.Notes; using Core.Models.Eft.Ragfair; using Core.Models.Enums; using Core.Utils.Json; @@ -780,9 +781,3 @@ public record Bonus [JsonPropertyName("skillType")] public BonusSkillType? SkillType { get; set; } } - -public record Note -{ - public double? Time { get; set; } - public string? Text { get; set; } -} diff --git a/Libraries/Core/Models/Eft/Notes/NoteActionData.cs b/Libraries/Core/Models/Eft/Notes/NoteActionData.cs index 86923f43..779ca202 100644 --- a/Libraries/Core/Models/Eft/Notes/NoteActionData.cs +++ b/Libraries/Core/Models/Eft/Notes/NoteActionData.cs @@ -15,7 +15,7 @@ public record NoteActionData : BaseInteractionRequestData public record Note { [JsonPropertyName("Time")] - public long? Time { get; set; } + public double? Time { get; set; } [JsonPropertyName("Text")] public string? Text { get; set; }