2017-05-21 20:19:53 +10:00
|
|
|
function nshd_w(evPP,cA,sI)
|
|
|
|
s("netsh daemon - "..tostring(sI),function() print(pcall(function()
|
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-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-20 06:55:11 +10:00
|
|
|
end)) end,{["sI"]=sI})
|
2017-05-21 20:19:53 +10:00
|
|
|
end
|
|
|
|
|
|
|
|
function nshd(P)
|
|
|
|
s("nshd",function() print(pcall(function()
|
|
|
|
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)
|
|
|
|
luash({["sI"]=nnID})
|
|
|
|
print("[nshd]Spawned "..nnID.." for "..tostring(ev[2]))
|
|
|
|
end
|
|
|
|
end
|
|
|
|
C.yield()
|
|
|
|
end end))
|
|
|
|
end,{["sI"]="log"})
|
2017-05-20 06:55:11 +10:00
|
|
|
end
|