Closed deluvas1911 closed 2 years ago
Can also be reproduced on release.
I investigated this issue and it turns out that the problem is in the alt:V Core instead of the Client JS module.
The MemoryBuffer is not even passed to the native because (probably all) natives that expect a struct, have the arg type that is supposed to be ARG_STRUCT
set to ARG_INT32_PTR
, so the JS module doesn't pass it correctly.
After passing the memory buffer when the type is ARG_INT32_PTR
it works as expected, so the problem is the wrong native arg type.
Still not working. Idk if it is affected by the new natives' argument parsing mechanism.
Still not working. Idk if it is affected by the new natives' argument parsing mechanism.
It is not. The change for this needs to be made in core. But there is already work being done to update the generator, so this issue will get fixed eventually.
Fixed in next dev. All natives that take a struct now have to be manually added to a list, so if you encounter a native that needs a MemoryBuffer as argument contact me or add it to this list yourself, and make a PR: https://github.com/altmp/altv-js-module/blob/08c991dd1a61bd837f2fc3384f09819ec6982fd1/client/src/bindings/V8Natives.cpp#L331
Nevermind, we will fix this in another way.
Missing natives:
getWeaponHudStats (arg: 1) getWeaponComponentHudStats (arg: 1)
Fixed in next dev
Client/server version
4.0-dev13
Current behavior If you use the MemoryBuffer to read data, all ints are returned as 0 and strings are empty. The same struct being used in scripthook returns valid data. The returned data for my provided sample is:
[0,0,0,0,0,0,0,0,0,""]
Expected behavior Return the correct data
Steps to reproduce Either use the code provided in the samples or use this code:
Context (environment) Same behaviour with Steam, Epic & Rockstar GTA
Additional information This is the struct which is working in scripthook:
Here can be found more samples which have worked at some time with the memorybuffer, but now also only return 0.