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

HTTP request turtle position/id headers

Started by Pinkishu, 03 July 2013 - 08:25 AM
Pinkishu #1
Posted 03 July 2013 - 10:25 AM
I know this concept from SL
When in SL a script makes a http-request in the request headers you can find the object position and simulator name in the HTTP Headers
Similarly a CC request could add the turtle ingame location, dimensions and/or ID to the request

But you can already get the position with rednet?
Yeah, kind of, if you have a server-wide rednet range or filled your map with a hundred thousand computers. Also it doesn't help to identify the source of an http request

But you can identify the source by signing the message?
Yeah, kind of I suppose, still only tells about a specific source and not where to find it

But it breaks the 4th wall!
Yup, so does the HTTP Api in general, which is why its disabled by default and has to be enabled

———–

Why is this useful?
Well you can identify where requests come from and it can be used for administrative purposes. Since apparently people refuse to let the bios.lua have more info about the turtle. It would also make a lua-impementation of turtle permissions way easier. And for the receivers of the requests it is clearer where it came from.

The only issue I really see is that people would use it as a cheap way to get the turtles position, but maybe thats why i could have its on boolean to be enabled or so..
Bubba #2
Posted 03 July 2013 - 12:01 PM
I really like this idea, from both an administrative and user's perspective.

And please, guys. Don't just say "You can do it yourself", because that's no excuse to not implement something. Sometimes it is better to have it included by default and not have to program it in every time. Not to mention the fact that this would require a lot of manual labor in the world unless you set up some complicated processes, and that to me is just undesirable and against the whole point of CC.

Of course, I'm just a lowly pauper so my words don't carry much weight. Regardless, it would make my day if this were implemented.
Pinkishu #3
Posted 03 July 2013 - 12:07 PM

(click for big version), should work i hope @ image, its a new img hoster i havent tried too much yet..

the headers SL adds, ofc CC doesn't need so many anyway :P/>
Lyqyd #4
Posted 03 July 2013 - 01:07 PM
I really like this idea, from both an administrative and user's perspective.

And please, guys. Don't just say "You can do it yourself", because that's no excuse to not implement something. Sometimes it is better to have it included by default and not have to program it in every time. Not to mention the fact that this would require a lot of manual labor in the world unless you set up some complicated processes, and that to me is just undesirable and against the whole point of CC.

Of course, I'm just a lowly pauper so my words don't carry much weight. Regardless, it would make my day if this were implemented.

Um, no, one can't modify the user agent, so one can't do it themselves. I'd rather have the ability to change the user agent from the Lua than to have it simply be this information (since this information could be built into it from the Lua side). And not including thing by default that one can build themselves is a good approach. They do include some useful helper functions, most of which simply provide functionality for built-in programs or provide backwards compatibility (like the rednet wrapper). The rest of the ecosystem is quite wide open, which allows for people to do things any way they like. Locking all users into certain functionality just for convenience isn't always a good thing. There's a balance to be struck, and I think that the ComputerCraft developers do a great job at achieving that balance.
Pinkishu #5
Posted 03 July 2013 - 01:36 PM
Useragent is possible, I'm still trying to find a good way to implement turtle permissions lua-side without needing server-wide rednet though haha :D/>