ACEmulator / ACE

Asheron's Call server emulator.
https://emulator.ac
GNU Affero General Public License v3.0
297 stars 242 forks source link

Switch to System.Text.Json #4002

Closed LtRipley36706 closed 10 months ago

LtRipley36706 commented 1 year ago

Removed Newtonsoft.Json and DouglasCrockford.JsMin

Existing installs appear to be compatible.

Need to test compatibility with importing and exporting JSON files, "out of the box" setup, and verify changes do not break shared projects such as aclogview, ACViewer, GDLCacheBinParser to the extent that they use any of the shared common projects.

LtRipley36706 commented 1 year ago

Updated to confirm out of box setup and JSON exports now functional

Mag-nus commented 1 year ago

I think we have the jsmin for the comment support in our config files

LtRipley36706 commented 1 year ago

I think we have the jsmin for the comment support in our config files

Config = JsonSerializer.Deserialize<MasterConfiguration>(fileText, new JsonSerializerOptions { ReadCommentHandling = JsonCommentHandling.Skip, NumberHandling = JsonNumberHandling.AllowReadingFromString });

ReadCommentHandling = JsonCommentHandling.Skip is what DouglasCrockford.JsMin was doing. NumberHandling = JsonNumberHandling.AllowReadingFromString resolves an issue found in a few places in our files where we put numbers inside quotes, but truly meant for them to numbers.

There was also an issue with our starterGear.json file that the boolean values were being placed inside quotes, so I had to write a custom converter to ensure compatibility

LtRipley36706 commented 1 year ago

merged with latest and updated to reflect recent additions