2017-05-21 20:19:53 +10:00
|
|
|
function nshc_w(evPP,nid)
|
2017-04-20 19:03:06 +10:00
|
|
|
while true do
|
|
|
|
if ev[1] == "net_msg" then
|
2017-04-23 19:05:16 +10:00
|
|
|
local V,msg=false,tostring(ev[4])
|
2017-04-20 19:03:06 +10:00
|
|
|
if ev[3] == evPP and ev[2] == nid then
|
|
|
|
if msg:sub(1,3) == "dis" then
|
2017-05-20 06:55:11 +10:00
|
|
|
write(msg:sub(4))
|
2017-04-20 19:03:06 +10:00
|
|
|
end
|
|
|
|
end
|
2017-05-24 00:48:26 +10:00
|
|
|
elseif ev[1] == "key" and ev[2] == E().sI and ev[3] == 29 and ev[4] == 27 then
|
|
|
|
break
|
|
|
|
elseif ev[1] == "key" and ev[2] == E().sI then
|
2017-04-20 19:03:06 +10:00
|
|
|
ns(nid,evPP,"key"..tostring(ev[3]))
|
|
|
|
end
|
|
|
|
C.yield()
|
|
|
|
end
|
2017-05-24 00:48:26 +10:00
|
|
|
ns(nid,evPP,"exit")
|
2017-04-20 19:03:06 +10:00
|
|
|
end
|
2017-05-21 20:19:53 +10:00
|
|
|
|
|
|
|
function nshc(P,nid)
|
|
|
|
ns(nid,P,"initnsh")
|
|
|
|
while true do
|
|
|
|
if ev[1] == "net_msg" and ev[2] == nid and ev[3] == P then
|
2017-05-24 00:48:26 +10:00
|
|
|
break
|
2017-05-21 20:19:53 +10:00
|
|
|
end
|
|
|
|
C.yield()
|
|
|
|
end
|
2017-05-24 00:48:26 +10:00
|
|
|
nshc_w(ev[4],nid)
|
2017-05-21 20:19:53 +10:00
|
|
|
end
|