Make Lua code great again
This commit is contained in:
parent
3b3cf82a75
commit
aceeb3f4c9
|
@ -27,9 +27,9 @@ end
|
||||||
|
|
||||||
function MPD:on_data (data)
|
function MPD:on_data (data)
|
||||||
self.buf = self.buf .. data
|
self.buf = self.buf .. data
|
||||||
local line = string.match (self.buf, "([^\n]*)\n")
|
local line = self.buf:match ("([^\n]*)\n")
|
||||||
if line then
|
if line then
|
||||||
local version = string.match (line, "OK MPD (.*)")
|
local version = line:match ("OK MPD (.*)")
|
||||||
if version then
|
if version then
|
||||||
self.unit:add_info ("version " .. version)
|
self.unit:add_info ("version " .. version)
|
||||||
self.unit:set_success (true)
|
self.unit:set_success (true)
|
||||||
|
@ -38,8 +38,8 @@ function MPD:on_data (data)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
ponymap.register_service ({
|
ponymap.register_service {
|
||||||
name = "MPD",
|
name = "MPD",
|
||||||
flags = 0,
|
flags = 0,
|
||||||
new_scan = MPD.new
|
new_scan = MPD.new
|
||||||
})
|
}
|
||||||
|
|
|
@ -81,21 +81,21 @@ end
|
||||||
|
|
||||||
-- Register everything
|
-- Register everything
|
||||||
|
|
||||||
ponymap.register_service ({
|
ponymap.register_service {
|
||||||
name = "SOCKS4",
|
name = "SOCKS4",
|
||||||
flags = 0,
|
flags = 0,
|
||||||
new_scan = Socks4.new
|
new_scan = Socks4.new
|
||||||
})
|
}
|
||||||
|
|
||||||
-- At the moment this is nearly useless
|
-- At the moment this is nearly useless
|
||||||
-- ponymap.register_service ({
|
-- ponymap.register_service {
|
||||||
-- name = "SOCKS4A",
|
-- name = "SOCKS4A",
|
||||||
-- flags = 0,
|
-- flags = 0,
|
||||||
-- new_scan = Socks4A.new
|
-- new_scan = Socks4A.new
|
||||||
-- })
|
-- }
|
||||||
|
|
||||||
ponymap.register_service ({
|
ponymap.register_service {
|
||||||
name = "SOCKS5",
|
name = "SOCKS5",
|
||||||
flags = 0,
|
flags = 0,
|
||||||
new_scan = Socks5.new
|
new_scan = Socks5.new
|
||||||
})
|
}
|
||||||
|
|
Loading…
Reference in New Issue