diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2019-10-10 10:25:46 -0400 |
|---|---|---|
| committer | isanae <14251494+isanae@users.noreply.github.com> | 2019-10-10 10:25:46 -0400 |
| commit | 324fa12a2d491be039c1cf720ee2786864d010bc (patch) | |
| tree | 7ad52e845aa072e64b2d69358c7ebe1c5ceaf58d /src | |
| parent | 168fc950f9b15ce89084316d96a1f613a12e3013 (diff) | |
uses new usvfsParameters, also updates spawn delay
Diffstat (limited to 'src')
| -rw-r--r-- | src/organizercore.cpp | 6 | ||||
| -rw-r--r-- | src/organizercore.h | 2 | ||||
| -rw-r--r-- | src/usvfsconnector.cpp | 44 | ||||
| -rw-r--r-- | src/usvfsconnector.h | 2 |
4 files changed, 38 insertions, 16 deletions
diff --git a/src/organizercore.cpp b/src/organizercore.cpp index 335910da..df824c2b 100644 --- a/src/organizercore.cpp +++ b/src/organizercore.cpp @@ -484,10 +484,11 @@ void OrganizerCore::prepareVFS() } void OrganizerCore::updateVFSParams( - log::Levels logLevel, CrashDumpsType crashDumpsType, QString executableBlacklist) + log::Levels logLevel, CrashDumpsType crashDumpsType, + std::chrono::seconds spawnDelay, QString executableBlacklist) { setGlobalCrashDumpsType(crashDumpsType); - m_USVFS.updateParams(logLevel, crashDumpsType, executableBlacklist); + m_USVFS.updateParams(logLevel, crashDumpsType, spawnDelay, executableBlacklist); } void OrganizerCore::setLogLevel(log::Levels level) @@ -497,6 +498,7 @@ void OrganizerCore::setLogLevel(log::Levels level) updateVFSParams( m_Settings.diagnostics().logLevel(), m_Settings.diagnostics().crashDumpsType(), + m_Settings.diagnostics().spawnDelay(), m_Settings.executablesBlacklist()); log::getDefault().setLevel(m_Settings.diagnostics().logLevel()); diff --git a/src/organizercore.h b/src/organizercore.h index 5de550df..5b7dd87b 100644 --- a/src/organizercore.h +++ b/src/organizercore.h @@ -195,7 +195,7 @@ public: void updateVFSParams(
MOBase::log::Levels logLevel, CrashDumpsType crashDumpsType,
- QString executableBlacklist);
+ std::chrono::seconds spawnDelay, QString executableBlacklist);
void setLogLevel(MOBase::log::Levels level);
diff --git a/src/usvfsconnector.cpp b/src/usvfsconnector.cpp index 3ea811be..9a4fa742 100644 --- a/src/usvfsconnector.cpp +++ b/src/usvfsconnector.cpp @@ -162,15 +162,24 @@ QString toString(CrashDumpsType t) UsvfsConnector::UsvfsConnector() { + using namespace std::chrono; + const auto& s = Settings::instance(); - USVFSParameters params; - const LogLevel level = toUsvfsLogLevel(s.diagnostics().logLevel()); + const LogLevel logLevel = toUsvfsLogLevel(s.diagnostics().logLevel()); const CrashDumpsType dumpType = s.diagnostics().crashDumpsType(); - const auto delay = s.diagnostics().spawnDelay(); - + const auto delay = duration_cast<milliseconds>(s.diagnostics().spawnDelay()); std::string dumpPath = MOShared::ToString(OrganizerCore::crashDumpsPath(), true); - USVFSInitParameters(¶ms, SHMID, false, level, dumpType, dumpPath.c_str(), delay); + + usvfsParameters* params = usvfsCreateParameters(); + + usvfsSetInstanceName(params, SHMID); + usvfsSetDebugMode(params, false); + usvfsSetLogLevel(params, logLevel); + usvfsSetCrashDumpType(params, dumpType); + usvfsSetCrashDumpPath(params, dumpPath.c_str()); + usvfsSetProcessDelay(params, delay.count()); + InitLogging(false); log::debug( @@ -178,12 +187,13 @@ UsvfsConnector::UsvfsConnector() " . instance: {}\n" " . log: {}\n" " . dump: {} ({})", - params.instanceName, - toString(params.logLevel), - params.crashDumpsPath, - toString(params.crashDumpsType)); + SHMID, + toString(logLevel), + dumpPath.c_str(), + toString(dumpType)); - CreateVFS(¶ms); + usvfsCreateVFS(params); + usvfsFreeParameters(params); ClearExecutableBlacklist(); for (auto exec : s.executablesBlacklist().split(";")) { @@ -253,9 +263,19 @@ void UsvfsConnector::updateMapping(const MappingType &mapping) void UsvfsConnector::updateParams( MOBase::log::Levels logLevel, CrashDumpsType crashDumpsType, - QString executableBlacklist) + std::chrono::seconds spawnDelay, QString executableBlacklist) { - USVFSUpdateParams(toUsvfsLogLevel(logLevel), crashDumpsType); + using namespace std::chrono; + + usvfsParameters* p = usvfsCreateParameters(); + + usvfsSetLogLevel(p, toUsvfsLogLevel(logLevel)); + usvfsSetCrashDumpType(p, crashDumpsType); + usvfsSetProcessDelay(p, duration_cast<milliseconds>(spawnDelay).count()); + + usvfsUpdateParameters(p); + usvfsFreeParameters(p); + ClearExecutableBlacklist(); for (auto exec : executableBlacklist.split(";")) { std::wstring buf = exec.toStdWString(); diff --git a/src/usvfsconnector.h b/src/usvfsconnector.h index cd5d56b2..a4647eaf 100644 --- a/src/usvfsconnector.h +++ b/src/usvfsconnector.h @@ -88,7 +88,7 @@ public: void updateParams( MOBase::log::Levels logLevel, CrashDumpsType crashDumpsType, - QString executableBlacklist); + std::chrono::seconds spawnDelay, QString executableBlacklist); void updateForcedLibraries(const QList<MOBase::ExecutableForcedLoadSetting> &forcedLibraries); |
