Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add -DBREBUILD Command #611

Merged
merged 2 commits into from
Dec 29, 2023
Merged

Add -DBREBUILD Command #611

merged 2 commits into from
Dec 29, 2023

Conversation

enusbaum
Copy link
Member

  • Add -DBREBUILD command line argument
  • Add support for rebuilding BBSUSR.DAT/DB from the internal MBBSEmu Database

- Add `-DBREBUILD` command line argument
- Add support for rebuilding `BBSUSR.DAT/DB` from the internal MBBSEmu Database
- Move Resetting `BBSUSR` to after loading and verifying internal user records
- Refactor `UserAccount` to add constructor to handle data casting, cleans up code
/// </summary>
/// <param name="userName">Username the user will use to log into the system</param>
/// <param name="userSex">Sex/Gender of the User (Only M/F supported)</param>
public UserAccount(string userName, char userSex = 'M') : this()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably best to use an enum for userSex parameter to make it a compile time error rather than a runtime error, but not a huge thing

@@ -177,6 +187,18 @@ private void Run(string[] args)

break;
}
case "-DBREBUILD":
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

command line parsing is getting crazy. I wrote some cool args/flags parsing code for Java, perhaps I should port it....

Comment on lines +694 to +695
if (accounts.Count() != _accountBtrieve.GetRecordCount())
_logger.Warn($"MBBSEmu Database Account Count ({accounts.Count()}) does not match BBSUSR.DAT Account Count ({_accountBtrieve.GetRecordCount()})");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this likely isn't necessary since Insert should throw if unable to insert a record

@enusbaum enusbaum merged commit a2eedf8 into master Dec 29, 2023
2 checks passed
@enusbaum enusbaum deleted the bbsusr-rebuild branch December 29, 2023 02:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants