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

networking

Started by michielewiel, 31 March 2012 - 09:53 AM
michielewiel #1
Posted 31 March 2012 - 11:53 AM
My hobby is making and mantaince networks and i have three suggestions.

1) Making reapters so that u can extend ur network.

2) making a cable wich can be used for file transfer between diffrent computer's without having to make a server ( so that u can make peer to peer networks). These network type's woud offer more safety and woud create a lot more possibilty with mod ;p

3) if we woud go further with networking and servers i woud like to suggest the lose of megabytes per block i think the the ammount of lose woud depend on how much trafic and wich type of network and how strong the server woud be

thanks for your time,
Michiel
xuma202 #2
Posted 31 March 2012 - 12:06 PM
Well 2 is already possible I think.

You can hook up 2 Computers with a RedPower Bundled cable and transfer data. No need for "servers"
Alex_ #3
Posted 31 March 2012 - 07:06 PM
1) You can program computers to act like repeaters
2) You can do that through rednet bundled cables
3) Im not sure about this idea because then it make networks unreliable. You can do it personally using the gps to work out how many blocks away it is to decide how many packets it looses.
ComputerCraftFan11 #4
Posted 31 March 2012 - 08:44 PM
1) That is already possible, to make a repeater, heres a example code (Untested)

while true do
message, id = rednet.receive()
rednet.broadcast(message)
end

If you receive a message on this computer, it will repeat the message (or broadcast it) to make it go further

2) Read post above me….

3) That is also possible, heres a example code:

Server/Network Provider

local ConnectPeople = 0
local CurrentSpace = 100
while true do
 term.clear()
 term.setCursorPos(1,1)
 print("Space Left: " ..CurrentSpace.. "MB")
 print("People Joined: " ..ConnectPeople)
 message, id = rednet.receive()
 if message == os.getComputerID then
  rednet.send("Joined", id)
  ConnectPeople = ConnectPeople +1
 end
end

Server/Network Joiner

local ConnectedToAnetwork = false;

write("Join: ")
iddd = read()
rednet.broadcast(iddd)
a, b = rednet.receive()
if b == iddd then
 print("Joined " ..a)
 ConnectedToAnetwork = true
end