From d9c6917ab0fa9afb236e95af199bd83ec100c534 Mon Sep 17 00:00:00 2001 From: Luna <34936608+Plootie@users.noreply.github.com> Date: Sat, 27 Apr 2024 19:15:46 +0100 Subject: [PATCH 1/2] Potentially fix deserializer stoopidness --- SIT.Manager/Models/Aki/AkiCharacter.cs | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/SIT.Manager/Models/Aki/AkiCharacter.cs b/SIT.Manager/Models/Aki/AkiCharacter.cs index 33223b5c..6e929638 100644 --- a/SIT.Manager/Models/Aki/AkiCharacter.cs +++ b/SIT.Manager/Models/Aki/AkiCharacter.cs @@ -2,16 +2,33 @@ using System.Text.Json.Serialization; namespace SIT.Manager.Models.Aki; -public class AkiCharacter(AkiServer parent, string username, string password) : ObservableObject +public class AkiCharacter : ObservableObject { [JsonPropertyName("Username")] - public string Username { get; init; } = username; + public string Username { get; init; } [JsonPropertyName("Password")] - public string Password { get; init; } = password; + public string Password { get; init; } [JsonPropertyName("ProfileID")] public string ProfileID { get; internal set; } = ""; [JsonPropertyName("Edition")] public string Edition { get; internal set; } = "Edge of Darkness"; [JsonIgnore] - public AkiServer ParentServer = parent; + public AkiServer ParentServer; + + public AkiCharacter(AkiServer parent, string username, string password) + { + ParentServer = parent; + Username = username; + Password = password; + } + + [JsonConstructor] + AkiCharacter(AkiServer parent, string username, string password, string edition, string profileID) + { + this.ParentServer = parent; + this.Username = username; + this.Password = password; + this.Edition = edition; + this.ProfileID = profileID; + } } From e69ecb43a7ba3f3f20d23150a0417882285ac027 Mon Sep 17 00:00:00 2001 From: Luna <34936608+Plootie@users.noreply.github.com> Date: Sat, 27 Apr 2024 19:41:07 +0100 Subject: [PATCH 2/2] Fix .NET stupidity --- SIT.Manager/Models/Aki/AkiCharacter.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SIT.Manager/Models/Aki/AkiCharacter.cs b/SIT.Manager/Models/Aki/AkiCharacter.cs index 6e929638..b623d014 100644 --- a/SIT.Manager/Models/Aki/AkiCharacter.cs +++ b/SIT.Manager/Models/Aki/AkiCharacter.cs @@ -23,9 +23,9 @@ public AkiCharacter(AkiServer parent, string username, string password) } [JsonConstructor] - AkiCharacter(AkiServer parent, string username, string password, string edition, string profileID) + public AkiCharacter(AkiServer parentServer, string username, string password, string edition, string profileID) { - this.ParentServer = parent; + this.ParentServer = parentServer; this.Username = username; this.Password = password; this.Edition = edition;