Skip to content

Commit

Permalink
default dont auto create account
Browse files Browse the repository at this point in the history
for releases we can change this flag
  • Loading branch information
EmosewaMC committed Dec 9, 2024
1 parent 8f1801a commit ffa5f8a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 3 additions & 3 deletions dMasterServer/MasterServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
3 changes: 3 additions & 0 deletions resources/sharedconfig.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit ffa5f8a

Please sign in to comment.