-
-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: Threading and Plugin System Rewrite #182
Conversation
This PR among other things will allow us to complete #173 and further integrate with other plugins and game engines over socketioxide |
…-Dev/Horizon-Community-Edition into Major-system-overhaul
…-Dev/Horizon-Community-Edition into Major-system-overhaul
…t a second basic fn later)
@Tuafo When you get the chance would you mind helping me on a PebbleVault plugin rework? it and a bunch of the other plugins will need to change how they work in order to work properly in the new API. Shouldn't take too long I think. |
This reverts commit 06b2205.
…te. Adding cross talk is next
@haywoodspartan @Tuafo @WilliamAnimate Would you guys mind taking a look at how plugins are written on this branch (mainly the struct plugin defined in the horizon_plugin_api crate and implementing a different trait on the struct in each plugin (see I want to know if you guys think this is a solid way of doing function calls to plugins in a type-safe way. Thanks you guys ❤️ |
I'll take a look when i get back home; I'm in a class right now |
Stay in school kids 😆 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see the code
// Define the trait properly
pub trait Plugin_API {
fn thing(&self) -> String;
}
pub trait Plugin_Construct {
// If you want default implementations, mark them with 'default'
fn new(plugins: HashMap<&'static str, LoadedPlugin>, socket: SocketRef, players: Arc<RwLock<Vec<horizon_data_types::Player>>>) -> Plugin;
}
being repeated multiple times throughout different plugins. maybe put it into some crate, and reference it?
This is due to each plugin needing to impl its own API, these can be customized but in the case of the plugins we have it is not yet. Each plugin impl's its own trait onto the |
Only applies to current plugins' inplementations, the signatures of functions will very and cannot be centralized unfortunatelty
Pull Request Summary: Threading and Plugin System Rewrite
Overview
This PR introduces a major rewrite of the plugin system architecture with a focus on improved threading and state management.
Key Changes
Architecture Changes
Mutex
toRwLock
for improved concurrent accessPlugin System Rewrite
This PR also introduces a simplified and more maintainable plugin architecture that replaces the previous trait-heavy implementation.
Key Changes
PluginManager
with explicit state management (ACTIVE/INACTIVE/CRASH)New Features
get_plugin!
macroDependencies
Performance Optimizations
Breaking Changes
Testing
Migration Notes
Existing plugins will need to be updated to work with the new API structure and state management system.