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

add /restrictsubclaim #135

Merged
merged 6 commits into from Jul 22, 2017
Merged

Conversation

jacob1
Copy link

@jacob1 jacob1 commented May 24, 2017

Right now you can add extra permissions to small areas in claims using subclaims, but there is no way to make more restrictive permissions. If you want to limit access to a certain chest on a shared base, for example, there is no way to do that.

This adds /restrictsubclaim (/rsc), which can be used to make a subclaim inherit no permissions from the parent claim. You can then add in the players you want to have access to the subclaim. It has been very useful on my server, for large team bases with 10+ members, and also for locking specific chests in public farms.

Even though this PR has been in use on my server for a while, it is unfinished. It doesn't support database storage, support for that would need to be added before this is merged. There's also some unanswered questions about who exactly should be able to use /restrictsubclaim, right now anyone with permissiontrust can use it, even though only owners have any permissions on newly created restricted subclaims (this is probably a bug)

@RoboMWM RoboMWM changed the title add /restrictsubclaim [WIP] add /restrictsubclaim May 24, 2017
@zedwick
Copy link

zedwick commented May 26, 2017

Just wanted to say thanks for working on this feature, not being able to restrict access in subclaims has definitely been something players on my own server have talked about having a problem with.

@jacob1
Copy link
Author

jacob1 commented May 26, 2017

Great, I might have time this weekend to finish it. I've been using it on my server for months, I just finally found the motivation to PR it and finish the other database type.

@jacob1
Copy link
Author

jacob1 commented May 29, 2017

I added database storage support, and decided to only allow owners to use /rsc. This should be completed now.

By the way, the source code is a mess of tabs and spaces. It makes it hard to understand when you have tabs set to 8 spaces (I usually do 4 but the editor I was using just happened to default to 8). I used tabs here to match the code around what I was editing, but you should probably make sure there is some standard about what to use.

@bigpresh
Copy link
Collaborator

bigpresh commented Jun 3, 2017

This looks good and sane to me. It'll want careful testing, but the fact you're already using it yourself is reassuring :)

Thanks for your work on this!

Also, regarding the mix of tabs and spaces (and coding style in general), yes, it's a mess, I believe that's all going to be sorted during the ongoing refactoring job.

@jacob1 jacob1 changed the title [WIP] add /restrictsubclaim add /restrictsubclaim Jun 3, 2017
@RoboMWM
Copy link

RoboMWM commented Jun 4, 2017

I know you're using it, but I'm wondering if you can find some other servers (or use a backup) to test the conversion process, since you do convert both databases to a new schema...

@jacob1
Copy link
Author

jacob1 commented Jun 4, 2017

I created a test server to test the conversion process when I wrote it. It seemed to work fine. There were only a few claims to convert but it created the new column and set it to the correct value for the restricted subclaim.

There is no conversion process for .yml, I think because of the way that works it will default to false if it isn't already there. I don't remember having any issues when my server was converted months ago.

@RoboMWM
Copy link

RoboMWM commented Jun 5, 2017

Yea, will need to have some flatfile testing - not sure how it's going to react with a mix of old and new flatfiles...

@jacob1
Copy link
Author

jacob1 commented Jun 5, 2017

I just checked my flat files, most of them don't have "inheritNothing: false" in them. Even though it works completely fine without that there, I will add a conversion process to them for completeness (sometime later this week).

If anyone else wants to test this or try it out, I put a compiled .jar here: http://mc.starcatcher.us/GriefPrevention.jar
(or just compile it yourself, it is very easy)

TooMuchIpOverlap,
StandInSubclaim,
SubclaimRestricted,
SubclaimUnrestricted,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Trailing comma here, does this compile?

@jacob1
Copy link
Author

jacob1 commented Jun 12, 2017

Turns out it was already fine, I just did some testing. When upgrading the flatfile schema from 2 to 3, it already regenerates all the .yml files. This adds the inheritNothing = false to all of them

So I don't see any issues, everything worked fine in my testing.

@jacob1
Copy link
Author

jacob1 commented Jun 22, 2017

Is this going to be looked at or merged soon? It is complete.

@RoboMWM
Copy link

RoboMWM commented Jun 22, 2017

Mind adding documentation of this command to the wiki?

@jacob1
Copy link
Author

jacob1 commented Jun 23, 2017

OK, added to the Commands page

@bigpresh
Copy link
Collaborator

As soon as I have a few moments to spare, I'll build & deploy to my test server after backing up the claims data flatfiles, and check the end result seems sane. If I feel particularly brave, I may even try out a proper DB-backed store migration, too (I'd like to switch to that eventually, anyway).

So, sorry for the delay, but it's not being ignored!

@bigpresh
Copy link
Collaborator

(I should add that I don't speak for @RoboMWM - whether it's merged or not isn't my call, I'm just offering to do some additional testing so I can confirm that it worked well for me - the more testing the better :) )

@RoboMWM
Copy link

RoboMWM commented Jun 28, 2017

I've been busy and will be for the summer, hopefully I'll be able to look over this on the weekend (though from a brief look, it seems ok). Either way, it will be looked over before the next release.

Copy link

@RoboMWM RoboMWM left a comment

Choose a reason for hiding this comment

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

Seems ok I guess. Seems like you changed some of the formatting, but that's a mess already.

@RoboMWM RoboMWM added this to the 16.8 milestone Jul 1, 2017
@RoboMWM RoboMWM merged commit 5d474e5 into GriefPrevention:master Jul 22, 2017
@jacob1 jacob1 deleted the restrictsubclaim branch December 29, 2017 02:13
Minidodo1 pushed a commit to Minidodo1/GriefPrevention that referenced this pull request Jun 14, 2018
Will update databases - warn server owners to backup when releasing (they should be backing up anyways...)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants