OC-MultICE/modules/net/ping.lua

14 lines
267 B
Lua
Raw Normal View History

2017-05-04 17:06:54 +10:00
s("pingd",function()
while true do
if ev[1] == "net_msg" then
if ev[3] == "ping" then
print("ping ("..ev[2].."): "..ev[4])
ns(ev[2],"pong",ev[4])
elseif ev[3] == "pong" then
print("pong ("..ev[2].."): "..ev[4])
end
end
C.yield()
end
end)