diff --git a/botcmds.lua b/botcmds.lua index ec888ea..277e031 100644 --- a/botcmds.lua +++ b/botcmds.lua @@ -51,8 +51,7 @@ function irc.bot_command(msg, text) return end minetest.chat_send_player(player_to, - minetest.colorize(irc.config.pm_color, - "PM from "..msg.user.nick.."@IRC: "..message, false)) + "PM from "..msg.user.nick.."@IRC: "..message, false) irc.reply("Message sent!") return end @@ -138,7 +137,7 @@ irc.register_bot_command("whereis", { if not player then return false, "There is no player named '"..args.."'" end - local fmt = "Player %s is at (%.2f,%.2f,%.2f)" + local fmt = "Player %s is at [CENSORED]" local pos = player:getpos() return true, fmt:format(args, pos.x, pos.y, pos.z) end diff --git a/config.lua b/config.lua index 9a5c1fc..1a5157e 100644 --- a/config.lua +++ b/config.lua @@ -65,5 +65,4 @@ setting("bool", "debug", false) -- Enable debug output setting("bool", "enable_player_part", true) -- Whether to enable players joining and parting the channel setting("bool", "auto_join", true) -- Whether to automatically show players in the channel when they join setting("bool", "auto_connect", true) -- Whether to automatically connect to the server on mod load -setting("string", "chat_color", "#339933") -- Color of IRC chat in-game, green by default -setting("string", "pm_color", "#8800AA") -- Color of IRC PMs in-game, purple by default + diff --git a/hooks.lua b/hooks.lua index 0ac3597..d902ca6 100644 --- a/hooks.lua +++ b/hooks.lua @@ -86,7 +86,7 @@ function irc.hooks.ctcp(msg) if command == "ACTION" and msg.args[1] == irc.config.channel then local action = text:sub(8, -1) - irc.sendLocal(("* %s@IRC %s"):format(msg.user.nick, action)) + irc.sendLocal(("* %s@xeroxIRC %s"):format(msg.user.nick, action)) elseif command == "VERSION" then reply(("Minetest version %s, IRC mod version %s.") :format(get_core_version(), irc.version)) @@ -106,7 +106,9 @@ function irc.hooks.channelChat(msg) -- Don't let a user impersonate someone else by using the nick "IRC" local fake = msg.user.nick:lower():match("^[il|]rc$") if fake then - irc.sendLocal("<"..msg.user.nick.."@IRC> "..text) + irc.sendLocal("<"..msg.user.nick.."@xeroxIRC> "..text) + return + elseif msg.user.nick == "BlockyRelay" then return end @@ -138,7 +140,7 @@ function irc.hooks.channelChat(msg) irc.sendLocal(("* %s@%s %s") :format(actionnick, msg.user.nick, actionmessage)) else - irc.sendLocal(("<%s@IRC> %s"):format(msg.user.nick, text)) + irc.sendLocal(("<%s@xeroxIRC> %s"):format(msg.user.nick, text)) end end @@ -156,10 +158,10 @@ end function irc.hooks.kick(channel, target, prefix, reason) if target == irc.conn.nick then - minetest.chat_send_all("IRC: kicked from "..channel.." by "..prefix.nick..".") + minetest.chat_send_all("IRC: kicked from "..channel.." (xeroxIRC) by "..prefix.nick..".") irc.disconnect("Kicked") else - irc.sendLocal(("-!- %s was kicked from %s by %s [%s]") + irc.sendLocal(("-!- %s was kicked from %s (xeroxIRC) by %s [%s]") :format(target, channel, prefix.nick, reason)) end end @@ -167,7 +169,7 @@ end function irc.hooks.notice(user, target, message) if user.nick and target == irc.config.channel then - irc.sendLocal("-"..user.nick.."@IRC- "..message) + irc.sendLocal("-"..user.nick.."@xeroxIRC- "..message) end end @@ -194,20 +196,20 @@ end function irc.hooks.join(user, channel) - irc.sendLocal(("-!- %s joined %s") + irc.sendLocal(("-!- %s joined %s (xeroxIRC)") :format(user.nick, channel)) end function irc.hooks.part(user, channel, reason) reason = reason or "" - irc.sendLocal(("-!- %s has left %s [%s]") + irc.sendLocal(("-!- %s has left %s (xeroxIRC) [%s]") :format(user.nick, channel, reason)) end function irc.hooks.quit(user, reason) - irc.sendLocal(("-!- %s has quit [%s]") + irc.sendLocal(("-!- %s has quit xeroxIRC [%s]") :format(user.nick, reason)) end diff --git a/init.lua b/init.lua index 62d8fdd..3923ca8 100644 --- a/init.lua +++ b/init.lua @@ -23,17 +23,12 @@ ie.package.path = -- /usr/local/share and /usr/local/lib but LuaSocket is often installed under -- /usr/share and /usr/lib. if not rawget(_G, "jit") and package.config:sub(1, 1) == "/" then - ie.package.path = ie.package.path.. ";/usr/share/lua/5.1/?.lua".. ";/usr/share/lua/5.1/?/init.lua" - ie.package.cpath = ie.package.cpath.. ";/usr/lib/lua/5.1/?.so" - ie.package.cpath = "/usr/lib/x86_64-linux-gnu/lua/5.1/?.so;"..ie.package.cpath - - end -- Temporarily set require so that LuaIRC can access it diff --git a/messages.lua b/messages.lua index 52b1d4c..83e4f7f 100644 --- a/messages.lua +++ b/messages.lua @@ -8,7 +8,7 @@ function irc.logChat(message) end function irc.sendLocal(message) - minetest.chat_send_all(minetest.colorize(irc.config.chat_color, message)) + minetest.chat_send_all(message) irc.logChat(message) end diff --git a/player_part.lua b/player_part.lua index 0e7b1c6..e703316 100644 --- a/player_part.lua +++ b/player_part.lua @@ -13,8 +13,6 @@ end function irc.player_join(name) if irc.joined_players[name] then return false, "You are already in the channel" - elseif not minetest.get_player_by_name(name) then - return false, "You need to be in-game to join the channel" end irc.joined_players[name] = true return true, "You joined the channel" @@ -65,8 +63,7 @@ end) function irc.sendLocal(message) for name, _ in pairs(irc.joined_players) do - minetest.chat_send_player(name, - minetest.colorize(irc.config.chat_color, message)) + minetest.chat_send_player(name, message) end irc.logChat(message) end