-
Notifications
You must be signed in to change notification settings - Fork 125
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
Plugin interfaces (plugins v4) #615
Conversation
This reverts commit b079624.
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.
everything looks good now :)
seams to be all working well with rrplug.
although probably later there should be a pr to expose access to some hooked northstar functions.
yeah interfaces aren't done and I wouldn't even consider the ones in this PR final, this is just to replace the plugin sys and expand on interfaces later |
b7b7cd2
to
7f84bdf
Compare
what |
note to self; read git output before force pushing |
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.
Re-confirmed working in testing. Tested with:
- loading outdated plugin (it simply gets unloaded as invalid plugin)
- Together with DiscordRPC PR: Update DiscordRPC to plugins v4 NorthstarDiscordRPC#17
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.
Skimmed code a bit again and overall I also like the improvement in code quality here and there (as far as I could tell).
I'm just gonna hope that other code reviews found all the potential issues and the rest we figure out post-merge ig ^^
requested have been addressed
* requested changes have been addressed |
Replaces the current plugin api with source interfaces.
The launcher exposes almost everything required by plugins in interfaces that allow for backwards compatibility.
The only thing that's passed to a plugin directly is the northstar dll HWND and a struct of data that's different for each plugin.
Plugins are required to expose a
void* CreateInterface(const char* name, int* status)
function to share their own interfaces.The launcher loads the
PluginId
interface from the plugin to query info such as it's name.Plugins can use the
CreateInterface
function exposed by the Northstar DLL to use Northstar interfaces such as for logging.An interface is just an abstract class to force all functions into a vftable.
Northstar Interfaces
NSSys001
Exposes some system functionality to plugins
Required Plugin Interfaces
Interfaces that have to be exposed for the plugin to be loaded.
PluginId001
PluginCallbacks001
What's an interface anyways?
Interfaces are just abstract classes. So make sure the first parameter is always a pointer to the instance of the interface you're using.
an example what
NSSys001
looks like in C:Interfaces are created with
CreateInterface
that's exposed in another dll.Removed stuff
plugin_abi.h
that you can include in plugins for the required typedefs. Not a big con because that barely worked to begin with because of the billion files theplugin_abi.h
file included.I've made an example plugin that I try to keep up to date with the new api
That's it not really that complicated imo