altmp / altv-js-module-v2

alt:V JavaScript v2 module
MIT License
10 stars 9 forks source link

fix array buffer deserialization #243

Closed xxshady closed 3 months ago

xxshady commented 3 months ago

See same bug in v1: https://github.com/altmp/altv-js-module/pull/322

import alt from '@altv/server'

alt.Events.on('test', (...data) => {
  alt.log({ data })
})

setTimeout(() => {
  // Error: Unable to deserialize cloned data due to invalid or unsupported version
  alt.Events.emit('test', new Uint8Array([1, 2, 3, 4, 5]).buffer)
}, 100)