mirror of
https://github.com/zenith391/OCEmu.git
synced 2025-09-29 07:53:29 -04:00
clean up debug output for modem
This commit is contained in:
parent
71e5adabd0
commit
49e5b8492f
@ -57,7 +57,6 @@ function modem_host.createPacketArray(packetType, address, port, ...)
|
|||||||
...
|
...
|
||||||
}
|
}
|
||||||
|
|
||||||
cerror("resultant packed", packed)
|
|
||||||
return packed
|
return packed
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -124,7 +123,7 @@ end
|
|||||||
|
|
||||||
function modem_host.readDatagram(client) -- client:receive()
|
function modem_host.readDatagram(client) -- client:receive()
|
||||||
local raw, err = client:receive()
|
local raw, err = client:receive()
|
||||||
if raw then cerror("received: " .. raw) end
|
if raw then cerror("readDatagram", raw) end
|
||||||
return raw, err
|
return raw, err
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -141,7 +140,7 @@ function modem_host.readPacket(client) -- client:receive()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function modem_host.sendDatagram(client, datagram)
|
function modem_host.sendDatagram(client, datagram)
|
||||||
cerror("sending: " .. datagram)
|
cerror("sendDatagram", datagram)
|
||||||
return client:send(datagram)
|
return client:send(datagram)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -503,25 +502,4 @@ local function containsValue(t, v)
|
|||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
-- print all function calls
|
|
||||||
local function logAll(t, ...)
|
|
||||||
local ignores = table.pack(...)
|
|
||||||
for k,v in pairs(t) do
|
|
||||||
if (type(v) == "function") and not containsValue(ignores, k) then
|
|
||||||
t[k] = function(...)
|
|
||||||
cerror(k, ...)
|
|
||||||
return v(...)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
logAll(obj)
|
|
||||||
logAll(modem_host,
|
|
||||||
"processPendingMessages",
|
|
||||||
"recvPendingMessages",
|
|
||||||
"readDatagram",
|
|
||||||
"readPacket",
|
|
||||||
"readPacketArray")
|
|
||||||
|
|
||||||
return obj,cec,doc
|
return obj,cec,doc
|
||||||
|
Loading…
x
Reference in New Issue
Block a user