Unsure if I want to keep this, but, IRC server admin announcements.
This commit is contained in:
parent
702639ea56
commit
04a76fc0c7
@ -29,3 +29,27 @@ function announce.all(msg)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function announce.player(name, msg)
|
||||||
|
minetest.log("action", "announce to " .. name .. ": " .. msg)
|
||||||
|
minetest.chat_send_player(name, msg)
|
||||||
|
if irc and irc.joined_players[name] then
|
||||||
|
irc.whisper(name, msg)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function announce.admins(msg)
|
||||||
|
minetest.log("action", "admin announce: " .. msg)
|
||||||
|
if not irc then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local irclist = minetest.settings:get("announce_irc_admins")
|
||||||
|
if irclist == "" then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local admins = string.split(string.gsub(irclist, " ", ""), ",")
|
||||||
|
for _, name in pairs(admins) do
|
||||||
|
if irc.joined_players[name] then
|
||||||
|
irc.whisper(name, msg)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
@ -160,6 +160,7 @@ function telex.deliver(message)
|
|||||||
table.insert(spool, message)
|
table.insert(spool, message)
|
||||||
S:set_string("telex_spool", telex.encode(spool))
|
S:set_string("telex_spool", telex.encode(spool))
|
||||||
minetest.log("action", "spooled a message from <" .. message.from .. "> to <" .. message.to .. ">")
|
minetest.log("action", "spooled a message from <" .. message.from .. "> to <" .. message.to .. ">")
|
||||||
|
announce.admins("spooled a message from <" .. message.from .. "> to <" .. message.to .. ">")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -168,6 +169,7 @@ function telex.retour(message)
|
|||||||
if message.from == "MAILER-DEAMON" then
|
if message.from == "MAILER-DEAMON" then
|
||||||
-- discard, we tried hard enough!
|
-- discard, we tried hard enough!
|
||||||
minetest.log("action", "discarded an expired spool message from <" .. message.from .. "> to <" .. message.to .. ">")
|
minetest.log("action", "discarded an expired spool message from <" .. message.from .. "> to <" .. message.to .. ">")
|
||||||
|
announce.admins("discarded an expired spool message from <" .. message.from .. "> to <" .. message.to .. ">")
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -181,6 +183,7 @@ function telex.retour(message)
|
|||||||
table.insert(message.content, 2, "================== ORIGINAL MESSAGE BELOW ================")
|
table.insert(message.content, 2, "================== ORIGINAL MESSAGE BELOW ================")
|
||||||
telex.deliver(message)
|
telex.deliver(message)
|
||||||
minetest.log("action", "returned a message from <" .. from .. "> back to <" .. to .. ">")
|
minetest.log("action", "returned a message from <" .. from .. "> back to <" .. to .. ">")
|
||||||
|
announce.admins("returned a message from <" .. from .. "> back to <" .. to .. ">")
|
||||||
end
|
end
|
||||||
|
|
||||||
-- returns message/mbox
|
-- returns message/mbox
|
||||||
|
@ -249,4 +249,6 @@ tutorial_entry_lobby = <id> -- tutorial entry lobby box_id
|
|||||||
tutorial_exit_lobby = <id> -- tutorial exit lobby box_id
|
tutorial_exit_lobby = <id> -- tutorial exit lobby box_id
|
||||||
tutorial_exit = (<x>,<y>,<z>) -- where to teleport player at end of tutorial
|
tutorial_exit = (<x>,<y>,<z>) -- where to teleport player at end of tutorial
|
||||||
|
|
||||||
|
announce_irc_admins = "john,frank" -- no spaces, lists irc names that will receive admin announcements
|
||||||
|
|
||||||
```
|
```
|
||||||
|
Loading…
x
Reference in New Issue
Block a user