fix: Adds AfterSerialize support. Removes BeforeSerialize support. (#1208)
### Changes * Implements an AfterSerialize method that is executed synchronously. * Removes `BeforeSerialize` support since it was dangerous in its current implementation. * Moves PlayerMobile kill/virtual decay to AfterSerialize. * Adds kill decay to after Deserialize.
This commit is contained in:
parent
deabab575a
commit
49e6c6f2d1
13 changed files with 132 additions and 61 deletions
|
|
@ -1148,10 +1148,6 @@ namespace Server.Guilds
|
|||
list.TrimExcess();
|
||||
}
|
||||
|
||||
public override void BeforeSerialize()
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(IGenericWriter writer)
|
||||
{
|
||||
if (LastFealty + TimeSpan.FromDays(1.0) < Core.Now)
|
||||
|
|
@ -1231,6 +1227,12 @@ namespace Server.Guilds
|
|||
writer.Write(Website);
|
||||
}
|
||||
|
||||
public override bool ShouldExecuteAfterSerialize => false;
|
||||
|
||||
public override void AfterSerialize()
|
||||
{
|
||||
}
|
||||
|
||||
public override void Delete()
|
||||
{
|
||||
World.RemoveGuild(this);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue