Join and leave messages in the irc added.

This commit is contained in:
acmgit 2022-02-08 19:50:03 +01:00
parent 2cca98d963
commit 89de59e811
3 changed files with 40 additions and 11 deletions

View File

@ -1,4 +1,6 @@
local sc = smart_chat
local S = sc.S
sc.crlf = "\r\n"
minetest.register_on_chat_message(function(player, message)
@ -17,24 +19,25 @@ minetest.register_on_chat_message(function(player, message)
end) -- register_on_chatmessage()
minetest.register_on_joinplayer(function(player)
local playername = player:get_player_name()
local line = S("joins the World")
local message = S("joins the World") .. "."
playername = playername or S("unknown")
sc.send_2_irc(playername, message)
sc.player[playername] = nil -- the public Chat
sc.public[playername] = nil
sc.send_2_irc(playername, "*** " .. line .. ".")
end) -- register_on_joinplayer()
minetest.register_on_leaveplayer(function(player)
local playername = player:get_player_name()
local line = S("leaves the World")
local playername = player:get_player_name() or S("unknown")
local line = S("leaves the World") .. "."
sc.player[playername] = nil
sc.public[playername] = nil
sc.send_2_irc(playername, "*** " .. line .. ".")
end) -- minetest.register_on_leaveplayer

View File

@ -3,8 +3,12 @@
### cmd_all.lua ###
Error - require 'basic_privs' privilege.=Fehler - 'basic_privs' benötigt.
Error: No Message given.=Fehler: Keine Nachricht angebeben.
### cmd_all.lua ###
### cmd_talk2public.lua ###
Error - require 'basic_privs' privilege.=Fehler - 'basic_privs' benötigt.
Send's a message on all.=Sendet eine Nachricht an alle.
### cmd_channels.lua ###
@ -136,9 +140,13 @@ Error: You can't set the public Chat as permanent.=Fehler: Du kannst den öffent
Marks a channel permanent.=Markiert einen Kanal als permanent.
] as permanent.=] als permanent.
### cmd_talk2public.lua ###
You're already in the public channel.=Du bist schon im öffentlichem Kanal.
### cmd_template.lua ###
Template Command with Parameter <=Musterkommando mit Parameter
Template Command with Parameter <=Musterkommando mit Parameter <
### cmd_toggle.lua ###
@ -156,6 +164,11 @@ Show's the room, where <name> is.=Zeigt den Raum, wo sich <Name> aufhält.
] is in Channel {=] ist im Kanal {
] is in the public Chat.=] ist im öffentlichem Chat.
### core.lua ###
joins the World=betritt die Welt.
leaves the World=verlässt die Welt.
### init.lua ###
Can manage Chatchannels.=Kann Chatkanäle verwalten.

View File

@ -3,8 +3,12 @@
### cmd_all.lua ###
Error - require 'basic_privs' privilege.=
Error: No Message given.=
### cmd_all.lua ###
### cmd_talk2public.lua ###
Error - require 'basic_privs' privilege.=
Send's a message on all.=
### cmd_channels.lua ###
@ -136,6 +140,10 @@ Error: You can't set the public Chat as permanent.=
Marks a channel permanent.=
] as permanent.=
### cmd_talk2public.lua ###
You're already in the public channel.=
### cmd_template.lua ###
Template Command with Parameter <=
@ -156,6 +164,11 @@ Show's the room, where <name> is.=
] is in Channel {=
] is in the public Chat.=
### core.lua ###
joins the World=
leaves the World=
### init.lua ###
Can manage Chatchannels.=