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

Concept: http based rednet alternative

Started by M4sh3dP0t4t03, 22 April 2013 - 02:28 AM
M4sh3dP0t4t03 #1
Posted 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?
lieudusty #2
Posted 22 April 2013 - 04:48 AM
I don't think thats possible without sockets.
Sammich Lord #3
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.
GravityScore #4
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.
jesusthekiller #5
Posted 22 April 2013 - 08:03 AM
Look at my WCON (signature)
M4sh3dP0t4t03 #6
Posted 22 April 2013 - 09:12 AM
Look at my WCON (signature)
I already know that, but that isn't exactly what I meant
lieudusty #7
Posted 22 April 2013 - 12:03 PM
Look at my WCON (signature)
Your method works but its not realtime. It has a delay on every update.
jesusthekiller #8
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.