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

Remove unlinkUser #10101

Merged
merged 3 commits into from
Jan 9, 2024
Merged

Remove unlinkUser #10101

merged 3 commits into from
Jan 9, 2024

Conversation

Zarel
Copy link
Member

@Zarel Zarel commented Jan 9, 2024

This refactor removes player.unlinkUser() which was used for several unrelated use cases.

These have been split apart into:

  • at the end of a game, game.setEnded() now clears user.games, while leaving player.id untouched
  • when trying to change the user associated with the player, we now consistently use the higher-level game.updatePlayer()

There's a good chance this fixes the lagspikes currently affecting PS.

This refactor removes `player.unlinkUser()` which was used for several
unrelated use cases.

These have been split apart into:

- at the end of a game, `game.setEnded()` now clears `user.games`,
  while leaving `player.id` untouched
- when trying to change the user associated with the player, we now
  consistently use the higher-level `game.updatePlayer()`

There's a good chance this fixes the lagspikes currently affecting PS.
@Zarel Zarel added the crashes /hotpatch Will crash a hotpatch command; must only be applied right before a server restart label Jan 9, 2024
@Zarel Zarel merged commit eb0ef53 into master Jan 9, 2024
1 check passed
MathyFurret pushed a commit to MathyFurret/pokemon-showdown that referenced this pull request May 21, 2024
This refactor removes `player.unlinkUser()` which was used for several
unrelated use cases.

These have been split apart into:

- at the end of a game, `game.setEnded()` now clears `user.games`,
  while leaving `player.id` untouched
- when trying to change the user associated with the player, we now
  consistently use the higher-level `game.updatePlayer()`

There's a good chance this fixes the lagspikes currently affecting PS.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crashes /hotpatch Will crash a hotpatch command; must only be applied right before a server restart
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant