2017-05-21 20:19:53 +10:00
|
|
|
function nshd_w(evPP,cA,sI)
|
2017-06-16 22:29:47 +10:00
|
|
|
s("nshd - "..tostring(sI),function()
|
2017-06-19 23:19:29 +10:00
|
|
|
luash({["sI"]=sI})
|
2017-04-20 19:03:06 +10:00
|
|
|
while true do
|
|
|
|
if ev[1] == "net_msg" then
|
2017-05-21 20:19:53 +10:00
|
|
|
local msg=tostring(ev[4])
|
|
|
|
if ev[3] == evPP and ev[2] == cA then
|
2017-04-20 19:03:06 +10:00
|
|
|
if msg:sub(1,3) == "key" then
|
2017-05-20 06:55:11 +10:00
|
|
|
h("key",tT[cT][3].sI,tonumber(msg:sub(4)),0)
|
2017-05-25 08:36:47 +10:00
|
|
|
elseif msg == "exit" then pcall(killsession,sI) break
|
2017-04-20 19:03:06 +10:00
|
|
|
end
|
|
|
|
end
|
2017-05-20 06:55:11 +10:00
|
|
|
elseif ev[1] == "display" and ev[3] == tT[cT][3].sI then
|
2017-05-21 20:19:53 +10:00
|
|
|
ns(cA,evPP,"dis"..tostring(ev[2]))
|
2017-04-20 19:03:06 +10:00
|
|
|
end
|
|
|
|
C.yield()
|
|
|
|
end
|
2017-05-25 08:36:47 +10:00
|
|
|
end,{["sI"]=sI})
|
2017-05-21 20:19:53 +10:00
|
|
|
end
|
|
|
|
|
|
|
|
function nshd(P)
|
2017-05-25 08:36:47 +10:00
|
|
|
s("nshd",function()
|
2017-05-21 20:19:53 +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)
|
|
|
|
nshd_w(nnID,ev[2],nnID)
|
|
|
|
print("[nshd]Spawned "..nnID.." for "..tostring(ev[2]))
|
|
|
|
end
|
|
|
|
end
|
|
|
|
C.yield()
|
2017-05-25 08:36:47 +10:00
|
|
|
end
|
2017-05-21 20:19:53 +10:00
|
|
|
end,{["sI"]="log"})
|
2017-05-20 06:55:11 +10:00
|
|
|
end
|