aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDedicatedTest/modmanager.h
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-07-18 17:02:39 +0100
committerBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-07-18 17:02:39 +0100
commita71d52ffd1531a4a03cb4c87dc56ace4f5cb33c1 (patch)
treed3cc5fcde9df08ff131a2216a44c73dee65fdc1f /NorthstarDedicatedTest/modmanager.h
parentca5db71e8215a6c5660fe03088a6d7349f55f817 (diff)
downloadNorthstarLauncher-a71d52ffd1531a4a03cb4c87dc56ace4f5cb33c1.tar.gz
NorthstarLauncher-a71d52ffd1531a4a03cb4c87dc56ace4f5cb33c1.zip
add rapidjson, move all logging to spdlog
Diffstat (limited to 'NorthstarDedicatedTest/modmanager.h')
-rw-r--r--NorthstarDedicatedTest/modmanager.h76
1 files changed, 76 insertions, 0 deletions
diff --git a/NorthstarDedicatedTest/modmanager.h b/NorthstarDedicatedTest/modmanager.h
new file mode 100644
index 00000000..32492283
--- /dev/null
+++ b/NorthstarDedicatedTest/modmanager.h
@@ -0,0 +1,76 @@
+#pragma once
+#include <string>
+#include <vector>
+
+class ModConVar
+{
+ std::string Name;
+ std::string DefaultValue;
+ std::string HelpString;
+ int Flags;
+};
+
+class ModScriptCallback
+{
+ std::string HookedCodeCallback;
+
+ // called before the codecallback is executed
+ std::string BeforeCallback;
+ // called after the codecallback has finished executing
+ std::string AfterCallback;
+};
+
+class ModScript
+{
+ std::string Path;
+ std::string ScriptsRsonSide;
+
+ std::vector<ModScriptCallback*> Callbacks;
+};
+
+class Mod
+{
+public:
+ // mod.json stuff:
+
+ // the mod's name
+ std::string Name;
+ // the mod's description
+ std::string Description;
+ // the mod's version, should be in semver
+ std::string Version;
+ // a download link to the mod, for clients that try to join without the mod
+ std::string DownloadLink;
+
+ // whether clients need the mod to join servers running this mod
+ bool RequiredOnClient = true;
+
+ // custom scripts used by the mod
+ std::vector<ModScript*> Scripts;
+ // convars created by the mod
+ std::vector<ModConVar*> ConVars;
+
+ // other files:
+
+ std::vector<std::string> Vpks;
+ //std::vector<ModKeyValues*> KeyValues;
+};
+
+class ModManager
+{
+private:
+ std::vector<Mod*> loadedMods;
+
+public:
+ ModManager();
+ void LoadMods();
+
+ std::vector<Mod*> GetMods();
+ std::vector<Mod*> GetClientMods();
+ std::vector<std::string> GetModVpks();
+ std::vector<std::string> GetModOverridePaths();
+};
+
+void InitialiseModManager(HMODULE baseAddress);
+
+extern ModManager* g_ModManager; \ No newline at end of file