-
Notifications
You must be signed in to change notification settings - Fork 0
/
host
34 lines (30 loc) · 988 Bytes
/
host
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
--test test test
--cloud system's host made by oedze
--check version with karelmikie3 his updater idea
version = "1.5.1"
response = http.get("https://raw.githubusercontent.com/oedze/cloud/master/version")
newVersion = response.readAll()
if newVersion ~= version then
shell.run("cloudDir/updater")
end
os.loadAPI("cloud_host")
rednet.open("top")
cloud_host.log("running host")
while true do
cloud_host.log("---------------------------------------------------")
requestID, msg = rednet.receive()
print(requestID.." "..msg)
cloud_host.log("requestID = "..requestID)
if msg == "cloudLogin" then
status = cloud_host.userLogin(requestID)
cloud_host.log("person logged in")
print("status: "..status)
elseif msg == "cloudUpload" then
status = cloud_host.userUpload(requestID)
cloud_host.log("status: "..status)
rednet.send(requestID, status)
elseif msg == "cloudDownload" then
status = cloud_host.userDownload(requestID)
cloud_host.log("status: "..status)
end
end