View Issue Details

IDProjectCategoryView StatusLast Update
0008848Multi Theft Auto : San AndreasScriptingpublic2017-06-28 22:48
ReporterGallardo9944Assigned Toqaisjp 
PrioritynormalSeverityfeatureReproducibilityN/A
Status resolvedResolutionfixed 
Product Version 
Target Version1.5Fixed in Version1.5 
Summary0008848: [Request] Add toJSON compact mode
Description

Currently toJSON returns a string containing a lot of spaces, e.g.:

{ "posY": -1669.1435546875, "rotZ": 90, "posX": 3500.5869140625, "model": 10937, "posZ": 5.2926301956176758 },

We could add an argument to trim spaces in toJSON so it becomes like this:

{"posY":-1669.1435546875,"rotZ":90,"posX":3500.5869140625,"model":10937,"posZ":5.2926301956176758},

Multiplied by a huge amount of such data, useless spaces take a nice amount of memory. Adding compact toJSON may reduce the amount of traffic sent to players by (for example) converting a table to a compact JSON string.

Additional Information

toJSON could look like that:

string toJSON ( var value, [ bool compact = false ] )

TagsNo tags attached.

Activities

arranTuna

2015-05-10 13:14

manager   ~~0023275

It'd make much more difference if you rounded those ridiculously long numbers.

Gallardo9944

2015-05-10 13:54

viewer   ~~0023276

toJSON actually does cause such long numbers:

/run outputChatBox(toJSON({0.0053453}))
[ [ 0.0053452998399734497 ] ]

qaisjp

2015-05-30 01:48

administrator   ~~0023329

Audifire made a pull request https://github.com/multitheftauto/mtasa-blue/pull/7

Merge commit: https://github.com/multitheftauto/mtasa-blue/commit/feaabe986b27cf2e0406cdd55b2c68d084178b56

Individual commits:
http://git.io/vkzkw
http://git.io/vkzki

Issue History

Date Modified Username Field Change