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

Allow selecting an MC server to use for group sync options #2991

Merged
merged 7 commits into from
Aug 12, 2022

Conversation

tadhgboyle
Copy link
Member

@tadhgboyle tadhgboyle commented Aug 6, 2022

Closes #2986

This solves the problem of users having multiple servers which are all sending group names to the website, so when they reload the group sync page sometimes the groups are gone or different.

@tadhgboyle tadhgboyle changed the base branch from v2 to release/2.0.2 August 6, 2022 20:23
@partydragen
Copy link
Member

partydragen commented Aug 6, 2022

@Aberdeener We will actually need primary check in ServerInfoEndpoint aswell? so other servers don't perform group syncs as they will return groups and may even different groups and if its empty it will remove all groups

@tadhgboyle
Copy link
Member Author

tadhgboyle commented Aug 6, 2022 via email

@partydragen
Copy link
Member

I’m not totally sure what you mean sorry, what needs to be changed in the PR?

On Sat, Aug 6, 2022 at 17:46 Partydragen @.> wrote: @Aberdeener https://github.com/Aberdeener We will actually need this in ServerInfoEndpoint aswell? so other servers don't perform group syncs as they will return groups and may even different groups and if its empty it will remove all groups — Reply to this email directly, view it on GitHub <#2991 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGG43DF6TYXW4JIBNFBVIGDVX32PDANCNFSM55ZI2CQQ . You are receiving this because you were mentioned.Message ID: @.>

So ServerInfoEndpoint will only run group sync if server id match primary server id

@tadhgboyle tadhgboyle requested a review from partydragen August 7, 2022 03:34
@tadhgboyle
Copy link
Member Author

Will change PR base branch later and merge then

@tadhgboyle tadhgboyle closed this Aug 7, 2022
@tadhgboyle tadhgboyle force-pushed the feat/group-sync-source-server branch from 16f6d0c to c1e179c Compare August 7, 2022 19:26
@tadhgboyle tadhgboyle reopened this Aug 7, 2022
@tadhgboyle tadhgboyle force-pushed the feat/group-sync-source-server branch from 16f6d0c to e3cb148 Compare August 7, 2022 19:30
@tadhgboyle
Copy link
Member Author

thank you stackoverflow for teaching me how to fix that mess

@tadhgboyle tadhgboyle added this to the 2.0.x milestone Aug 7, 2022
@@ -252,7 +252,8 @@
"admin/group_sync": "Group Sync",
"admin/group_sync_info": "You can configure the API to automatically update a user's website group when their integration group is changed. Simply enter the integration group name\/ID and the website group it will be synchronised with the below rules.",
"admin/group_sync_logs": "Group Sync Changes",
"admin/group_sync_plugin_not_set_up": "In-game plugin is not set up",
"admin/group_sync_server": "Select a Minecraft server to get group sync groups from",
"admin/group_sync_plugin_not_set_up": "In-game plugin is not set up or no group sync server has been selected",
Copy link
Member Author

Choose a reason for hiding this comment

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

Unfortunately this leaks onto a second line, better than being not fully specific imo.

@@ -26,14 +26,17 @@ public function getColumnType(): string {
}

public function shouldEnable(): bool {
return count($this->getSelectionOptions()) > 0;
return Util::getSetting('group_sync_mc_server') != 0 && count($this->getSelectionOptions()) > 0;
Copy link
Member Author

Choose a reason for hiding this comment

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

This shouldEnable method is called during a group sync broadcast, meaning the Minecraft injector will be ignored fully if they have not select a server to get group sync groups from - I think this is the best way forward

@tadhgboyle tadhgboyle merged commit 5b996f3 into release/2.0.2 Aug 12, 2022
@tadhgboyle tadhgboyle deleted the feat/group-sync-source-server branch August 12, 2022 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants