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:
parent
a8d486a969
commit
1ca8655fc1
43 changed files with 1148 additions and 4351 deletions
|
|
@ -575,7 +575,7 @@ namespace Server.Guilds
|
|||
|
||||
protected override void OnTick()
|
||||
{
|
||||
foreach (var g in BaseGuild.List.Values)
|
||||
foreach (var g in World.Guilds.Values)
|
||||
{
|
||||
(g as Guild)?.CheckExpiredWars();
|
||||
}
|
||||
|
|
@ -632,7 +632,7 @@ namespace Server.Guilds
|
|||
PendingWars = new List<WarDeclaration>();
|
||||
}
|
||||
|
||||
public Guild(uint id) : base(id) // serialization ctor
|
||||
public Guild(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -815,7 +815,6 @@ namespace Server.Guilds
|
|||
|
||||
public static void Configure()
|
||||
{
|
||||
EventSink.CreateGuild += EventSink_CreateGuild;
|
||||
EventSink.GuildGumpRequest += EventSink_GuildGumpRequest;
|
||||
|
||||
CommandSystem.Register("GuildProps", AccessLevel.Counselor, GuildProps_OnCommand);
|
||||
|
|
@ -885,7 +884,7 @@ namespace Server.Guilds
|
|||
{
|
||||
m_Leader = null;
|
||||
|
||||
List.Remove(Serial);
|
||||
World.RemoveGuild(this);
|
||||
|
||||
foreach (var m in Members)
|
||||
{
|
||||
|
|
@ -945,7 +944,7 @@ namespace Server.Guilds
|
|||
else
|
||||
{
|
||||
var g = uint.TryParse(arg, out var id)
|
||||
? Find(id) as Guild
|
||||
? World.FindGuild(id) as Guild
|
||||
: FindByAbbrev(arg) as Guild ?? FindByName(arg) as Guild;
|
||||
|
||||
if (g != null)
|
||||
|
|
@ -977,11 +976,6 @@ namespace Server.Guilds
|
|||
}
|
||||
}
|
||||
|
||||
public static void EventSink_CreateGuild(CreateGuildEventArgs args)
|
||||
{
|
||||
args.Guild = new Guild(args.Id);
|
||||
}
|
||||
|
||||
public static Guild GetAllianceLeader(Guild g)
|
||||
{
|
||||
var alliance = g.Alliance;
|
||||
|
|
@ -1234,6 +1228,11 @@ namespace Server.Guilds
|
|||
writer.Write(Website);
|
||||
}
|
||||
|
||||
public override void Delete()
|
||||
{
|
||||
World.RemoveGuild(this);
|
||||
}
|
||||
|
||||
public override void Deserialize(IGenericReader reader)
|
||||
{
|
||||
var version = reader.ReadInt();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue