Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --DuoStep Server v0.2
- --Please use the installer to download DuoStep v0.2; The installer is located at: http://pastebin.com/RdPg0Rmr
- --(c)2013 NewCoolPC, willwac, and Thy.me Programs
- --local function menu()
- --local cfg = fs.open("/sys/players")
- --local line = 2
- --local player = {"NewCoolPC"}
- --plr = "NewCoolPC"
- --while plr ~= nil do
- --plr = cfg.readLine()
- --player[line] = plr
- --line = line+1
- --end
- --plr = nil
- --cfg.close()
- --local cfg = fs.open("/sys/pass")
- --local line = 1
- --ps = "a"
- --while ps ~= nil do
- --ps = cfg.readLine()
- --pass[line] = ps
- --line = line+1
- --end
- --ps = nil
- --cfg.close()
- --local cfg = fs.open("/sys/.au")
- --local line = 2
- --local admin = {"NewCoolPC"}
- --plr = "NewCoolPC"
- --while plr ~= nil do
- --plr = cfg.readLine()
- --admin[line] = plr
- --line = line+1
- --end
- --plr = nil
- --cfg.close()
- --local cfg = fs.open("/sys/.pwd/.ap")
- --local line = 1
- --local adminpass = {"a"}
- --pass = "a"
- --while pass ~= nil do
- --pass = cfg.readLine()
- --adminpass[line] = plr
- --line = line+1
- --end
- --pass = nil
- --cfg.close()
- term.clear()
- term.setCursorPos(1,1)
- --REAL Config
- local side = "top"
- local players = {"NewCoolPC"}
- local pass = {"asdf"}
- --local admin = {"NewCoolPC","ServerOwner"}
- --local ap = {"adminnono","yourPass"}
- print("Config Loaded")
- --If you change these, the program will be messed up
- local valid = false
- local isTrue = 2021185
- local isFalse = 6112195
- local myID = os.getComputerID()
- local num = 1
- --local serverVer = "0.2"
- print("Local Vars Loaded")
- --The Program, PLEASE DO NOT CHANGE ANY CODE!
- rednet.open( side )
- print(side.." wireless modem opened")
- local function server()
- sndr = nil
- while sndr == nil do
- sndr, msg = rednet.receive()
- end
- print("Received "..msg[1]..", and "..msg[2].." from "..sndr..".")
- if msg[1] == "player" then
- while valid == false and num ~= #players+1 do
- if msg[2] == players[num] then
- valid = true
- elseif msg[2] ~= players[num] then
- valid = false
- end
- num = num+1
- end
- if valid == true then
- rednet.send(sndr, isTrue)
- else
- rednet.send(sndr, isFalse)
- end
- valid = false
- num = 1
- elseif msg[1] == "login" then
- while valid == false and num ~= #pass+1 do
- if msg[3] == pass[num] then
- valid = true
- else
- valid = false
- end
- num = num+1
- end
- if valid == true then
- rednet.send(sndr, isTrue)
- else
- rednet.send(sndr, isFalse)
- end
- valid = false
- num = 1
- else
- printError("Unknown Command Received!")
- server()
- end
- server()
- end
- server()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement