summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xconfigure.ac13
-rw-r--r--src/Makefile.am4
-rw-r--r--src/progs/manaplus/client.cpp8
3 files changed, 25 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 7ab75e9bb..48e44a868 100755
--- a/configure.ac
+++ b/configure.ac
@@ -118,6 +118,19 @@ esac],[openglerrors_enabled=false])
AM_CONDITIONAL(ENABLE_OPENGLERRORS, test x$openglerrors_enabled = xtrue)
+# Enable password from command line
+AC_ARG_ENABLE(commandlinepassword,
+[ --enable-commandlinepassword Enable command line option for set password],
+[case "${enableval}" in
+ yes) commandlinepassword_enabled=true
+ ;;
+ no) commandlinepassword_enabled=false
+ ;;
+ *) AC_MSG_ERROR(bad value ${enableval} for --enable-commandlinepassword) ;;
+esac],[commandlinepassword_enabled=false])
+
+AM_CONDITIONAL(ENABLE_COMMANDLINEPASSWORD, test x$commandlinepassword_enabled = xtrue)
+
# Checks for android.
AC_ARG_ENABLE(androidbuild,
[ --enable-androidbuild Turn on android building],
diff --git a/src/Makefile.am b/src/Makefile.am
index a0a7328ce..a1d92c243 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -65,6 +65,10 @@ manaplus_CXXFLAGS += -D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC -D_LIBCPP_DEBUG=
dyecmd_CXXFLAGS += -D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC -D_LIBCPP_DEBUG=1
endif
+if ENABLE_COMMANDLINEPASSWORD
+manaplus_CXXFLAGS += -DENABLE_COMMANDLINEPASSWORD
+endif
+
if USE_X11
manaplus_CXXFLAGS += -DUSE_X11
dyecmd_CXXFLAGS += -DUSE_X11
diff --git a/src/progs/manaplus/client.cpp b/src/progs/manaplus/client.cpp
index 1ee563bac..22d2bc483 100644
--- a/src/progs/manaplus/client.cpp
+++ b/src/progs/manaplus/client.cpp
@@ -301,6 +301,14 @@ void Client::gameInit()
Dirs::initRootDir();
Dirs::initHomeDir();
+#ifndef ENABLE_COMMANDLINEPASSWORD
+ if (!settings.options.password.empty())
+ {
+ settings.options.password = std::string();
+ logger->log("Command line password parameter disabled.");
+ }
+#endif
+
// Configure logger
if (!settings.options.logFileName.empty())
{