clugg / sm-json

A pure SourcePawn JSON encoder/decoder.
GNU General Public License v3.0
82 stars 8 forks source link

[Bug]Int64 Not supported #25

Closed mostten closed 2 years ago

mostten commented 2 years ago

The original num is 2286852952, but decode num be converted to -2008114344.

mostten commented 2 years ago

The original num is 2286852952, but decode num be conberted to -2008114344.

Sourcemod new api with "StringToInt64" can be use it?

clugg commented 2 years ago

Thanks for the suggestion! I've had a play with implementing this but I've encountered an issue with the new int64 natives along the way. I've submitted a PR to resolve this here but I'll have to put this on hold until it's merged.

mostten commented 2 years ago

Thanks for the suggestion! I've had a play with implementing this but I've encountered an issue with the new int64 natives along the way. I've submitted a PR to resolve this here but I'll have to put this on hold until it's merged.

I made some changes on your old version, using strings to store Int64 to make it support Int64.

Now the Sourcemod dev build 6861 was fixed with your code, Please update json script, Thanks

clugg commented 2 years ago

I've just released v4.0.0 which adds int64 support - you can find specific implementation details in the linked release notes. Here is the relevant documentation:

Thanks for your suggestion!