Oxide.Rust
Oxide.Rust copied to clipboard
CuiHelper Json build optimisation.
Json build optimisation. Added ability to send UI to the list of players.
According to my tests it reduces serialisation time up to 2-3 times.
Correct me if I'm wrong, but this way we loose
DefaultValueHandling = DefaultValueHandling.Ignore
In this case every field with default value would be send and it would totally mess up update = true
, because every field that I didn't set manually would be updated to default values
The default values will not be sent. I have tested on all UI plugins I use, no problems found.
Oh, my bad I didn't notice that you're manually checking them in WriteJson
Hey, this looks interesting but I'm a bit concerned about some of the default value handling. Some such as the AnchorMin/Max you're not sending if the value is set to "0 0" "1 1", however setting those will change the behavior in-game for some reason. Can we test and make sure the variables we're skipping are actually properly being defaulted on the client? The client code doesn't set the default if the field isn't send in most if not all cases.
Hey, this looks interesting but I'm a bit concerned about some of the default value handling. Some such as the AnchorMin/Max you're not sending if the value is set to "0 0" "1 1", however setting those will change the behavior in-game for some reason. Can we test and make sure the variables we're skipping are actually properly being defaulted on the client? The client code doesn't set the default if the field isn't send in most if not all cases.
I have removed this handling of default values, there may indeed be problems when updating the UI.
@MrBlue, could you take a look?
Hey @SkiTee3000 would you mind updating this again? Not gonna merge it this wipe but want to try test it before next wipe to make sure there's no issues or breaking changes when we merge it.
Hey @SkiTee3000 would you mind updating this again? Not gonna merge it this wipe but want to try test it before next wipe to make sure there's no issues or breaking changes when we merge it.
updated
@MrBlue Check It pls
@SkiTee3000 Update this for new cooldown fixes
@DezLife, updated. @MrBlue, can you check?
@DezLife, updated. @MrBlue, can you check?
He will add this in an update in the test build. So that it can be tested and then added to the main build
I just did a benchmark, compared to the current implementation in Oxide the json build is 3 times faster and there is 10% less memory allocation. But I can't say that the results of my benchmark are super accurate, it was done on test data, not on any real ui.
I just did a benchmark, compared to the current implementation in Oxide the json build is 3 times faster and there is 10% less memory allocation. But I can't say that the results of my benchmark are super accurate, it was done on test data, not on any real ui.
This implementation will in any case speed up json serialization and reduce allocations
@SkiTee3000 Add also the ability to DestroyUI for the list of players