forked from ppfun/pixelplanet
fix redisMoveCanvas script
This commit is contained in:
parent
d88db0ead4
commit
3bf536e4de
|
@ -18,9 +18,8 @@ async function move() {
|
||||||
const key = `ch:8:${x}:${y}`;
|
const key = `ch:8:${x}:${y}`;
|
||||||
const chunk = await redisc.get(key, { returnBuffers: true });
|
const chunk = await redisc.get(key, { returnBuffers: true });
|
||||||
if (chunk) {
|
if (chunk) {
|
||||||
const buffer = new Uint8Array(chunk);
|
|
||||||
const newKey = `ch:8:${x + offset}:${y + offset}`
|
const newKey = `ch:8:${x + offset}:${y + offset}`
|
||||||
await redisc.set(newKey, Buffer.from(buffer.buffer));
|
await redisc.set(newKey, chunk);
|
||||||
await redisc.del(key);
|
await redisc.del(key);
|
||||||
console.log('Moved Chunk ', key, ' to ', newKey);
|
console.log('Moved Chunk ', key, ' to ', newKey);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user