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:
parent
914e3abfe3
commit
1f4afe1f78
1 changed files with 5 additions and 3 deletions
|
@ -359,10 +359,11 @@ namespace Nibriboard.Client
|
||||||
ChunkUpdateMessage response = new ChunkUpdateMessage();
|
ChunkUpdateMessage response = new ChunkUpdateMessage();
|
||||||
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);
|
|
||||||
|
|
||||||
Send(response);
|
await SendChunks(missingChunks);
|
||||||
|
/*response.Chunks = await CurrentPlane.FetchChunks(missingChunks);
|
||||||
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue