mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2025-01-24 08:50:21 +01:00
[chatplus] Unlock the chatcommand callbacks by tweaking the api
- For #343
This commit is contained in:
parent
faa6a045a4
commit
2a39d7cbfd
@ -189,7 +189,7 @@ function chatplus.send(from, msg)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Loop through possible receivers
|
-- Loop through possible receivers
|
||||||
for to, value in pairs(chatplus.loggedin) do
|
for to, value in pairs(minetest.get_connected_players()) do
|
||||||
if to ~= from then
|
if to ~= from then
|
||||||
-- Run handlers
|
-- Run handlers
|
||||||
local res = nil
|
local res = nil
|
||||||
@ -203,24 +203,19 @@ function chatplus.send(from, msg)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Send message
|
--[[ DON'T Send message
|
||||||
if res == nil or res == true then
|
if res == nil or res == true then
|
||||||
minetest.chat_send_player(to, "<" .. from .. "> " .. msg)
|
minetest.chat_send_player(to, "<" .. from .. "> " .. msg)
|
||||||
end
|
end]]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
-- Minetest callbacks
|
-- Minetest callbacks (modified for MFF)
|
||||||
minetest.register_on_chat_message(function(...)
|
minetest.register_on_chat_message(chatplus.send)
|
||||||
local ret = chatplus.send(...)
|
|
||||||
if ret and minetest.global_exists("irc") and irc.on_chatmessage then
|
|
||||||
irc.on_chatmessage(...)
|
|
||||||
end
|
|
||||||
return ret
|
|
||||||
end)
|
|
||||||
minetest.register_on_joinplayer(function(player)
|
minetest.register_on_joinplayer(function(player)
|
||||||
chatplus.log(player:get_player_name() .. " joined")
|
chatplus.log(player:get_player_name() .. " joined")
|
||||||
end)
|
end)
|
||||||
|
Loading…
Reference in New Issue
Block a user