Update chunk logic
Correctly store time of last modification Use "load" to get a chunk (or load/create one if it isn't loaded)
This commit is contained in:
parent
d68d32ff2f
commit
4822cab0fc
3 changed files with 14 additions and 13 deletions
|
|
@ -17,7 +17,7 @@ class WotServer(WebSocket):
|
|||
with pool:
|
||||
for coor in coords:
|
||||
pos = Position(coor[0], coor[1])
|
||||
chunk = pool.get(pos) or pool.create(pos)
|
||||
chunk = pool.load(pos)
|
||||
diffs.append((pos, chunk.as_diff()))
|
||||
|
||||
self.loaded_chunks.add(pos)
|
||||
|
|
@ -65,7 +65,7 @@ class WotServer(WebSocket):
|
|||
for dchunk in diffs:
|
||||
pos = dchunk[0]
|
||||
diff = dchunk[1]
|
||||
chunk = pool.get(pos) or pool.create(pos)
|
||||
chunk = pool.load(pos)
|
||||
reverse_diff = diff.diff(chunk.as_diff())
|
||||
reverse_diffs.append((pos, reverse_diff))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue