A
Admincraft•6mo ago
riso

assigning permissions on join based on CSV file?

hello! i have a list of emails and an associated value that will determine a permission that will be given to newly joining members of my server. they first verify their email online, and then their email is linked to them via a SQL db. i need a way to check the CSV after email verification and run a command based on its outputs. it sounds like it would have to be a plugin, but i dont know how to write one. any insight from developers? thanl you in advance!
17 Replies
Admincraft Meta
Admincraft Meta•6mo ago
Thanks for asking your question!
Make sure to provide as much helpful information as possible such as logs/what you tried and what your exact issue is
Make sure to mark solved when issue is solved!!!
/close !close !solved !answered
Requested by risograph#0
Natalie Trinket
Natalie Trinket•6mo ago
It sounds like you're trying to grant permissions based on the user's status on something like Patreon. You'd be better off using the Minecraft Authentication mod/plugin than having the user manually verify their email when they join. https://minecraftauth.me/ I made a companion Spigot plugin that allows you to grant roles based on the information Minecraft Authentication provides. If you're not running Spit/Paper, then you should be able to use the API calls I have in my plugin as an example for getting the information you need. https://modrinth.com/plugin/minecraftauthenticationroles
Minecraft Authentication
Link your Minecraft account to other services
Modrinth
MinecraftAuthenticationRoles - Minecraft Plugin
A simple plugin that allows server owners to grant permissions using LuckPerms based on a users minecraftauth.me information.
riso
risoOP•6mo ago
lol thats my post this is basically step 2
Skullians
Skullians•6mo ago
oh shoot am blind shoot mb
riso
risoOP•6mo ago
all good!
Skullians
Skullians•6mo ago
is 1am here 😭
riso
risoOP•6mo ago
so ill clarify at this point: i am running a school minecraft server, and i have a list of everyone's emails and their year of grad. each player can already link their email to their account, what i have to figure out now is how to assign them a permission that matches their year of grad for cosmetic reasons
riso
risoOP•6mo ago
basically:
No description
riso
risoOP•6mo ago
where name is unimportant
Natalie Trinket
Natalie Trinket•6mo ago
Ah, yeah, that's out of scope for Minecraft Authentication. You might be able to do this with Skript, but I don't have any direct advice on that. It seems like you'd be dependent on being able to trigger the permissions event after they've used whatever method of email verification you landed on. It seems like it'd be a really easy plugin to make tbh. I'm assuming that if they haven't verified their email online then they can't join the server, in which case all the plugin would have to do is this 1. When the player joins, check if the uuid exists in the SQL DB, if not then kick them. 2. If they do exist, check the year and format it into a luckperms group name 3. Check if the user has that group, if not then add it.
riso
risoOP•6mo ago
okay got it, i premptively joined the skript discord server because i knew it would have to be something like that. thank you for the guidance!
Kaludi
Kaludi•6mo ago
This sounds interesting, are you planning on uploading a CSV file manually to the plugin/skript’s directory regularly or will the same SQL DB be used to check?
riso
risoOP•6mo ago
so they are actually different, which is part of the problem i figured it out at 12 am! just learned skript for this
riso
risoOP•6mo ago
No description
riso
risoOP•6mo ago
in short:
on join:
set {_filter} to mongo filter where field "username" is "%player%"
set {_data} to first mongo document with filter {_filter} of collection {mongo::collection}

set {_email} to value "bsonDocument::email" of json from {_data}
set {_year} to value "year" of value {_email} of {class.json}
on join:
set {_filter} to mongo filter where field "username" is "%player%"
set {_data} to first mongo document with filter {_filter} of collection {mongo::collection}

set {_email} to value "bsonDocument::email" of json from {_data}
set {_year} to value "year" of value {_email} of {class.json}
i was struggling to figure out how to write {{_email}::year} at the bottom, too tired to read about variable nesting !solved
Admincraft Meta
Admincraft Meta•6mo ago
post closed!
The post/thread has been closed!
Requested by risograph#0

Did you find this page helpful?