1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2025-12-26 11:15:22 +01:00

Add an IRC mod wich works... (very rare, like Mithril...)

This commit is contained in:
BUISSON-DEBON Quentin
2015-08-19 01:24:48 +02:00
parent 8c637bac28
commit 43faf2b5bc
9 changed files with 27 additions and 61 deletions

View File

@@ -10,7 +10,7 @@ function irc:player_part(name)
self.joined_players[name] = nil
minetest.chat_send_player(name, "IRC: You are now out of the channel.")
end
function irc:player_join(name)
if self.joined_players[name] then
minetest.chat_send_player(name, "IRC: You are already in the channel.")
@@ -28,7 +28,7 @@ minetest.register_chatcommand("join", {
irc:player_join(name)
end
})
minetest.register_chatcommand("part", {
description = "Part the IRC channel",
privs = {shout=true},
@@ -36,7 +36,7 @@ minetest.register_chatcommand("part", {
irc:player_part(name)
end
})
minetest.register_chatcommand("who", {
description = "Tell who is currently on the channel",
privs = {},
@@ -49,13 +49,13 @@ minetest.register_chatcommand("who", {
end
})
minetest.register_on_joinplayer(function(player)
local name = player:get_player_name()
irc.joined_players[name] = irc.config.auto_join
end)
minetest.register_on_leaveplayer(function(player)
local name = player:get_player_name()
irc.joined_players[name] = nil