diff options
Diffstat (limited to 'NorthstarDedicatedTest/concommand.cpp')
-rw-r--r-- | NorthstarDedicatedTest/concommand.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/NorthstarDedicatedTest/concommand.cpp b/NorthstarDedicatedTest/concommand.cpp new file mode 100644 index 00000000..225ae74b --- /dev/null +++ b/NorthstarDedicatedTest/concommand.cpp @@ -0,0 +1,20 @@ +#include "pch.h" +#include "concommand.h" +#include <iostream> + +typedef void(*ConCommandConstructorType)(ConCommand* newCommand, const char* name, void(*callback)(const CCommand&), const char* helpString, int flags, void* parent); +ConCommandConstructorType conCommandConstructor; + +void RegisterConCommand(const char* name, void(*callback)(const CCommand&), const char* helpString, int flags) +{ + std::cout << "Registering ConCommand " << name << std::endl; + + // no need to free this ever really, it should exist as long as game does + ConCommand* newCommand = new ConCommand; + conCommandConstructor(newCommand, name, callback, helpString, flags, nullptr); +} + +void InitialiseConCommands(HMODULE baseAddress) +{ + conCommandConstructor = (ConCommandConstructorType)((char*)baseAddress + 0x415F60); +}
\ No newline at end of file |