CNetChan
GetAddress
local chan = game.engine:GetNetChan();
if chan and not chan:IsNull() then
print(chan:GetAddress());
endIsLoopback
IsNull
GetLatency
Last updated
local chan = game.engine:GetNetChan();
if chan and not chan:IsNull() then
print(chan:GetAddress());
endLast updated
local chan = game.engine:GetNetChan();
if chan and not chan:IsNull() and chan:IsLoopback() then
print('Connected to localhost!');
endlocal chan = game.engine:GetNetChan();
if not chan or chan:IsNull() then
print('Not connected!');
endlocal chan = game.engine:GetNetChan();
if chan and not chan:IsNull() then
print('Current latency: ' .. tostring(math.round(chan:GetLatency() * 1000.0)) .. 'ms');
end