This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
robhol's profile picture

Peripheral "tools" for safety: possible?

Started by robhol, 25 June 2014 - 10:56 AM
robhol #1
Posted 25 June 2014 - 12:56 PM
I just had an idea today.

I've been annoyed for a long time at turtles being unusable in "less-than-100%-trusted" multiplayer. I totally understand why server owners banish them to separate world or disable them entirely, but it still bugs me a LOT.

My idea is actually fairly simple. Would it, at all, be possible to create a peripheral pickaxe/hoe that interfaces with one (or even several) permission/protection mods and checks a player's permission to build/mine in the current area?

I'm dreadfully out of date when it comes to mods and never touched peripheral programming before, so I'm not really in a position to know if this is a workable concept. If you can interface with other mods, you could have it check the proper permissions and even potentially log the changes. Or maybe just outright simulate the turtle's owner Player doing the change and let the other plugins work it from there.

Possible?
Lyqyd #2
Posted 25 June 2014 - 03:51 PM
Probably, but check in to what you can do with the API to be sure.
theoriginalbit #3
Posted 25 June 2014 - 05:32 PM
yes, it should definitely be possible, but with the new equip system I believe it may not be possible to stop them from adding the standard tools onto the Turtle.
robhol #4
Posted 26 June 2014 - 01:38 PM
It's like they're consciously trying to make it as hard as possible >_>

What new system is this? (Again - I'm not really up to date with the latest version)
Could it be disabled in any way at all?
Edited on 26 June 2014 - 11:39 AM
theoriginalbit #5
Posted 26 June 2014 - 01:49 PM
peripheral's can now be added and removed from a Turtle as opposed to being crafted on the Turtle and that permanently being the attached peripherals.

EDIT: oh I should mention you can still craft them on too
Edited on 26 June 2014 - 12:45 PM
H4X0RZ #6
Posted 26 June 2014 - 02:06 PM
yes, it should definitely be possible, but with the new equip system I believe it may not be possible to stop them from adding the standard tools onto the Turtle.
But you could override the BIOS and change turtle.equip to a clear function which allways return false :D/>
theoriginalbit #7
Posted 26 June 2014 - 02:44 PM
But you could override the BIOS and change turtle.equip to a clear function which allways return false :D/>
meaning you've never be able to attach any peripheral, which is not the aim of this discussion.
H4X0RZ #8
Posted 26 June 2014 - 02:47 PM
But you could override the BIOS and change turtle.equip to a clear function which allways return false :D/>
meaning you've never be able to attach any peripheral, which is not the aim of this discussion.
yea, maybe modify it on the Java level and check if it is a tool which can break stuff…
theoriginalbit #9
Posted 26 June 2014 - 03:13 PM
yea, maybe modify it on the Java level and check if it is a tool which can break stuff…
which then according to the ComputerCraft terms you would not be able to release your modification to the players.
H4X0RZ #10
Posted 26 June 2014 - 05:56 PM
yea, maybe modify it on the Java level and check if it is a tool which can break stuff…
which then according to the ComputerCraft terms you would not be able to release your modification to the players.
BIOS override which blocks original equip function and a NEW Java level function which is equiping
Cranium #11
Posted 26 June 2014 - 06:05 PM
BIOS override which blocks original equip function and a NEW Java level function which is equiping
I don't think you quite understand how this works…
H4X0RZ #12
Posted 26 June 2014 - 07:39 PM
BIOS override which blocks original equip function and a NEW Java level function which is equiping
I don't think you quite understand how this works…
could you roughly explain?
misson20000 #13
Posted 26 June 2014 - 10:35 PM
Why should there have to be special tools that check permissions, why not just make all of them check permissions?

You could modify the Java implementation of turtle.dig to check perimissions.
I don't think you'd have to release your modification, you could just keep it on the server.
Niverton #14
Posted 28 June 2014 - 09:21 PM
I don't know if you can override a peripheral recipe, but if you can then you have your protection tool. CC logs turtle's block placement and destruction under a false player, [ComputerCraft], so it should be possible to change it to the player who crafted the turtle (don't know how)
robhol #15
Posted 28 June 2014 - 10:16 PM
I know I can create a peripheral. The question is how. I'd rather not modify ComputerCraft itself if I don't have to. If nothing else, it's a pain in the ass. :P/> Also, it might be frowned upon.

I'm guessing that apart from the obvious addition of the peripheral, I'd need to patch turtle.dig and similar functions to "reroute" them through the safe versions of the tools.
Also, the turtle would need to keep track of its owner, which I'm not sure it does or if it's even possible? Any idea?

Oh, and if anybody else is interested in the idea and has some experience in modding, I'd love to help given a bit of guidance. :P/>
Edited on 28 June 2014 - 08:16 PM