Skip to content

Refactor minor activities #7766

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

Merged
merged 5 commits into from
Jan 28, 2021
Merged

Refactor minor activities #7766

merged 5 commits into from
Jan 28, 2021

Conversation

KrisXV
Copy link
Member

@KrisXV KrisXV commented Dec 4, 2020

No description provided.

Copy link
Collaborator

@AnnikaCodes AnnikaCodes left a comment

Choose a reason for hiding this comment

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

I like this change.

@AnnikaCodes AnnikaCodes added the crashes /hotpatch Will crash a hotpatch command; must only be applied right before a server restart label Dec 14, 2020
@AnnikaCodes AnnikaCodes requested a review from Zarel December 14, 2020 17:16
Copy link
Member

@Zarel Zarel left a comment

Choose a reason for hiding this comment

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

I like this! Other than the minor readability adjustment.

@Zarel
Copy link
Member

Zarel commented Dec 14, 2020

(Haha get it "minor"????)

@mia-pi-git
Copy link
Member

Reminder to add conversion functions for pre-existing roomsettings.

@KrisXV
Copy link
Member Author

KrisXV commented Dec 31, 2020

Reminder to add conversion functions for pre-existing roomsettings.

yeah, just trying to fix this crash first then i will

Copy link
Member

@mia-pi-git mia-pi-git left a comment

Choose a reason for hiding this comment

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

Looking good otherwise!
Good change.

if (this.minorActivity && 'voters' in this.minorActivity) {
if (user.id in this.minorActivity.voters) this.minorActivity.updateFor(user);
}
this.minorActivity?.onRename?.(user, oldid, joining);
Copy link
Member

Choose a reason for hiding this comment

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

Is this actually necessary? onRename only applies if IP stays the same, and the IP should already be in the "already voted" table.

Copy link
Member Author

Choose a reason for hiding this comment

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

I do not know

@@ -889,8 +928,8 @@ export abstract class BasicRoom {
this.users[user.id] = user;
this.userCount++;

if (this.minorActivity) this.minorActivity.onConnect(user, connection);
if (this.game && this.game.onJoin) this.game.onJoin(user, connection);
this.minorActivity?.onConnect?.(user, connection);
Copy link
Member

Choose a reason for hiding this comment

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

Is this necessary? This will call onConnect twice when a user joins.

Copy link
Member Author

Choose a reason for hiding this comment

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

I do not know

Copy link
Member

@mia-pi-git mia-pi-git left a comment

Choose a reason for hiding this comment

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

Except for the onConnect thing, looks good to me!
Good changes.

@Zarel Zarel merged commit 081326b into smogon:master Jan 28, 2021
@Zarel
Copy link
Member

Zarel commented Jan 28, 2021

I guess I'll figure out the onConnect thing later.

Quanyails pushed a commit to Quanyails/Pokemon-Showdown that referenced this pull request May 12, 2021
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.

4 participants