aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDLL/core
diff options
context:
space:
mode:
authorEmma Miler <emma.pi@protonmail.com>2023-04-11 20:49:16 +0200
committerGitHub <noreply@github.com>2023-04-11 20:49:16 +0200
commit450d0b1ed437cf37b4309af952af8904f3f07768 (patch)
tree3f0fd39b5663b5c3f4b9e76c70cc4987f22d66c7 /NorthstarDLL/core
parent72da1da5b4c04ccc1154853a308cab6459c60b79 (diff)
downloadNorthstarLauncher-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/core')
-rw-r--r--NorthstarDLL/core/convar/concommand.cpp4
-rw-r--r--NorthstarDLL/core/convar/convar.cpp7
-rw-r--r--NorthstarDLL/core/hooks.cpp2
-rw-r--r--NorthstarDLL/core/math/color.cpp2
-rw-r--r--NorthstarDLL/core/math/color.h2
5 files changed, 15 insertions, 2 deletions
diff --git a/NorthstarDLL/core/convar/concommand.cpp b/NorthstarDLL/core/convar/concommand.cpp
index 67c867f8..82594f04 100644
--- a/NorthstarDLL/core/convar/concommand.cpp
+++ b/NorthstarDLL/core/convar/concommand.cpp
@@ -2,6 +2,8 @@
#include "shared/misccommands.h"
#include "engine/r2engine.h"
+#include "plugins/pluginbackend.h"
+
#include <iostream>
//-----------------------------------------------------------------------------
@@ -148,4 +150,6 @@ ON_DLL_LOAD("engine.dll", ConCommand, (CModule module))
{
ConCommandConstructor = module.Offset(0x415F60).As<ConCommandConstructorType>();
AddMiscConCommands();
+
+ g_pPluginCommunicationhandler->m_sEngineData.ConCommandConstructor = ConCommandConstructor;
}
diff --git a/NorthstarDLL/core/convar/convar.cpp b/NorthstarDLL/core/convar/convar.cpp
index 21fca8c0..6646729a 100644
--- a/NorthstarDLL/core/convar/convar.cpp
+++ b/NorthstarDLL/core/convar/convar.cpp
@@ -3,6 +3,8 @@
#include "convar.h"
#include "core/sourceinterface.h"
+#include "plugins/pluginbackend.h"
+
#include <float.h>
typedef void (*ConVarRegisterType)(
@@ -37,6 +39,11 @@ ON_DLL_LOAD("engine.dll", ConVar, (CModule module))
R2::g_pCVarInterface = new SourceInterface<CCvar>("vstdlib.dll", "VEngineCvar007");
R2::g_pCVar = *R2::g_pCVarInterface;
+
+ g_pPluginCommunicationhandler->m_sEngineData.conVarMalloc = conVarMalloc;
+ g_pPluginCommunicationhandler->m_sEngineData.conVarRegister = conVarRegister;
+ g_pPluginCommunicationhandler->m_sEngineData.ConVar_Vtable = g_pConVar_Vtable;
+ g_pPluginCommunicationhandler->m_sEngineData.IConVar_Vtable = g_pIConVar_Vtable;
}
//-----------------------------------------------------------------------------
diff --git a/NorthstarDLL/core/hooks.cpp b/NorthstarDLL/core/hooks.cpp
index 7c70b0a5..9124d5af 100644
--- a/NorthstarDLL/core/hooks.cpp
+++ b/NorthstarDLL/core/hooks.cpp
@@ -274,8 +274,6 @@ AUTOHOOK_ABSOLUTEADDR(_GetCommandLineA, GetCommandLineA, LPSTR, WINAPI, ())
return cmdlineOrg;
}
memcpy(cmdlineModified, args.c_str(), len + 1);
-
- spdlog::info("Command line: {}", cmdlineModified);
}
return cmdlineModified;
diff --git a/NorthstarDLL/core/math/color.cpp b/NorthstarDLL/core/math/color.cpp
index 9936cc5a..7b98043a 100644
--- a/NorthstarDLL/core/math/color.cpp
+++ b/NorthstarDLL/core/math/color.cpp
@@ -13,6 +13,8 @@ namespace NS::Colors
Color RPAK (255, 190, 0 );
Color NORTHSTAR (66 , 72 , 128);
Color ECHO (150, 150, 159);
+ Color PLUGINSYS (244, 60 , 14);
+ Color PLUGIN (244, 106, 14);
Color TRACE (0 , 255, 255);
Color DEBUG (0 , 255, 255);
diff --git a/NorthstarDLL/core/math/color.h b/NorthstarDLL/core/math/color.h
index 4dc9b36e..76cf8a47 100644
--- a/NorthstarDLL/core/math/color.h
+++ b/NorthstarDLL/core/math/color.h
@@ -186,6 +186,8 @@ namespace NS::Colors
extern Color RPAK;
extern Color NORTHSTAR;
extern Color ECHO;
+ extern Color PLUGINSYS;
+ extern Color PLUGIN;
extern Color TRACE;
extern Color DEBUG;