fix: Reverts GetAccount to use IAccount. Adds IAccount to serialization. (#1565)

### Summary

- Fixes usernames not being `Intern`ed
- Reverts methods related to getting accounts from returning `Account` to `IAccount`.
- Makes `IAccount` also `ISerializable`
- Adds `IGenericReader.ReadAccount()` and `IGenericWriter.Write(IAccount)` -> The read method supports the original serialization of username, and using `IAccount.Serial`. The write method only serializes the `Serial`.
- Exposes `ReadStringRaw()` to allow some advanced scenarios.
This commit is contained in:
Kamron Batman 2023-10-25 19:17:57 -07:00 committed by GitHub
parent a4e2226a5c
commit e6d30fef0f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 201 additions and 19 deletions

View file

@ -12,13 +12,14 @@ using Server.Network;
namespace Server.Accounting
{
[SerializationGenerator(4)]
public partial class Account : IAccount, IComparable<Account>, ISerializable
[SerializationGenerator(5)]
public partial class Account : IAccount, IComparable<Account>
{
public static readonly TimeSpan YoungDuration = TimeSpan.FromHours(40.0);
public static readonly TimeSpan InactiveDuration = TimeSpan.FromDays(180.0);
public static readonly TimeSpan EmptyInactiveDuration = TimeSpan.FromDays(30.0);
[InternString]
[SerializableField(0)]
private string _username;