1
0
Fork 0

[server] Fix loading saves

This commit is contained in:
Starbeamrainbowlabs 2017-10-23 19:51:16 +01:00
parent 192e25f27e
commit aca12a3012
3 changed files with 11 additions and 2 deletions

View File

@ -51,7 +51,7 @@ namespace Nibriboard
FilePrefix = "Nibriboard.ClientFiles",
ClientSettings = clientSettings,
SpaceManager = planeManager
}, IPAddress.IPv6Any, Port);
}, IPAddress.Any, Port);
}
public async Task Start()

View File

@ -221,7 +221,13 @@ namespace Nibriboard.RippleSpace
}
public static async Task<Chunk> FromStream(Plane plane, StreamReader chunkSource)
{
Chunk loadedChunk = JsonConvert.DeserializeObject<Chunk>(await chunkSource.ReadToEndAsync());
Chunk loadedChunk = JsonConvert.DeserializeObject<Chunk>(
await chunkSource.ReadToEndAsync(),
new JsonSerializerSettings() {
MissingMemberHandling = MissingMemberHandling.Ignore,
NullValueHandling = NullValueHandling.Ignore
}
);
loadedChunk.plane = plane;
loadedChunk.Location.Plane = plane;
foreach(DrawnLine line in loadedChunk.lines)

View File

@ -14,6 +14,9 @@ namespace Nibriboard.RippleSpace
/// </summary>
public ChunkReference ContainingChunk {
get {
if(Plane == null)
return null;
return new ChunkReference(
Plane,
X / Plane.ChunkSize,