Posted 18 October 2012 - 12:18 AM
I've been working on Internet in Tekkit for the last few days and I've come across a little snag.. Anyways, I've got a server that is beginning to look more and more upon the Internet for their needs, and this has led to many issues with the current server since it waits a maximum of 60 seconds for every request before moving on.. This can send people into loops and what not, and I was wondering if there was a way to make it so the server could either run multiple people at the same time, or send a message when it is busy..
I use functions to handle everything, so I have been thinking of using the parralel function, but I'm not sure if that would really work or not.. Anyways, I'll post the code below to show what the current issue is, and see if maybe anyone can give me an idea or fix.
Thanks for any assistance,
Saugrim
I use functions to handle everything, so I have been thinking of using the parralel function, but I'm not sure if that would really work or not.. Anyways, I'll post the code below to show what the current issue is, and see if maybe anyone can give me an idea or fix.
function Download()
print("Processing request from "..(ID).." ")
rednet.send(ID, "DownloadProt")
ID, message, distance = rednet.receive(30)
x = message
p = ID
if x == nil then
shell.run("server")
elseif x ~= nil then
checkf = fs.exists("Files/"..(x).."")
if checkf ~= true then
rednet.send(p, "exist")
r()
elseif checkf == true then
h = fs.open("Files/"..(x).."", "r")
content = h.readAll()
rednet.send(p, ""..(content).."")
shell.run("server")
else
shell.run("server")
end
end
end
Thanks for any assistance,
Saugrim