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

Track which player "owns" a turtle #518

Open
wants to merge 2 commits into
base: master
from

Conversation

Projects
None yet
4 participants
@SquidDev
Contributor

SquidDev commented Feb 5, 2018

When a player places a turtle, they are marked as its owner. Any actions they perform (such as breaking blocks, moving, etc...) are performed using this player's game profile.

This allows turtles to work correctly with various permissions/claim mods. Previously you would have to whitelist all turtles in order for them to function within a claimed area.

See SquidDev-CC/CC-Tweaked#8 for the original issue & explanation. It's worth noting that the SwitchCraft server has been running a build of CC with this patch applied and it has solved all permissions issues. I'll updated the PR should any issues arise.

@lupus590

This comment has been minimized.

Contributor

lupus590 commented Feb 5, 2018

I assume turtles which are placed by turtles inherit the placing turtle's ownership?

What happens if I place a turtle using another mod? I would assume the mod's fake player get's ownership. (I may be wrong, but can a mod place blocks without a fake player? What about that?)

@SquidDev

This comment has been minimized.

Contributor

SquidDev commented Feb 5, 2018

I assume turtles which are placed by turtles inherit the placing turtle's ownership?

Yep. You can have turtles all the way down!

What happens if I place a turtle using another mod?

It depends. If other mods are doing things "correctly" and tracking a tile's owner, then it'll inherit the owner from there too. Otherwise it'll either use that mod's fake user* or CC's fallback fake user.

*By "fake user" I mean a fabricated GameProfile. We're still using a FakePlayer (or TurtlePlayer to be precise), it's just we're constructing it with the owner's GameProfile.

@Selim042

This comment has been minimized.

Selim042 commented Feb 5, 2018

Is there a way to check who owns a given turtle via Lua?

@SquidDev

This comment has been minimized.

Contributor

SquidDev commented Feb 5, 2018

Is there a way to check who owns a given turtle via Lua?

No, though that could be exposed in a later PR or through an upgrade. I'm only interested in fixing permissions mods here - anything else will probably add too much controversy :).

@Selim042

This comment has been minimized.

Selim042 commented Feb 5, 2018

Alright. I assumed that is what you were going to say, just curious.

SquidDev added some commits Feb 4, 2018

Track which player "owns" a turtle
When a player places a turtle, they are marked as its owner. Any actions
they perform (such as breaking blocks, moving, etc...) are performed
using this player's game profile.

This allows turtles to work correctly with various permissions mods.
Previously you would have to whitelist all turtles in order for them to
function within a claim.
Wrap ComputerCraft fake player name with brackets
This makes it obvious that this is a fake player, allowing easier
detection by other mods.
@thatcraniumguy

This comment has been minimized.

thatcraniumguy commented May 23, 2018

Can one of the admins verify this patch?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment