LuckPerms

LuckPerms

41.4k Downloads

Reset everyones rank back to default?

codibez opened this issue ยท 10 comments

commented

Is there a command I can use to make set everyones group back to default? I am trying to run an economy / group reset on my server and would rather not have to manually set 100s of users ranks back :(

commented

Do you want to wipe all permissions or groups/users? Or are you just trying to reset groups to default?
Your syntax is incorrect.
/lp bulkupdate [action field] [action value] [constraint...]
Make sure you read all of the information on the page Luck linked

commented

Yeah, this should cover what you're trying to do.

https://github.com/lucko/LuckPerms/wiki/Bulk-Editing

commented

Ok, thanks! I have tried some commands but none of them seem to work. Could you please guide me to what the actual command I should run via console if I want to update all of the users groups to default? I have tried a lot like:

/lp bulkupdate users groups default
/lp bulkupdate users groups server default

and more but none of them are working. I am a bit confused on how exactly to use the bulkupdate command.

commented

I just want to set everyone's groups back to the default group. I want to keep all the permission for the group.

commented

I believe default is no group.
I haven't tested this, so make sure you back up your database before trying

/lp bulkupdate users delete permission

commented

There's an example on that page you can use:

/lp bulkupdate users delete "permission == group.<group name>" will delete all memberships of the given group.

commented

Is there a way I can just update everyones group to default instead of deleting the group from them? Maybe something like:
/lp bulkupdate users update permission group.* "permission == group.default"

EDIT: I tried testing the command you gave me and for some reason it shoots me some errors:

[23:12:04] [pool-7-thread-1/INFO]: [LP] Running bulk update.
[23:12:04] [Craft Scheduler Thread - 29/WARN]: org.h2.jdbc.JdbcSQLException: Column "group.owner" not found; SQL statement:
DELETE FROM luckperms_user_permissions WHERE permission = "group.owner"; [42122-193]
[23:12:04] [Craft Scheduler Thread - 29/WARN]: 	at org.h2.message.DbException.getJdbcSQLException(DbException.java:345)
[23:12:04] [Craft Scheduler Thread - 29/WARN]: 	at org.h2.message.DbException.get(DbException.java:179)
[23:12:04] [Craft Scheduler Thread - 29/WARN]: 	at org.h2.message.DbException.get(DbException.java:155)
[23:12:04] [Craft Scheduler Thread - 29/WARN]: 	at org.h2.expression.ExpressionColumn.optimize(ExpressionColumn.java:147)
[23:12:04] [Craft Scheduler Thread - 29/WARN]: 	at org.h2.expression.Comparison.optimize(Comparison.java:180)
[23:12:04] [Craft Scheduler Thread - 29/WARN]: 	at org.h2.command.dml.Delete.prepare(Delete.java:131)
[23:12:04] [Craft Scheduler Thread - 29/WARN]: 	at org.h2.command.Parser.prepareCommand(Parser.java:259)
[23:12:04] [Craft Scheduler Thread - 29/WARN]: 	at org.h2.engine.Session.prepareLocal(Session.java:561)
[23:12:04] [Craft Scheduler Thread - 29/WARN]: 	at org.h2.engine.Session.prepareCommand(Session.java:502)
[23:12:04] [Craft Scheduler Thread - 29/WARN]: 	at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1203)
[23:12:04] [Craft Scheduler Thread - 29/WARN]: 	at org.h2.jdbc.JdbcStatement.executeInternal(JdbcStatement.java:170)
[23:12:04] [Craft Scheduler Thread - 29/WARN]: 	at org.h2.jdbc.JdbcStatement.execute(JdbcStatement.java:158)
[23:12:04] [Craft Scheduler Thread - 29/WARN]: 	at me.lucko.luckperms.common.storage.backing.SQLBacking.applyBulkUpdate(SQLBacking.java:268)
[23:12:04] [Craft Scheduler Thread - 29/WARN]: 	at me.lucko.luckperms.common.storage.AbstractStorage.lambda$applyBulkUpdate$1(AbstractStorage.java:100)
[23:12:04] [Craft Scheduler Thread - 29/WARN]: 	at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1590)
[23:12:04] [Craft Scheduler Thread - 29/WARN]: 	at org.bukkit.craftbukkit.v1_11_R1.scheduler.CraftTask.run(CraftTask.java:71)
[23:12:04] [Craft Scheduler Thread - 29/WARN]: 	at org.bukkit.craftbukkit.v1_11_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:52)
[23:12:04] [Craft Scheduler Thread - 29/WARN]: 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
[23:12:04] [Craft Scheduler Thread - 29/WARN]: 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
[23:12:04] [Craft Scheduler Thread - 29/WARN]: 	at java.lang.Thread.run(Thread.java:745)
[23:12:04] [Craft Scheduler Thread - 29/INFO]: [LP] Bulk update failed. Check the console for errors.
[23:12:04] [Craft Scheduler Thread - 28/INFO]: [Statz debug] Save Statz database.
[23:12:14] [Craft Scheduler Thread - 29/INFO]: [Statz debug] Save Statz database.

Also not sure if my database that LP is connected to should not show any luckperms_ table(s) but the only tables I have in my database are from another plugin, LuckPerms never created a table for me in the database as shown here.

EDIT 2: I changed storage type to mysql and it inserted the table(s) into my databse. I ran many bulkupdates to each and every rank changing them to group.default like so:

/lp bulkupdate users update permission group.default "permission == group.peasent"
/lp bulkupdate users update permission group.default "permission == group.laborer"
/lp bulkupdate users update permission group.default "permission == group.planter"
/lp bulkupdate users update permission group.default "permission == group.rancher"
/lp bulkupdate users update permission group.default "permission == group.sharecropper"
/lp bulkupdate users update permission group.default "permission == group.jrfarmer"

and so on for each rank... This issue is now solved!

commented

Ok thank you and that will put them back into the default group right?

commented

It'll just remove them from the group you specify.

commented

This is what I did which solves the problem without having to repeat yourself with different groups.

/lp bulkupdate users update permission group.default "permission ~~ group.%"

This will reset everyone no matter the group back to the default group.