From ffa5f8a6bfd579a33e0cde8a2908c42b68eb9e0e Mon Sep 17 00:00:00 2001 From: David Markowitz Date: Sun, 8 Dec 2024 23:10:30 -0800 Subject: [PATCH] default dont auto create account for releases we can change this flag --- dMasterServer/MasterServer.cpp | 6 +++--- resources/sharedconfig.ini | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/dMasterServer/MasterServer.cpp b/dMasterServer/MasterServer.cpp index bfc2a8d0..e01ca255 100644 --- a/dMasterServer/MasterServer.cpp +++ b/dMasterServer/MasterServer.cpp @@ -180,12 +180,12 @@ int main(int argc, char** argv) { //If the first command line argument is -a or --account then make the user //input a username and password, with the password being hidden. - bool doesAnyAccountExist = Database::Get()->GetAccountCount() > 0; - if (!doesAnyAccountExist) { + bool createAccount = Database::Get()->GetAccountCount() == 0 && Game::config->GetValue("skip_account_creation") != "1"; + if (createAccount) { LOG("No accounts exist in the database. Please create an account."); } if ((argc > 1 && - (strcmp(argv[1], "-a") == 0 || strcmp(argv[1], "--account") == 0)) || !doesAnyAccountExist) { + (strcmp(argv[1], "-a") == 0 || strcmp(argv[1], "--account") == 0)) || createAccount) { std::string username; std::string password; diff --git a/resources/sharedconfig.ini b/resources/sharedconfig.ini index 90c0f657..c19fddf7 100644 --- a/resources/sharedconfig.ini +++ b/resources/sharedconfig.ini @@ -74,3 +74,6 @@ using_sqlite=1 # If using mysql, set this to 1 and the others to 0 using_mysql=0 + +# Skips the account creation check in master. Used for non-interactive setups. +skip_account_creation=1