Added IRC support, since it didn't even show up with this mod and a rank
This commit is contained in:
parent
a597520a74
commit
ece7c857f7
@ -1 +0,0 @@
|
||||
chat3?
|
@ -1 +0,0 @@
|
||||
Ranks is an advanced ranks mod geared towards larger servers helps to both distiguish between players and make managing privileges much easier. With several ranks premade and a simplistic API, ranks is a good addition to any server, especially those with many players.
|
15
init.lua
15
init.lua
@ -3,6 +3,7 @@
|
||||
ranks = {}
|
||||
|
||||
local chat3_exists = minetest.get_modpath("chat3")
|
||||
local irc_exists = minetest.get_modpath("irc")
|
||||
local registered = {}
|
||||
local default
|
||||
|
||||
@ -235,6 +236,20 @@ function ranks.chat_send(name, message)
|
||||
if chat3_exists then
|
||||
chat3.send(name, message, prefix.." ", "ranks")
|
||||
else
|
||||
if irc_exists then
|
||||
if not irc.connected
|
||||
or message:sub(1, 1) == "/"
|
||||
or message:sub(1, 5) == "[off]"
|
||||
or not irc.joined_players[name]
|
||||
or (not minetest.check_player_privs(name, {shout=true})) then
|
||||
return
|
||||
end
|
||||
local nl = message:find("\n", 1, true)
|
||||
if nl then
|
||||
message = message:sub(1, nl - 1)
|
||||
end
|
||||
irc.say(irc.playerMessage(name, minetest.strip_colors("[" .. prefix .. "] " .. message)))
|
||||
end
|
||||
minetest.chat_send_all(prefix.." <"..name.."> "..message)
|
||||
minetest.log("action", "CHAT: ".."<"..name.."> "..message)
|
||||
end
|
||||
|
2
mod.conf
2
mod.conf
@ -1 +1,3 @@
|
||||
name = ranks
|
||||
description = Ranks is an advanced ranks mod geared towards larger servers helps to both distiguish between players and make managing privileges much easier. With several ranks premade and a simplistic API, ranks is a good addition to any server, especially those with many players.
|
||||
options_depends = chat3, irc
|
||||
|
Loading…
x
Reference in New Issue
Block a user