Save chunks in db

One of the changes introduced for this is that multiple chunks and
diffs are now represented by dicts, not lists.
This commit is contained in:
Joscha 2017-04-16 15:51:00 +00:00
parent 9e5b5f874a
commit aca387cf05
4 changed files with 121 additions and 70 deletions

View file

@ -31,7 +31,7 @@ class ClientChunkPool(ChunkPool):
def save_changes(self):
diffs = self.commit_changes()
# filter out empty changes/chunks
diffs = [dchunk for dchunk in diffs if not dchunk[1].empty()]
diffs = {pos: diff for pos, diff in diffs.items() if not diff.empty()}
if diffs:
self._client.send_changes(diffs)