Updates Serialization (#292)

- [X] Removes all save strategies
- [X] Removes duplicate file writer that won't be used
- [X] Removes persistence (it will become a duplicate system)
- [X] Add a save position variable to skip serializing a clean item/mobile
- [X] Update Guilds/Accounts to be IEntity types
    - Because guilds are abstract, this may make serialization tricky.
- [X] Update the generalized IEntity writing
- [X] Update the load/save to write to buffers then to files in background


Bumps release version
This commit is contained in:
Kamron Batman 2020-10-31 17:38:29 -07:00 committed by GitHub
parent a8d486a969
commit 1ca8655fc1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
43 changed files with 1148 additions and 4351 deletions

View file

@ -7,41 +7,13 @@ namespace Server
public static readonly Serial MinusOne = new Serial(0xFFFFFFFF);
public static readonly Serial Zero = new Serial(0);
public static Serial LastMobile { get; private set; } = Zero;
public static Serial LastItem { get; private set; } = 0x40000000;
public static Serial NewMobile
{
get
{
while (World.FindMobile(LastMobile += 1) != null)
{
}
return LastMobile;
}
}
public static Serial NewItem
{
get
{
while (World.FindItem(LastItem = LastItem + 1) != null)
{
}
return LastItem;
}
}
private Serial(uint serial) => Value = serial;
public uint Value { get; }
public bool IsMobile => Value > 0 && Value < 0x40000000;
public bool IsMobile => Value > 0 && Value < World.ItemOffset;
public bool IsItem => Value >= 0x40000000 && Value < 0x80000000;
public bool IsItem => Value >= World.ItemOffset && Value < World.MaxItemSerial;
public bool IsValid => Value > 0;