aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDedicatedTest/modmanager.cpp
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-08-06 05:25:47 +0100
committerBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-08-06 05:25:47 +0100
commit4d0e4679d05b146e5e43a1a707708c6451099c54 (patch)
tree111c18c310feeaf2096855e4072dea46f8f20eb6 /NorthstarDedicatedTest/modmanager.cpp
parent02e422166baa12bbdc8af8806376cb2340fef896 (diff)
downloadNorthstarLauncher-4d0e4679d05b146e5e43a1a707708c6451099c54.tar.gz
NorthstarLauncher-4d0e4679d05b146e5e43a1a707708c6451099c54.zip
add support for connecting to servers from masterserver
Diffstat (limited to 'NorthstarDedicatedTest/modmanager.cpp')
-rw-r--r--NorthstarDedicatedTest/modmanager.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/NorthstarDedicatedTest/modmanager.cpp b/NorthstarDedicatedTest/modmanager.cpp
index 537ea150..342736e6 100644
--- a/NorthstarDedicatedTest/modmanager.cpp
+++ b/NorthstarDedicatedTest/modmanager.cpp
@@ -219,14 +219,8 @@ void ModManager::LoadMods()
return a->LoadPriority > b->LoadPriority;
});
- // do we need to dealloc individual entries in m_modFiles? idk, rework
- m_modFiles.clear();
- fs::remove_all(COMPILED_ASSETS_PATH);
-
for (Mod* mod : m_loadedMods)
{
- mod->KeyValuesHash.clear();
-
if (!mod->Enabled)
continue;
@@ -285,11 +279,20 @@ void ModManager::UnloadMods()
{
// clean up stuff from mods before we unload
- // remove all built kvs
+ // do we need to dealloc individual entries in m_modFiles? idk, rework
+ m_modFiles.clear();
+ fs::remove_all(COMPILED_ASSETS_PATH);
+
for (Mod* mod : m_loadedMods)
+ {
+ // remove all built kvs
for (std::string kvPaths : mod->KeyValues)
fs::remove(COMPILED_ASSETS_PATH / fs::path(kvPaths).lexically_relative(mod->ModDirectory));
+ mod->KeyValuesHash.clear();
+ mod->KeyValues.clear();
+ }
+
// do we need to dealloc individual entries in m_loadedMods? idk, rework
m_loadedMods.clear();
}
@@ -300,7 +303,7 @@ void ModManager::CompileAssetsForFile(const char* filename)
if (!path.filename().compare("scripts.rson"))
BuildScriptsRson();
- else if (!strcmp((filename + strlen(filename)) - 3, "txt")) // check if it's a .txt
+ else //if (!strcmp((filename + strlen(filename)) - 3, "txt")) // check if it's a .txt
{
// check if we should build keyvalues, depending on whether any of our mods have patch kvs for this file
for (Mod* mod : m_loadedMods)