From 05825a11e223ee67df08ee525da003d26f3e3529 Mon Sep 17 00:00:00 2001 From: Kamron Batman <3953314+kamronbatman@users.noreply.github.com> Date: Fri, 9 May 2025 15:39:47 -0700 Subject: [PATCH] fix: Fixes props for interfaces and adds account manipulation (#2179) --- Projects/Server/Attributes.cs | 20 ++++++++++++-------- Projects/Server/Mobiles/Mobile.cs | 2 +- Projects/UOContent/Accounting/Account.cs | 1 + 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/Projects/Server/Attributes.cs b/Projects/Server/Attributes.cs index daab18e7e..ffdad7c59 100644 --- a/Projects/Server/Attributes.cs +++ b/Projects/Server/Attributes.cs @@ -145,16 +145,18 @@ public class CommandPropertyAttribute : Attribute AccessLevel level, bool readOnly = false, bool canModify = false - ) : this(level, level) + ) : this(level, level, readOnly, canModify) { - ReadOnly = readOnly; - CanModify = canModify; } - public CommandPropertyAttribute(AccessLevel readLevel, AccessLevel writeLevel) + public CommandPropertyAttribute( + AccessLevel readLevel, AccessLevel writeLevel, bool readOnly = false, bool canModify = false + ) { ReadLevel = readLevel; WriteLevel = writeLevel; + ReadOnly = readOnly; + CanModify = canModify; } public AccessLevel ReadLevel { get; } @@ -170,16 +172,18 @@ public class SerializedCommandPropertyAttribute : SerializedPropertyAttrAttribut AccessLevel level, bool readOnly = false, bool canModify = false - ) : this(level, level) + ) : this(level, level, readOnly, canModify) { - ReadOnly = readOnly; - CanModify = canModify; } - public SerializedCommandPropertyAttribute(AccessLevel readLevel, AccessLevel writeLevel) + public SerializedCommandPropertyAttribute( + AccessLevel readLevel, AccessLevel writeLevel, bool readOnly = false, bool canModify = false + ) { ReadLevel = readLevel; WriteLevel = writeLevel; + ReadOnly = readOnly; + CanModify = canModify; } public AccessLevel ReadLevel { get; } diff --git a/Projects/Server/Mobiles/Mobile.cs b/Projects/Server/Mobiles/Mobile.cs index a3cd7620d..5b4e7a992 100644 --- a/Projects/Server/Mobiles/Mobile.cs +++ b/Projects/Server/Mobiles/Mobile.cs @@ -895,7 +895,7 @@ public partial class Mobile : IHued, IComparable, ISpawnable, IObjectPro [CommandProperty(AccessLevel.Administrator)] public bool AutoPageNotify { get; set; } - [CommandProperty(AccessLevel.GameMaster, AccessLevel.Owner)] + [CommandProperty(AccessLevel.GameMaster, AccessLevel.Administrator, canModify: true)] public IAccount Account { get; set; } [CommandProperty(AccessLevel.GameMaster)] diff --git a/Projects/UOContent/Accounting/Account.cs b/Projects/UOContent/Accounting/Account.cs index 9e554fd72..c9e85de2c 100644 --- a/Projects/UOContent/Accounting/Account.cs +++ b/Projects/UOContent/Accounting/Account.cs @@ -13,6 +13,7 @@ using Server.Network; namespace Server.Accounting; +[PropertyObject] [SerializationGenerator(6)] public partial class Account : IAccount, IComparable {