mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-01-05 23:10:30 +00:00
Update Checks
This commit is contained in:
parent
e9cea7d0f5
commit
4f9de6b02c
@ -106,16 +106,16 @@ function broadcast( message, sProtocol )
|
|||||||
end
|
end
|
||||||
|
|
||||||
function receive( sProtocolFilter, nTimeout )
|
function receive( sProtocolFilter, nTimeout )
|
||||||
|
-- The parameters used to be ( nTimeout ), detect this case for backwards compatibility
|
||||||
|
if type(sProtocolFilter) == "number" and nTimeout == nil then
|
||||||
|
sProtocolFilter, nTimeout = nil, sProtocolFilter
|
||||||
|
end
|
||||||
if sProtocolFilter ~= nil and type( sProtocolFilter ) ~= "string" then
|
if sProtocolFilter ~= nil and type( sProtocolFilter ) ~= "string" then
|
||||||
error( "bad argument #1 (expected string, got " .. type( sProtocolFilter ) .. ")", 2 )
|
error( "bad argument #1 (expected string, got " .. type( sProtocolFilter ) .. ")", 2 )
|
||||||
end
|
end
|
||||||
if nTimeout ~= nil and type( nTimeoutl ) ~= "number" then
|
if nTimeout ~= nil and type( nTimeoutl ) ~= "number" then
|
||||||
error( "bad argument #2 (expected number, got " .. type( nTimeout ) .. ")", 2 )
|
error( "bad argument #2 (expected number, got " .. type( nTimeout ) .. ")", 2 )
|
||||||
end
|
end
|
||||||
-- The parameters used to be ( nTimeout ), detect this case for backwards compatibility
|
|
||||||
if type(sProtocolFilter) == "number" and nTimeout == nil then
|
|
||||||
sProtocolFilter, nTimeout = nil, sProtocolFilter
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Start the timer
|
-- Start the timer
|
||||||
local timer = nil
|
local timer = nil
|
||||||
@ -174,7 +174,7 @@ function lookup( sProtocol, sHostname )
|
|||||||
if type( sProtocol ) ~= "string" then
|
if type( sProtocol ) ~= "string" then
|
||||||
error( "bad argument #1 (expected string, got " .. type( sProtocol ) .. ")", 2 )
|
error( "bad argument #1 (expected string, got " .. type( sProtocol ) .. ")", 2 )
|
||||||
end
|
end
|
||||||
if type( sHostname ) ~= "string" then
|
if sHostname ~= nil and type( sHostname ) ~= "string" then
|
||||||
error( "bad argument #2 (expected string, got " .. type( sHostname ) .. ")", 2 )
|
error( "bad argument #2 (expected string, got " .. type( sHostname ) .. ")", 2 )
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user