This PR introduces a new feature for the Event Scheduler system that enables it to read event configurations from a JSON file. This change modernizes and simplifies the way events are configured, moving away from XML files to a more developer-friendly JSON format. The update aims to improve readability, maintainability, and flexibility when managing event data.
Additionally, the new implementation enhances consistency by providing a unified approach for defining event details, loot tables, and other parameters. The JSON-based configuration also helps reduce parsing errors and makes the addition of new event properties easier.
Automatic loading of event details such as name, start and end dates, and loot settings from a JSON file.
Backward-compatible approach that ensures current functionality remains intact.
Behaviour
Actual
Currently, the Event Scheduler uses an XML file to manage events, which makes it more difficult to add or modify configurations due to the verbosity and inflexibility of XML.
Expected
The Event Scheduler should now use a JSON file (events.json) to manage events. JSON provides a more compact, readable, and maintainable structure for event configuration. Users should be able to add, edit, and manage events more easily with this new format.
Type of change
[ ] Bug fix (non-breaking change which fixes an issue)
[x] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
[ ] This change requires a documentation update
How Has This Been Tested
Tests were conducted to ensure that the new JSON format loads correctly and events are scheduled as expected. The tests included validating successful parsing of the JSON file, checking the correct initialization of event properties, and ensuring existing functionality remains stable.
[x] Loaded various JSON configurations with multiple events to verify accurate parsing.
[x] Confirmed that events are correctly registered, including start and end dates, and associated loot tables.
[x] Tested with malformed JSON to ensure appropriate error handling.
Checklist
[x] My code follows the style guidelines of this project
[x] I have performed a self-review of my own code
[x] I checked the PR checks reports
[x] I have commented my code, particularly in hard-to-understand areas
[x] I have made corresponding changes to the documentation
[x] My changes generate no new warnings
[x] I have added tests that prove my feature works effectively
Description
This PR introduces a new feature for the Event Scheduler system that enables it to read event configurations from a JSON file. This change modernizes and simplifies the way events are configured, moving away from XML files to a more developer-friendly JSON format. The update aims to improve readability, maintainability, and flexibility when managing event data.
Additionally, the new implementation enhances consistency by providing a unified approach for defining event details, loot tables, and other parameters. The JSON-based configuration also helps reduce parsing errors and makes the addition of new event properties easier.
New case from login.php (myaac):
Feature Highlights:
Behaviour
Actual
Currently, the Event Scheduler uses an XML file to manage events, which makes it more difficult to add or modify configurations due to the verbosity and inflexibility of XML.
Expected
The Event Scheduler should now use a JSON file (
events.json
) to manage events. JSON provides a more compact, readable, and maintainable structure for event configuration. Users should be able to add, edit, and manage events more easily with this new format.Type of change
How Has This Been Tested
Tests were conducted to ensure that the new JSON format loads correctly and events are scheduled as expected. The tests included validating successful parsing of the JSON file, checking the correct initialization of event properties, and ensuring existing functionality remains stable.
Checklist