This is a read-only snapshot of the ComputerCraft forums,
taken in April 2020.
Concept: http based rednet alternative
Started by M4sh3dP0t4t03, 22 April 2013 - 02:28 AMPosted 22 April 2013 - 04:28 AM
I had today the idea of a rednet alternative that isnt only limited to the server by making an API and a http server, over that the messages are send. I don't have any idea of http so I couldn't make it, but if someone has the needed coding knowledge and the money for renting a server for making this it would be nice for multiplayer games. So, what do you think about this idea?
Posted 22 April 2013 - 04:48 AM
I don't think thats possible without sockets.
Posted 22 April 2013 - 05:13 AM
You can write a simple Node.js script to store all messages in a array then when you request a message it will just print out the message. But anything real-time needs to be with sockets.
Posted 22 April 2013 - 06:09 AM
It is possible without sockets, it will just spam HTTP.
For polling the server for a response, you could just have the script wait until a new message appears, and use http.request in a loop to avoid the request timeouts. I don't recommend this though, plus it wouldn't be very real time.
For polling the server for a response, you could just have the script wait until a new message appears, and use http.request in a loop to avoid the request timeouts. I don't recommend this though, plus it wouldn't be very real time.
Posted 22 April 2013 - 08:03 AM
Look at my WCON (signature)
Posted 22 April 2013 - 09:12 AM
I already know that, but that isn't exactly what I meantLook at my WCON (signature)
Posted 22 April 2013 - 12:03 PM
Your method works but its not realtime. It has a delay on every update.Look at my WCON (signature)
Posted 22 April 2013 - 12:17 PM
Yes, it doesn't matter how you will do it, HTTP API will always have a delay tho.