fix(core): Updates to serialization (#590)
- [X] Adds `AdhocPersistence` which replaces RunUO `Persistence` - [X] Fixes a few minor bugs with EntityPersistence deserialization - [X] Reverts/updates some serialization changes
This commit is contained in:
parent
f0969223f7
commit
6e9477ea13
18 changed files with 370 additions and 248 deletions
|
|
@ -53,7 +53,6 @@ namespace Server
|
|||
void Deserialize(string savePath)
|
||||
{
|
||||
var path = Path.Combine(savePath, name);
|
||||
|
||||
AssemblyHandler.EnsureDirectory(path);
|
||||
|
||||
string binPath = Path.Combine(path, $"{name}.bin");
|
||||
|
|
@ -65,10 +64,9 @@ namespace Server
|
|||
|
||||
try
|
||||
{
|
||||
using FileStream bin = new FileStream(binPath, FileMode.Open, FileAccess.Read, FileShare.Read);
|
||||
var buffer = GC.AllocateUninitializedArray<byte>((int)bin.Length);
|
||||
bin.Read(buffer);
|
||||
deserializer(new BufferReader(buffer));
|
||||
using FileStream fs = new FileStream(binPath, FileMode.Open, FileAccess.Read, FileShare.Read);
|
||||
using var br = new BinaryFileReader(fs);
|
||||
deserializer(br);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue