From 97df63bc21e53556f3cc31112f713d1ae63e691a Mon Sep 17 00:00:00 2001 From: pg9182 <96569817+pg9182@users.noreply.github.com> Date: Fri, 5 May 2023 19:45:04 -0400 Subject: Revert "Plugin system v2 (#343)" This reverts commit 450d0b1ed437cf37b4309af952af8904f3f07768. --- NorthstarDLL/server/serverpresence.cpp | 5 +++-- NorthstarDLL/server/serverpresence.h | 9 ++------- 2 files changed, 5 insertions(+), 9 deletions(-) (limited to 'NorthstarDLL/server') diff --git a/NorthstarDLL/server/serverpresence.cpp b/NorthstarDLL/server/serverpresence.cpp index 945f5810..c7ef20c3 100644 --- a/NorthstarDLL/server/serverpresence.cpp +++ b/NorthstarDLL/server/serverpresence.cpp @@ -71,7 +71,7 @@ std::string UnescapeUnicode(const std::string& str) return result; } -void ServerPresenceManager::CreateConVars() +ServerPresenceManager::ServerPresenceManager() { // clang-format off // register convars @@ -223,6 +223,7 @@ void ServerPresenceManager::SetPlayerCount(const int iPlayerCount) ON_DLL_LOAD_RELIESON("engine.dll", ServerPresence, ConVar, (CModule module)) { - g_pServerPresence->CreateConVars(); + g_pServerPresence = new ServerPresenceManager; + Cvar_hostname = module.Offset(0x1315BAE8).Deref().As(); } diff --git a/NorthstarDLL/server/serverpresence.h b/NorthstarDLL/server/serverpresence.h index 3aabecde..6b8c2859 100644 --- a/NorthstarDLL/server/serverpresence.h +++ b/NorthstarDLL/server/serverpresence.h @@ -3,11 +3,8 @@ struct ServerPresence { - public: int m_iPort; - std::string m_sServerId; - std::string m_sServerName; std::string m_sServerDesc; char m_Password[256]; // probably bigger than will ever be used in practice, lol @@ -28,8 +25,6 @@ struct ServerPresence { m_iPort = obj->m_iPort; - m_sServerId = obj->m_sServerId; - m_sServerName = obj->m_sServerName; m_sServerDesc = obj->m_sServerDesc; memcpy(m_Password, obj->m_Password, sizeof(m_Password)); @@ -72,9 +67,9 @@ class ServerPresenceManager ConVar* Cvar_ns_report_sp_server_to_masterserver; public: - void AddPresenceReporter(ServerPresenceReporter* reporter); + ServerPresenceManager(); - void CreateConVars(); + void AddPresenceReporter(ServerPresenceReporter* reporter); void CreatePresence(); void DestroyPresence(); -- cgit v1.2.3