DiscordSRV icon indicating copy to clipboard operation
DiscordSRV copied to clipboard

Added linking bypass perm

Open supercoolspy opened this issue 1 year ago • 5 comments

based on #1491

supercoolspy avatar Mar 03 '23 02:03 supercoolspy

Seems unnecessary to have a toggle for the permission, that's the permission plugin's job

That said, the reason this has never been implemented is because the link requirement check happens before the player has even fully joined the server... this means that (most?) permissions plugins don't have the player's permissions loaded just yet.

Have you tested this? Which permissions plugin?

Scarsz avatar Mar 03 '23 03:03 Scarsz

Seems unnecessary to have a toggle for the permission, that's the permission plugin's job

That said, the reason this has never been implemented is because the link requirement check happens before the player has even fully joined the server... this means that (most?) permissions plugins don't have the player's permissions loaded just yet.

Have you tested this? Which permissions plugin?

Haven't tested it yet, I've seen some perm loading go fast enough but it just depends what you have loaded. I'll try it right now with a server with 30ish plugins

supercoolspy avatar Mar 03 '23 03:03 supercoolspy

Yeah, doesn't load fast enough, in theory could the login event be pushed to nonpre if they enable the perm?

supercoolspy avatar Mar 03 '23 04:03 supercoolspy

Did some poking around, currently DSRV defaults to listening to AsyncPlayerPreLogin at LOWEST, which is before LuckPerms loads at LOW. By PlayerLogin at LOW, LP will kick players if their data isn't loaded, so any priority after LOW on non-async should guarantee permission data, and I believe even anything after LOW on async should be fine too (I think LP blocks the async event?). So, switching the event priority to NORMAL should be sufficient to make this work.

Obviously this only applies to LP, but given it's got the vast majority of the marketshare, I figure that's probably all that really matters.

underscore11code avatar Mar 03 '23 05:03 underscore11code

Did some poking around, currently DSRV defaults to listening to AsyncPlayerPreLogin at LOWEST, which is before LuckPerms loads at LOW. By PlayerLogin at LOW, LP will kick players if their data isn't loaded, so any priority after LOW on non-async should guarantee permission data, and I believe even anything after LOW on async should be fine too (I think LP blocks the async event?). So, switching the event priority to NORMAL should be sufficient to make this work.

Obviously this only applies to LP, but given it's got the vast majority of the marketshare, I figure that's probably all that really matters.

(My alt) Yeah I think if we either force set it to normal or higher that would be good. Either that or we warn/error and make them manually set it if they turn the perm on in the config

NullTxt avatar Mar 03 '23 16:03 NullTxt

Seems unnecessary to have a toggle for the permission, that's the permission plugin's job

That said, the reason this has never been implemented is because the link requirement check happens before the player has even fully joined the server... this means that (most?) permissions plugins don't have the player's permissions loaded just yet.

Have you tested this? Which permissions plugin?

If I understand this correctly, this feature would surely be appreciated by many server owners. I looked for a way to enforce discord linking at a later point than the first join to make the first join as user-friendly as possible. The plan was to give beginner ranks the bypass permission and as soon as they got used to the server concept and ranked up, they would need the discord linking. Is this possible with existing features? I didn't find anything in the docs on the linking.yml page.

gerolndnr avatar May 29 '24 20:05 gerolndnr

You could lock things behind the discordsrv:linked luckperms context

Dinty1 avatar May 29 '24 21:05 Dinty1

Closing this due to inactivity, feel free to re-open if a better solution to this problem is proposed

Scarsz avatar Jul 01 '24 21:07 Scarsz