Closed aymanhilal closed 6 months ago
You can't use the CName value directly from the packet if it's a mod, it will need converting to hex.
If all three characters in CName are alphanumeric (0-9,A-Z,a-z), then it is compatible with stock LFS cars and you can use it as is. Otherwise, you need to use the hex representation of the binary value of CName to get the mod Skin ID
I don't know if there's a helper already in Node InSim to do this for you, but I couldn't find one at first glance.
For ref - https://www.lfs.net/forum/thread/95662-New-InSim-packet-size-byte-and-mod-info explains, from the dev team.
Thanks for the report, it is a bug. The CName
property in the IS_NPL packet class was wrongly annotated as a @stringNull()
data type when being unpacked. I have changed the annotation to @carName()
which converts the binary Skin ID to a HEX string correctly. This data type is already used in IS_SLC.
:tada: This issue has been resolved in version 4.0.2 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
Hi,
I'm using useOnPacket which is a react-node-insim hook, the issue is CName returns random gibberish for modded vehicles only and this does not happen with default LFS vehicles. The same behavior occurs when using inSim.on() method and capturing ISP_NPL packets as well.
I'm capturing ISP_NPL packet to make an API call to retrieve the modded vehicle name in order to save it.
Any help is greatly appreciated.