* Rename enums in LoadOrQuitAction.h
* Rename enums in ScenarioSetSettingAction.h
* Rename enums in TileModifyAction.h
* Rename enums in NetworkModifyGroupAction.h
* Rename enums in LandBuyRightsAction.h
* Rename enums in LandSetRightsAction.h
* Rename enums in ParkSetParameterAction.h
* Rename enums in PeepPickupAction.h
* Rename enums in StaffSetPatrolAreaAction.h
* Rename enums in RideFreezeRatingAction.h
* Rename enums in RideSetAppearanceAction.h
* Rename enums in RideSetSettingAction.h
* Rename enums in RideSetVehicleAction.h
* Rename enums in BannerSetStyleAction.h
* Rename Award members to lowerCamelCase
* Rename MarketingCampaign members to lowerCamelCase
* Rename ResearchItem members to lowerCamelCase
* Rename News::ItemQueues members to lowerCamelCase
* Rename News::ItemQueue members to lowerCamelCase
* Rename Network::Player members to camelCase
* Rename Network::NetworkGroup members to camelCase
* Rename Network::Connection members to camelCase
* Rename NetworkServerAdvertiser members to camelCase
* Rename NetworkAction members to camelCase
* Rename NetworkActions members to camelCase
* Rename Network::User members to camelCase
* Rename Network::UserManager members to camelCase
* Rename PacketLegacyHeader members to camelCase
* Rename Network::Packet members to camelCase
* add workflow and package.json for publishing plugin TypeScript types
* move scripting-related files to scripting folder
* add support for trusted publishers
* fix path to scripting readme
* rename scripting README.md back to scripting.md
* support tagged/dev releases
* add workflow for development versions
* Update package.json website
* change dependencies in publish-plugin-types
* add timestamp to dev plugin versions
* note ScriptEngine.h grep dependency from CI
* use gh-describe to track release version for dev plugin types
The scripting engine's `ExecutePluginCall` by default frees its `JSValue` arguments.
When `HookEngine::Call` iterates over multiple subscribers, the first call would free
the argument, leaving subsequent subscribers with an invalid pointer (use-after-free).
This commit fixes the issue by duplicating the `JSValue` for each subscriber and
ensuring the original value is correctly managed based on the `keepArgsAlive` flag.
A new C++ headless test `ScriptingTests.cpp` is added to verify the fix and prevent
future regressions.
Previously JS entities would create prototypes on each allocation in
`Sc*::New`. This change creates a single global protype for each entity
class which then gets copied upon entity allocation in JS realm.
Running test with "Live Ride Measurements" plugin on a park shared for
performance testing I get following results:
| | OpenRCT2::Scripting::HookEngine::Call | OpenRCT2::Scripting::ScMap::getAllEntities |
|-----------------|---------------------------------------|--------------------------------------------|
| duktape | 68ms | 10ms |
| quickjs current | 318ms | 126ms |
| quickjs + fix | 22ms | 942µs |
Previously each call to `getAllEntities` would result in 1382 calls to
`JS_SetPropertyFunctionList`, each costing 90.5µs.
Park used: https://files.catbox.moe/z6j2g4.park
* Pass ParkData ref to game actions
* Require ParkData& param for most Park functions
* Pass ParkData& param to Award check functions
* Replace a few more instances of indirect ParkData access
* Refactor: Profiler thread safety and JSON export support
Refactors the profiling system to be thread safe using lock free atomics for the hot path, adds JSON export with call graph data, and updates the
API to use camelCase naming convention
* Address profiler refactor review feedback
Use a ',' for CSV export and moved implementations to the profiling.cpp to avoid <algorithm> in the header.