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

Enhanced admin-powers for command computers

Started by LupoCani, 11 February 2015 - 06:34 PM
LupoCani #1
Posted 11 February 2015 - 07:34 PM
I understand that a new form of computer has been implemented in the CC beta, capable of executing commands directly and reading the return data. Seeing as these are effectively admin computers, I think they could be equipped with a few other god-mode features in line with that concept.

Firstly, they ought to run in a separate thread. Jamming CC across an entire server using a few units in four-second loops is far too easy, and command computers definitely should not be so simple to prevent from functioning.

Secondly, they should be able to share this protection with other, non-command computers. While a thread of their own would protect the computers themselves, they're still likely to need other computers to interact with players, particularly the pocket variety. As such, they should be be able to reboot other computers into the "safe" thread and back. To ensure computers that have been granted this access cannot be abused, there should also be a function to lock/unlock the file system from being edited in a disk drive.

Thirdly, unlimited wireless range. In addition to the usual modem API functions, modem.openFar(n) and modem.transmitFar(n, n, msg) should allow i to receive from and transmit to the entire map. Mainly because range can be rather restricting, and I see no reason not to allow an admin computer to bypass it.
HPWebcamAble #2
Posted 16 February 2015 - 03:59 PM
unlimited wireless range. In addition to the usual modem API functions, modem.openFar(n) and modem.transmitFar(n, n, msg) should allow i to receive from and transmit to the entire map. Mainly because range can be rather restricting, and I see no reason not to allow an admin computer to bypass it.

Good idea, but perhaps there should be a new 'Creative Modem' with this functionality. It makes it's use more obvious.

The other two seem ok, but I'm not sure how feasible it is to implement.
If it was up to me, CC would have two to four threads, and computers would be split between them when necessary.
SquidDev #3
Posted 16 February 2015 - 04:03 PM
Firstly, they ought to run in a separate thread. Jamming CC across an entire server using a few units in four-second loops is far too easy, and command computers definitely should not be so simple to prevent from functioning.

Secondly, they should be able to share this protection with other, non-command computers. While a thread of their own would protect the computers themselves, they're still likely to need other computers to interact with players, particularly the pocket variety. As such, they should be be able to reboot other computers into the "safe" thread and back. To ensure computers that have been granted this access cannot be abused, there should also be a function to lock/unlock the file system from being edited in a disk drive.

I've been doing a lot of work with LuaJ and I'm pretty sure that the current version does not allow this to happen. Well, it sort of does but everything will break. Only one co-routine can be run at any time or otherwise tracebacks (error messages, getfenv(number), etc…) will just not work.

-snip-

Good idea, but perhaps there should be a new 'Creative Modem' with this functionality. It makes it's use more obvious.

I think either this or the more hacky way of just providing the same table (like the string metatable hack) to every computer would be pretty useful.
Edited on 16 February 2015 - 03:04 PM
Geforce Fan #4
Posted 21 February 2015 - 12:50 AM
I agree for the separate thread, but ONLY for the command computers. I agree with the modems too, but the idea of putting other computers in the thread just makes no sense.
If command computers become a major thing for servers, there could be massive consequences for lagging down the thread.
LupoCani #5
Posted 21 February 2015 - 03:49 PM
Which is why, for such a feature to be implemented, there would have to be a way for command computers to ensure only authorized software is running on elevated computers. I did mention that concern in my original post. It's a moot point anyway, since it would seem CC cannot run multiple threads at all.
manu_03 #6
Posted 23 March 2015 - 04:30 PM
In addition, it would also have command block emulation (access to all commands). I want this to add Computer-Powered shop for my server.
Bomb Bloke #7
Posted 23 March 2015 - 11:21 PM
As far as I'm aware, they do have access to all command-block commands, including ones added by other Forge mods.

Bear in mind that MC 1.8's command list is quite different to that of 1.7.10.