2017-06-20 04:36:55 +10:00
|
|
|
function nshds_w(evPP,cA,sI,pW)
|
|
|
|
s("nshds - "..tostring(sI),function()
|
2017-06-19 23:21:13 +10:00
|
|
|
chauths(cA,evPP,pW)
|
|
|
|
luash({["sI"]=sI})
|
|
|
|
while true do
|
|
|
|
if ev[1] == "net_msg" then
|
|
|
|
local msg=tostring(ev[4])
|
|
|
|
if ev[3] == evPP and ev[2] == cA then
|
|
|
|
if msg:sub(1,3) == "key" then
|
|
|
|
h("key",tT[cT][3].sI,tonumber(msg:sub(4)),0)
|
|
|
|
elseif msg == "exit" then pcall(killsession,sI) break
|
|
|
|
end
|
|
|
|
end
|
|
|
|
elseif ev[1] == "display" and ev[3] == tT[cT][3].sI then
|
|
|
|
ns(cA,evPP,"dis"..tostring(ev[2]))
|
|
|
|
end
|
|
|
|
C.yield()
|
|
|
|
end
|
|
|
|
end,{["sI"]=sI})
|
|
|
|
end
|
|
|
|
|
2017-06-20 04:36:55 +10:00
|
|
|
function nshds(P,pW)
|
|
|
|
s("nshds",function()
|
2017-06-19 23:21:13 +10:00
|
|
|
local Cc=1
|
|
|
|
while true do
|
|
|
|
if ev[1] == "net_msg" and ev[3] == P then
|
|
|
|
if ev[4] == "initnsh" then
|
|
|
|
nnID="nsh-"..tostring(Cc)
|
|
|
|
Cc=Cc+1
|
|
|
|
ns(ev[2],P,nnID)
|
2017-06-20 04:36:55 +10:00
|
|
|
nshds_w(nnID,ev[2],nnID,pW)
|
|
|
|
print("[nshds]Spawned "..nnID.." for "..tostring(ev[2]))
|
2017-06-19 23:21:13 +10:00
|
|
|
end
|
|
|
|
end
|
|
|
|
C.yield()
|
|
|
|
end
|
|
|
|
end,{["sI"]="log"})
|
|
|
|
end
|