Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix array buffer (de)serialization #322

Merged
merged 1 commit into from
Aug 14, 2024

Conversation

xxshady
Copy link
Contributor

@xxshady xxshady commented Aug 10, 2024

Fixes conflict of directly sending byte array mvalue and raw emit (which uses byte array mvalue under the hood) by changing order of header and magic bytes

import alt from 'alt-server'

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

// fails at deserialization
// [Error] [V8] Exception: Error: Unable to deserialize cloned data due to invalid or unsupported version.
alt.emit('test', new Uint8Array([1, 2, 3, 4, 5]).buffer)
// works
alt.emitRaw('test', [1, 2, 3])

@xxshady xxshady changed the title fix raw bytes (de)serialization fix array buffer (de)serialization Aug 10, 2024
@Doxoh Doxoh merged commit 4ad0910 into altmp:dev Aug 14, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants