-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #620 from mbbsemu/improve-create-user-script
Correct the name of the mbbsemu.db file; add message at the end reminding the user to recreate the BBSUSR database.
- Loading branch information
Showing
1 changed file
with
4 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ def _create_parser(): | |
parser.add_argument('--password', help='Password to use', required=True) | ||
parser.add_argument('--keys', help='Account keys to add to the new account', action='append', default=['NORMAL','PAYING']) | ||
parser.add_argument('--email', help='Email address to use', default='[email protected]') | ||
parser.add_argument('--dbfile', help='Database specified by appsettings.json Database.File', default='mbbsemu.db') | ||
|
||
return parser.parse_args() | ||
|
||
|
@@ -25,7 +26,7 @@ def _make_password_hash(password, salt_bytes): | |
def _main(): | ||
args = _create_parser() | ||
|
||
conn = sqlite3.connect('mbbs.db') | ||
conn = sqlite3.connect(args.dbfile) | ||
|
||
passwordSaltBytes=os.urandom(32) | ||
passwordHashBytes=_make_password_hash(args.password, passwordSaltBytes) | ||
|
@@ -42,5 +43,7 @@ def _main(): | |
cur.execute('INSERT INTO AccountKeys (accountId, accountKey, createDate, updateDate) VALUES (?,?,datetime(\'now\'), datetime(\'now\'))', t) | ||
conn.commit() | ||
|
||
print("Database updated; now you need to go run MBBSEmu -CLI -DBREBUILD BBSUSR to rebuild the runtime user database.") | ||
|
||
if __name__ == '__main__': | ||
_main() |