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

cli: set user-id per command line #10053

Merged
merged 1 commit into from Apr 2, 2021
Merged

Conversation

Megamouse
Copy link
Contributor

@Megamouse Megamouse commented Apr 1, 2021

  • Let the user boot RPCS3 with any valid user-id (will be created if necessary)
  • Adds stricter error handling when setting a new user
  • Fix a possible crash if the emulator is Quit before being initialized (usually unreachable code)

closes #10052

@Megamouse Megamouse added the CLI Anything that involves starting RPCS3 through the command line interface label Apr 1, 2021
@Megamouse Megamouse force-pushed the gamewindow branch 2 times, most recently from c4226ea to c119c35 Compare April 1, 2021 23:18
@IngwiePhoenix
Copy link

That sure came by surprise :)
Thank you for the work!


if (id == 0)
{
return false;
fmt::throw_exception("Failed to set user ID '%s'.\nIt must consist of 8 digits and cannot be 00000000.", user);
Copy link
Contributor

Choose a reason for hiding this comment

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

throw_exception in main thread crashes the whole emulator... just log an error and return false. As a general practice use assertations only if there's absolutely no logical way the thread could continue normally after the unexpected condition has been met, or if it's really an unreachable condition by your perspective.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated.
There shouldn't be a code path that isn't properly controlled now.

@Megamouse
Copy link
Contributor Author

These exceptions can only happen if the user puts in garbage in the cli (which they want to know immediately), or if something went really wrong in the user manager. Currently the user manager handles the IDs on its own. So it would indicate a programming error.
And I personally wouldn't want my save games to get fucked by some sort of user management issue

@Megamouse Megamouse force-pushed the gamewindow branch 4 times, most recently from 26bfa19 to 93605f3 Compare April 2, 2021 07:32
@Megamouse Megamouse merged commit 9c7230e into RPCS3:master Apr 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLI Anything that involves starting RPCS3 through the command line interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request] CLI switch to select user
3 participants