[WIP] Initial Blacktek support - groups, vocations, items#354
[WIP] Initial Blacktek support - groups, vocations, items#354
Conversation
items.toml loading through custom parser - no .toml reader that I tested can read it
Unfortunately, all the fields are custom tailored to the tfs item properties... and in general this will be the same for all our toml formats... I'm sorry, I know that some decisions I have made, have lead to making it harder on people for migration and or supporting my project via their own project designed to be compatible... but I very much feel the need to break any restraints that keep a person from programming to make the best software they can make. Thank you very much for working to support blacktek with myaac |
|
No problem, I like the new format a lot. You did an awesome work here. The items.toml problem is not the custom fields, the reader should read it anyway. The problem I occured was with PHP timeout due to size of the file - I think the reader has poor support for bigger files. |
There was a problem hiding this comment.
Pull request overview
This pull request adds initial Blacktek support by introducing TOML configuration file format support alongside the existing XML format for vocations, groups, and items. The PR refactors the existing architecture to support both formats through a factory pattern, with automatic detection of which format to use based on file existence.
Changes:
- Refactored Vocations, Groups, and Items classes to support both XML and TOML formats with automatic format detection
- Implemented custom TOML parser for items.toml due to limitations with existing TOML libraries
- Added devium/toml dependency for parsing standard TOML configuration files
Reviewed changes
Copilot reviewed 16 out of 17 changed files in this pull request and generated 22 comments.
Show a summary per file
| File | Description |
|---|---|
| system/src/Server/Vocations.php | New factory class that detects and loads vocations from either TOML or XML format |
| system/src/Server/Groups.php | New factory class that detects and loads groups from either TOML or XML format |
| system/src/Server/XML/Vocations.php | Refactored to instance-based implementation, delegates static methods to parent namespace |
| system/src/Server/XML/Groups.php | New XML loader extracted from OTS_Groups_List.php |
| system/src/Server/XML/Items.php | New XML loader extracted from Items class |
| system/src/Server/TOML/Vocations.php | New TOML loader for vocations configuration |
| system/src/Server/TOML/Groups.php | New TOML loader for groups configuration |
| system/src/Server/TOML/Items.php | New TOML loader for items configuration |
| system/src/Server/TOML/ItemsParser.php | Custom parser for items.toml format using parse_ini_string |
| system/src/Items.php | Refactored to use factory pattern for loading items from XML or TOML |
| system/src/DataLoader.php | Updated method call from loadFromXML to load |
| system/pages/online.php | Updated import and added null safety check for getOriginal |
| system/pages/highscores.php | Updated import to use refactored namespace |
| system/init.php | Updated import to use refactored namespace |
| system/libs/pot/OTS_Groups_List.php | Simplified to use new Groups factory class |
| composer.json | Added devium/toml dependency |
| composer.lock | Updated with new dependencies (devium/toml and php-ds/php-ds) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Deprecate old Outfits & Mounts functions
Using simplexml, which is enabled by default on php
items.toml loading through custom parser - no .toml reader that I tested can read it