-
-
Notifications
You must be signed in to change notification settings - Fork 166
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
Setting player activity as a rank/sync with DiscordSRV #3208
Comments
This behavior of the placeholder occurs when stuff is executed on the server thread. If it is possible to switch command helper to execute async task it will wait until value is available to do the replacement. Async way it's always replaced on first try. (This is to not crash the server.) If you have a plugin doing it, the common queries in Query API can fetch the activity index of a player, skipping the placeholder api middleman |
This sounds like a 3rd plugin needs to be implemented using apis of LuckPerms (or discordSRV) and Plan |
You might be able to do this with ExtraContexts (specifically it's PlaceholderAPI integration) then granting the Something like this (entirely untested), DiscordSRV synchronization.yamlGroupRoleSynchronizationGroupsAndRolesToSync: {"veryactive": "...", "active": "..."} ExtraContexts configplaceholderapi-placeholders:
activitygroup: "%plan_player_activity_group%" LuckPerms permissions
|
That could be another option, I would just need |
I think Luckperms updates context on the server thread (not 100% sure), and trying to load data from database on the server thread will crash the server. Because Plan placeholders lookup database stuff, when something on server thread tries to look up the value it instead returns early and runs a task to get the data asynchronously. This is why it works 2nd time. Placing the value in Load_these_placeholders_on_join will make Plan lookup the placeholder value as soon as player joins, asynchronously. Before the data is available the placeholder can't return anything. If the other plugin does the placeholder thing asynchronously then Plan can safely wait for the query to finish and it'll return the value on 1st try. Did you test out extracontexts yet? :) |
I cant test out ExtraContexts until get that placeholder to work when its used, in the inital ticket I already tested with |
I would like to be able to..
Ahoy!
Activity as Group/rank & Discord role
I would like to be able to have roles on my discord server that are 1:1 copies of player activity on Plan.
DiscordSRV can sync ranks, so it could be as simple as manually creating ranks in Luckperms and then having Plan set the rank when they log in to their Activity status, this could be a simple array in the plan configs, for example "Very Active = VeryActiveRank" then in the DiscordSRV settings have that rank sync to a discord role.
Reasoning
This would provide fantastic insight into the activity of a player if they are ranting or posting on a discord which is seperate from in-game, for example servers with a lot of players will still have hundreads of peolpe in the discord that no longer play on the server!
Is your feature request related to a problem? Please describe.
Considered Options
You have an activity placeholder, I was going to just try and script this in commandhelper, that when players log in, it grabs their Activity and sets them at the correct LP group if its changed, BUT I cant get the placeholder to display the first time its used, I tested it in chat and it takes a few times of spamming it to actually pull the activity of a player, otherwise it just displays as the placeholder text.
I have set
%player_activity_group%
inLoad_these_placeholders_on_join
with no change in having to spam it to work. Via https://github.com/plan-player-analytics/Plan/wiki/PlaceholderAPIThe text was updated successfully, but these errors were encountered: