[doubt] use macrotasks for processing local server data

this allow to better simulate env flying squid running in, but ideally shouldn't be used imo
the main intention here is too wether it can improve fps stability. I don't really think moving flying squid to web worker would significantly improve performance as I see still most of the time is lost in three.js stuff
This commit is contained in:
Vitaly 2023-09-23 03:52:34 +03:00
commit 6dfd8b366d

View file

@ -6,7 +6,9 @@ window.serverDataChannel ??= {}
export const customCommunication = {
sendData(data) {
//@ts-ignore
window.serverDataChannel[this.isServer ? 'emitClient' : 'emitServer'](data)
setTimeout(() => {
window.serverDataChannel[this.isServer ? 'emitClient' : 'emitServer'](data)
})
},
receiverSetup(processData) {
//@ts-ignore