mirror of
https://github.com/sbrl/Nibriboard.git
synced 2018-01-10 21:33:49 +00:00
[server] Fix loading saves
This commit is contained in:
parent
192e25f27e
commit
aca12a3012
3 changed files with 11 additions and 2 deletions
|
@ -51,7 +51,7 @@ namespace Nibriboard
|
|||
FilePrefix = "Nibriboard.ClientFiles",
|
||||
ClientSettings = clientSettings,
|
||||
SpaceManager = planeManager
|
||||
}, IPAddress.IPv6Any, Port);
|
||||
}, IPAddress.Any, Port);
|
||||
}
|
||||
|
||||
public async Task Start()
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -14,6 +14,9 @@ namespace Nibriboard.RippleSpace
|
|||
/// </summary>
|
||||
public ChunkReference ContainingChunk {
|
||||
get {
|
||||
if(Plane == null)
|
||||
return null;
|
||||
|
||||
return new ChunkReference(
|
||||
Plane,
|
||||
X / Plane.ChunkSize,
|
||||
|
|
Loading…
Reference in a new issue