made nshd take an argument for function to run, made luash-login able to coexist with luash, added luash-login to everything-noinit.cfg

This commit is contained in:
Izaya 2017-07-15 11:31:28 +10:00
parent f12080f7b9
commit a2a5925399
3 changed files with 8 additions and 5 deletions

View File

@ -25,6 +25,7 @@ net/nshc-auth.lua
net/pxesrv.lua net/pxesrv.lua
applications/shutil.lua applications/shutil.lua
applications/skex2.lua applications/skex2.lua
applications/luash-login.lua
applications/luash.lua applications/luash.lua
applications/ircbridge.lua applications/ircbridge.lua
applications/autoluash.lua applications/autoluash.lua

View File

@ -1,4 +1,4 @@
function luash(si) function luash_login(si)
s("lua shell",function() s("lua shell",function()
local np = "" local np = ""
while np ~= pass do while np ~= pass do
@ -16,3 +16,4 @@ s("lua shell",function()
end end
end,si) end,si)
end end
luash = luash_login

View File

@ -1,6 +1,6 @@
function nshd_w(evPP,cA,sI) function nshd_w(evPP,cA,sI,F)
s("nshd - "..tostring(sI),function() s("nshd - "..tostring(sI),function()
luash({["sI"]=sI}) F({["sI"]=sI})
while true do while true do
if ev[1] == "net_msg" then if ev[1] == "net_msg" then
local msg=tostring(ev[4]) local msg=tostring(ev[4])
@ -18,7 +18,8 @@ s("nshd - "..tostring(sI),function()
end,{["sI"]=sI}) end,{["sI"]=sI})
end end
function nshd(P) function nshd(P,F)
F=F or luash
s("nshd",function() s("nshd",function()
local Cc=1 local Cc=1
while true do while true do
@ -27,7 +28,7 @@ function nshd(P)
nnID="nsh-"..tostring(Cc) nnID="nsh-"..tostring(Cc)
Cc=Cc+1 Cc=Cc+1
ns(ev[2],P,nnID) ns(ev[2],P,nnID)
nshd_w(nnID,ev[2],nnID) nshd_w(nnID,ev[2],nnID,F)
print("[nshd]Spawned "..nnID.." for "..tostring(ev[2])) print("[nshd]Spawned "..nnID.." for "..tostring(ev[2]))
end end
end end