1 #!/usr/bin/env hydra-dragonfire
2 local escapes = require("escapes")
3 local base64 = require("base64")
4 local client = require("client")()
7 client.pkts:wildcard(true)
11 local function dump(val, indent)
13 local mt = getmetatable(val)
15 if t ~= "table" or mt and mt.__tostring then
17 val = val:gsub("\n", "\\n")
23 local idt = (indent or "") .. " "
24 for k, v in pairs(val) do
25 io.write(idt .. k .. " ")
32 local evt = client:poll()
34 if not evt or evt.type == "disconnect" or evt.type == "interrupt" then
36 elseif evt.type == "error" then
38 elseif evt.type == "pkt" then
39 local type, data = evt.pkt_type, evt.pkt_data
41 if type == "srp_bytes_salt_b" then
42 data.b = base64.encode(data.b)
43 data.salt = base64.encode(data.salt)
46 if type == "chat_msg" then
47 data.text = escapes.strip_all(data.text)
50 if type == "blk_data" then