From 9fa7a04d47882230207937534a3c8286d0724995 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Fri, 15 Dec 2017 20:05:53 +0000 Subject: [PATCH] [client] Add debug method to clear the requested chunks from the chunk cache. --- Nibriboard/ClientFiles/ChunkCache.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Nibriboard/ClientFiles/ChunkCache.js b/Nibriboard/ClientFiles/ChunkCache.js index 858792b..8d8d43c 100644 --- a/Nibriboard/ClientFiles/ChunkCache.js +++ b/Nibriboard/ClientFiles/ChunkCache.js @@ -70,6 +70,14 @@ class ChunkCache return lineFragments; } + clearRequestedChunks() + { + for(let [chunkRefStr, chunk] of this.cache.entries()) { + if(!(chunk instanceof Chunk)) + this.cache.delete(chunkRefStr); + } + } + /** * Adds the given chunk to the chunk cache. * @param {Chunk} chunkData The chunk to add to the cache.