diff options
author | Emma Miler <emma.pi@protonmail.com> | 2023-04-11 20:49:16 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-11 20:49:16 +0200 |
commit | 450d0b1ed437cf37b4309af952af8904f3f07768 (patch) | |
tree | 3f0fd39b5663b5c3f4b9e76c70cc4987f22d66c7 /NorthstarDLL/plugins/pluginbackend.h | |
parent | 72da1da5b4c04ccc1154853a308cab6459c60b79 (diff) | |
download | NorthstarLauncher-450d0b1ed437cf37b4309af952af8904f3f07768.tar.gz NorthstarLauncher-450d0b1ed437cf37b4309af952af8904f3f07768.zip |
Plugin system v2 (#343)
* Some work
* Rewrite gamestate presence
* Add plugin system logger
* Format changes
* Format chjange
* Fix gamestate stuff
* some callback stuff
* move around invite stuff
* move invite to funcs
* fix presence server data
* Actually call InformSQVMCreated
* bruh
* Fix TODO's
* Formatting
* Fix filters
* Add InformDLLLoads
* Fix plugin handle always being 0
* Formatting
* Fix merge issues
* Formatting
* Mods can add files compiled at SQVM init
* Some Small Fixes
* Add changes from review
* Fix load failure
* Add new squirrel functions
* actually call InformSQVMDestroyed
* add CreateObject function
* answers to complaints
* remove snake cases from GameStatePresence
---------
Co-authored-by: cat_or_not <41955154+catornot@users.noreply.github.com>
Diffstat (limited to 'NorthstarDLL/plugins/pluginbackend.h')
-rw-r--r-- | NorthstarDLL/plugins/pluginbackend.h | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/NorthstarDLL/plugins/pluginbackend.h b/NorthstarDLL/plugins/pluginbackend.h new file mode 100644 index 00000000..ef42c508 --- /dev/null +++ b/NorthstarDLL/plugins/pluginbackend.h @@ -0,0 +1,45 @@ +#pragma once +#include "pch.h" +#include "plugin_abi.h" +#include "shared/gamepresence.h" + +#include <queue> +#include <mutex> + +enum PluginDataRequestType +{ + END = 0, +}; + +union PluginRespondDataCallable +{ + // Empty for now + void* UNUSED; +}; + +class PluginDataRequest +{ + public: + PluginDataRequestType type; + PluginRespondDataCallable func; + PluginDataRequest(PluginDataRequestType type, PluginRespondDataCallable func) : type(type), func(func) {} +}; + +class PluginCommunicationHandler +{ + public: + void RunFrame(); + void PushRequest(PluginDataRequestType type, PluginRespondDataCallable func); + + void GeneratePresenceObjects(); + + public: + std::queue<PluginDataRequest> requestQueue; + std::mutex requestMutex; + + PluginEngineData m_sEngineData {}; +}; + +void init_plugincommunicationhandler(); + +extern PluginCommunicationHandler* g_pPluginCommunicationhandler; |