1
0
Fork 0
mirror of https://github.com/sbrl/Nibriboard.git synced 2018-01-10 21:33:49 +00:00

[server] Fix strange bug in ChunkUpdateRequest

This commit is contained in:
Starbeamrainbowlabs 2017-06-26 12:48:58 +01:00
parent 914e3abfe3
commit 1f4afe1f78

View file

@ -360,9 +360,10 @@ namespace Nibriboard.Client
List<ChunkReference> missingChunks = ChunkTools.GetContainingChunkReferences(CurrentPlane, CurrentViewPort); List<ChunkReference> missingChunks = ChunkTools.GetContainingChunkReferences(CurrentPlane, CurrentViewPort);
missingChunks = chunkCache.FindMissing(missingChunks); missingChunks = chunkCache.FindMissing(missingChunks);
response.Chunks = await CurrentPlane.FetchChunks(missingChunks); await SendChunks(missingChunks);
/*response.Chunks = await CurrentPlane.FetchChunks(missingChunks);
Send(response); Console.WriteLine(JsonConvert.SerializeObject(response));
Send(response);*/
chunkCache.Add(missingChunks); chunkCache.Add(missingChunks);
} }
@ -488,6 +489,7 @@ namespace Nibriboard.Client
foreach(ChunkReference chunkRef in chunkRefs) foreach(ChunkReference chunkRef in chunkRefs)
updateMessage.Chunks.Add(await CurrentPlane.FetchChunk(chunkRef)); updateMessage.Chunks.Add(await CurrentPlane.FetchChunk(chunkRef));
Log.WriteLine("[NibriClient#{0}/SendChunks] Sending {1} chunks", Id, updateMessage.Chunks.Count);
Send(updateMessage); Send(updateMessage);
} }
} }