aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDedicatedTest
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-11-05 21:22:43 +0000
committerBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-11-05 21:22:43 +0000
commit3d4eb42b4aaf89a4f5f3e74cb50f1fa557b272ee (patch)
tree5832fe2ee5f8e9334196e9f67cee93fb382ef1a7 /NorthstarDedicatedTest
parentce9cb0134fefaa2bf5a3da0f9de15f013ab7dd27 (diff)
downloadNorthstarLauncher-3d4eb42b4aaf89a4f5f3e74cb50f1fa557b272ee.tar.gz
NorthstarLauncher-3d4eb42b4aaf89a4f5f3e74cb50f1fa557b272ee.zip
small dedi changes
Diffstat (limited to 'NorthstarDedicatedTest')
-rw-r--r--NorthstarDedicatedTest/dedicated.cpp6
-rw-r--r--NorthstarDedicatedTest/dedicatedmaterialsystem.cpp5
-rw-r--r--NorthstarDedicatedTest/modmanager.cpp11
3 files changed, 17 insertions, 5 deletions
diff --git a/NorthstarDedicatedTest/dedicated.cpp b/NorthstarDedicatedTest/dedicated.cpp
index b6db8583..cebcd8ad 100644
--- a/NorthstarDedicatedTest/dedicated.cpp
+++ b/NorthstarDedicatedTest/dedicated.cpp
@@ -59,7 +59,11 @@ void RunServer(CDedicatedExports* dedicated)
g_pEngine->Frame();
// this way of getting playercount/maxplayers honestly really sucks, but not got any other methods of doing it rn
- SetConsoleTitleA(fmt::format("Titanfall 2 dedicated server - {} {}/{} players", g_pHostState->m_levelName, g_ServerAuthenticationManager->m_additionalPlayerData.size(), GetCurrentPlaylistVar("max_players", false)).c_str());
+ const char* maxPlayers = GetCurrentPlaylistVar("max_players", false);
+ if (!maxPlayers)
+ maxPlayers = "6";
+
+ SetConsoleTitleA(fmt::format("Titanfall 2 dedicated server - {} {}/{} players", g_pHostState->m_levelName, g_ServerAuthenticationManager->m_additionalPlayerData.size(), maxPlayers).c_str());
Sleep(50);
}
}
diff --git a/NorthstarDedicatedTest/dedicatedmaterialsystem.cpp b/NorthstarDedicatedTest/dedicatedmaterialsystem.cpp
index 327f2c1f..3c96ef22 100644
--- a/NorthstarDedicatedTest/dedicatedmaterialsystem.cpp
+++ b/NorthstarDedicatedTest/dedicatedmaterialsystem.cpp
@@ -13,6 +13,7 @@ void InitialiseDedicatedMaterialSystem(HMODULE baseAddress)
// Sleep(100);
// not using these for now since they're related to nopping renderthread/gamewindow i.e. very hard
+ // we use -noshaderapi instead now
//{
// // function that launches renderthread
// char* ptr = (char*)baseAddress + 0x87047;
@@ -63,7 +64,7 @@ void InitialiseDedicatedMaterialSystem(HMODULE baseAddress)
*(ptr + 4) = (char)0x90;
}
- // these don't work, they cause game to hang on rpak init, needs reworking
+ // these don't fully work, they cause game to hang on rpak init, needs reworking
{
// materialsystem rpak type: texture
char* ptr = (char*)baseAddress + 0x2B3A;
@@ -152,6 +153,8 @@ void* RegisterRpakTypeHook(RpakTypeDefinition* rpakStruct, unsigned int a1, unsi
void InitialiseDedicatedRtechGame(HMODULE baseAddress)
{
+ // potentially do this somewhere other than dedicated stuff if it's going to be used in non-dedi
+
HookEnabler hook;
ENABLER_CREATEHOOK(hook, (char*)GetModuleHandleA("rtech_game.dll") + 0x7BE0, &RegisterRpakTypeHook, reinterpret_cast<LPVOID*>(&RegisterRpakType));
diff --git a/NorthstarDedicatedTest/modmanager.cpp b/NorthstarDedicatedTest/modmanager.cpp
index 956ea90f..cd479408 100644
--- a/NorthstarDedicatedTest/modmanager.cpp
+++ b/NorthstarDedicatedTest/modmanager.cpp
@@ -12,6 +12,7 @@
#include <string>
#include <sstream>
#include <vector>
+#include "filesystem.h"
ModManager* g_ModManager;
@@ -189,8 +190,6 @@ void ModManager::LoadMods()
if (m_hasLoadedMods)
UnloadMods();
- m_hasLoadedMods = true;
-
std::vector<fs::path> modDirs;
// ensure dirs exist
@@ -289,7 +288,11 @@ void ModManager::LoadMods()
std::string formattedPath = file.path().filename().string();
// this really fucking sucks but it'll work
- mod->Vpks.push_back((file.path().parent_path() / formattedPath.substr(strlen("english"), formattedPath.find(".bsp") - 3)).string());
+ std::string vpkName = (file.path().parent_path() / formattedPath.substr(strlen("english"), formattedPath.find(".bsp") - 3)).string();
+ mod->Vpks.push_back(vpkName);
+
+ if (m_hasLoadedMods)
+ (*g_Filesystem)->m_vtable->MountVPK(*g_Filesystem, vpkName.c_str());
}
}
}
@@ -332,6 +335,8 @@ void ModManager::LoadMods()
}
}
}
+
+ m_hasLoadedMods = true;
}
void ModManager::UnloadMods()