Skip to content

Commit

Permalink
Core: Add NWNX_CORE_SKIP_ALL env var to skip all plugins on load
Browse files Browse the repository at this point in the history
  • Loading branch information
Daztek committed Jan 12, 2019
1 parent 7eb1b65 commit 3c8ca15
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 65 deletions.
3 changes: 2 additions & 1 deletion Core/NWNXCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ void NWNXCore::InitialSetupPlugins()
const std::string prefix = pluginPrefix;

const std::string pluginDir = m_coreServices->m_config->Get<std::string>("LOAD_PATH", GetCurDirectory());
const bool skipAllPlugins = m_coreServices->m_config->Get<bool>("SKIP_ALL", false);

LOG_INFO("Loading plugins from: %s", pluginDir.c_str());

Expand Down Expand Up @@ -253,7 +254,7 @@ void NWNXCore::InitialSetupPlugins()

Plugin::CreateParams params = { services };

if (services->m_config->Get<bool>("SKIP", false))
if (services->m_config->Get<bool>("SKIP", !!skipAllPlugins))
{
LOG_INFO("Skipping plugin %s due to configuration.", pluginNameWithoutExtension.c_str());
continue;
Expand Down
34 changes: 2 additions & 32 deletions Docker/Full/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,35 +46,5 @@ ENV NWNX_SERVERLOGREDIRECTOR_SKIP=n \
NWNX_SERVERLOGREDIRECTOR_LOG_LEVEL=6
# Configure JVM
ENV NWNX_JVM_CLASSPATH=/nwn/nwnx/org.nwnx.nwnx2.jvm.jar
# Disable all other plugins by default. Remember to add new plugins to this list.
ENV NWNX_ADMINISTRATION_SKIP=y \
NWNX_AREA_SKIP=y \
NWNX_CHAT_SKIP=y \
NWNX_COMBATMODES_SKIP=y \
NWNX_CREATURE_SKIP=y \
NWNX_DAMAGE_SKIP=y \
NWNX_DATA_SKIP=y \
NWNX_DIALOG_SKIP=y \
NWNX_ENCOUNTER_SKIP=y \
NWNX_EVENTS_SKIP=y \
NWNX_FEEDBACK_SKIP=y \
NWNX_ITEM_SKIP=y \
NWNX_JVM_SKIP=y \
NWNX_LUA_SKIP=y \
NWNX_METRICS_INFLUXDB_SKIP=y \
NWNX_MONO_SKIP=y \
NWNX_OBJECT_SKIP=y \
NWNX_PLAYER_SKIP=y \
NWNX_PROFILER_SKIP=y \
NWNX_SPELLCHECKER_SKIP=y \
NWNX_REDIS_SKIP=y \
NWNX_RENAME_SKIP=y \
NWNX_RUBY_SKIP=y \
NWNX_SQL_SKIP=y \
NWNX_THREADWATCHDOG_SKIP=y \
NWNX_TIME_SKIP=y \
NWNX_TRACKING_SKIP=y \
NWNX_TWEAKS_SKIP=y \
NWNX_UTIL_SKIP=y \
NWNX_WEAPON_SKIP=y \
NWNX_WEBHOOK_SKIP=y
# Disable all other plugins by default.
ENV NWNX_CORE_SKIP_ALL=y
34 changes: 2 additions & 32 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,35 +26,5 @@ ENV NWNX_SERVERLOGREDIRECTOR_SKIP=n \
NWN_TAIL_LOGS=n \
NWNX_CORE_LOG_LEVEL=6 \
NWNX_SERVERLOGREDIRECTOR_LOG_LEVEL=6
# Disable all other plugins by default. Remember to add new plugins to this list.
ENV NWNX_ADMINISTRATION_SKIP=y \
NWNX_AREA_SKIP=y \
NWNX_CHAT_SKIP=y \
NWNX_COMBATMODES_SKIP=y \
NWNX_CREATURE_SKIP=y \
NWNX_DAMAGE_SKIP=y \
NWNX_DATA_SKIP=y \
NWNX_DIALOG_SKIP=y \
NWNX_ENCOUNTER_SKIP=y \
NWNX_EVENTS_SKIP=y \
NWNX_FEEDBACK_SKIP=y \
NWNX_ITEM_SKIP=y \
NWNX_JVM_SKIP=y \
NWNX_LUA_SKIP=y \
NWNX_METRICS_INFLUXDB_SKIP=y \
NWNX_MONO_SKIP=y \
NWNX_OBJECT_SKIP=y \
NWNX_PLAYER_SKIP=y \
NWNX_PROFILER_SKIP=y \
NWNX_SPELLCHECKER_SKIP=y \
NWNX_REDIS_SKIP=y \
NWNX_RENAME_SKIP=y \
NWNX_RUBY_SKIP=y \
NWNX_SQL_SKIP=y \
NWNX_THREADWATCHDOG_SKIP=y \
NWNX_TIME_SKIP=y \
NWNX_TRACKING_SKIP=y \
NWNX_TWEAKS_SKIP=y \
NWNX_UTIL_SKIP=y \
NWNX_WEAPON_SKIP=y \
NWNX_WEBHOOK_SKIP=y
# Disable all other plugins by default.
ENV NWNX_CORE_SKIP_ALL=y

0 comments on commit 3c8ca15

Please sign in to comment.