fix: Fixes props for interfaces and adds account manipulation (#2179)

This commit is contained in:
Kamron Batman 2025-05-09 15:39:47 -07:00 committed by GitHub
parent f95b3a8b3b
commit 05825a11e2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 14 additions and 9 deletions

View file

@ -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; }

View file

@ -895,7 +895,7 @@ public partial class Mobile : IHued, IComparable<Mobile>, 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)]

View file

@ -13,6 +13,7 @@ using Server.Network;
namespace Server.Accounting;
[PropertyObject]
[SerializationGenerator(6)]
public partial class Account : IAccount, IComparable<Account>
{