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

fix(server/player): setgang and setjob error handling #376

Merged
merged 3 commits into from
Feb 20, 2024

Conversation

Manason
Copy link
Member

@Manason Manason commented Feb 19, 2024

  • General refactor to make the code more succinct.
  • Removed unnecessary default param values
  • Changed behavior of the functions to be no-op in the case of the group or grade not existing. Previously it would pick defaults instead, which seems like an undesirable behavior.
  • Added error prints
  • Changed removeFromJob/removeFromGang behavior when the user doesn't already have the job/gang to be no-op rather than an error scenario to make the function Idempotent. This is also useful because we don't treat the player as having the unemployed job or the none gang.
  • Fixes an issue where instead of removing the old job/gang, it was attempting to remove the current one
  • Prevent removing/adding to the default groups as the default groups are not tracked in the database.

@Manason Manason merged commit bd5c34e into main Feb 20, 2024
4 checks passed
@solareon solareon deleted the refactor-setjob-setgang branch March 9, 2024 17:06
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.

3 participants