소스 검색

work

tags/v0.11.0
Shaun 2 년 전
부모
커밋
012809dffd
1개의 변경된 파일22개의 추가작업 그리고 5개의 파일을 삭제
  1. +22
    -5
      src/server/world/atlas.js

+ 22
- 5
src/server/world/atlas.js 파일 보기

@@ -58,6 +58,27 @@ module.exports = {
} }
}); });
}, },

removeObjectFromInstancedZone: async function (thread, obj, callback) {
await new Promise(res => {
const cb = this.registerCallback(res);

thread.worker.send({
method: 'forceSavePlayer',
args: {
playerName: obj.name,
callbackId: cb
}
});
});

thread.worker.kill();
this.threads.spliceWhere(t => t === thread);

if (callback)
callback();
},

removeObject: function (obj, skipLocal, callback) { removeObject: function (obj, skipLocal, callback) {
if (!skipLocal) if (!skipLocal)
objects.removeObject(obj); objects.removeObject(obj);
@@ -67,11 +88,7 @@ module.exports = {
return; return;


if (thread.instanced) { if (thread.instanced) {
thread.worker.kill();
this.threads.spliceWhere(t => t === thread);

if (callback)
callback();
this.removeObjectFromInstancedZone(thread, obj, callback);


return; return;
} }


불러오는 중...
취소
저장