diff options
author | Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> | 2022-02-23 22:27:08 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-23 18:27:08 -0300 |
commit | 4f28a07d0562ca905bbcdb010b69604c330194bb (patch) | |
tree | 32ce0e8b0eff10cba6944a561e3538931a6033b6 /NorthstarDedicatedTest/gameutils.cpp | |
parent | 8c9f34283f8670dda98959d0785d682e6f652a93 (diff) | |
download | NorthstarLauncher-4f28a07d0562ca905bbcdb010b69604c330194bb.tar.gz NorthstarLauncher-4f28a07d0562ca905bbcdb010b69604c330194bb.zip |
ConVar class rebuild (#90)
* Implement CCvar class with mapped out vtable funcs
* Rebuilded ConVar class + code overhaul to use new system
* ConVar class is now properly mapped out for r2 (0x80 in size).
* Reimplemented and exposed all frequently used ConVar class methods to the SDK.
* Implement frequently used CCvar class methods.
* Implement all CCVarIteratorInternal class methods.
* Performed additional cleanup over the SDK to use new system instead.
* ConVar class improvements + rebuilded ConCommand struct
* Fix actual struct size for ConCommand
Diffstat (limited to 'NorthstarDedicatedTest/gameutils.cpp')
-rw-r--r-- | NorthstarDedicatedTest/gameutils.cpp | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/NorthstarDedicatedTest/gameutils.cpp b/NorthstarDedicatedTest/gameutils.cpp index f9fd4d95..b8194397 100644 --- a/NorthstarDedicatedTest/gameutils.cpp +++ b/NorthstarDedicatedTest/gameutils.cpp @@ -60,9 +60,6 @@ void InitialiseEngineGameUtilFunctions(HMODULE baseAddress) g_pEngine = *(CEngine**)((char*)baseAddress + 0x7D70C8); sv_m_State = (server_state_t*)((char*)baseAddress + 0x12A53D48); - Cvar_hostport = (ConVar*)((char*)baseAddress + 0x13FA6070); - Cvar_net_datablock_enabled = (ConVar*)((char*)baseAddress + 0x12A4F6D0); - GetCurrentPlaylistName = (GetCurrentPlaylistType)((char*)baseAddress + 0x18C640); SetCurrentPlaylist = (SetCurrentPlaylistType)((char*)baseAddress + 0x18EB20); SetPlaylistVarOverride = (SetPlaylistVarOverrideType)((char*)baseAddress + 0x18ED00); @@ -71,10 +68,26 @@ void InitialiseEngineGameUtilFunctions(HMODULE baseAddress) g_LocalPlayerUserID = (char*)baseAddress + 0x13F8E688; g_LocalPlayerOriginToken = (char*)baseAddress + 0x13979C80; + GetBaseLocalClient = (GetBaseLocalClientType)((char*)baseAddress + 0x78200); + + /* NOTE: + g_pCVar->FindVar("convar_name") now works. These are no longer needed. + You can also itterate over every ConVar using CCVarIteratorInternal + dump the pointers to a vector and access them from there. + Example: + std::vector<ConVar*> g_pAllConVars; + for (auto& map : g_pCVar->DumpToMap()) + { + ConVar* pConVar = g_pCVar->FindVar(map.first.c_str()); + if (pConVar) + { + g_pAllConVars.push_back(pConVar); + } + }*/ + Cvar_hostport = (ConVar*)((char*)baseAddress + 0x13FA6070); + Cvar_net_datablock_enabled = (ConVar*)((char*)baseAddress + 0x12A4F6D0); Cvar_match_defaultMap = (ConVar*)((char*)baseAddress + 0x8AB530); Cvar_communities_hostname = (ConVar*)((char*)baseAddress + 0x13157E50); - - GetBaseLocalClient = (GetBaseLocalClientType)((char*)baseAddress + 0x78200); } void InitialiseServerGameUtilFunctions(HMODULE baseAddress) |