Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/minetest-mods/irc into HEAD
Browse files Browse the repository at this point in the history
  • Loading branch information
fluxionary committed Nov 23, 2019
2 parents d89ead1 + 5e36597 commit 8f8aecf
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 18 deletions.
4 changes: 2 additions & 2 deletions botcmds.lua
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ irc.register_bot_command("whereis", {
if not player then
return false, "There is no player named '"..args.."'"
end
local fmt = "Player %s is at [CENSORED]"
local pos = player:getpos()
local fmt = "Player %s is at (%.2f,%.2f,%.2f)"
local pos = player:get_pos()
return true, fmt:format(args, pos.x, pos.y, pos.z)
end
})
Expand Down
10 changes: 0 additions & 10 deletions config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,13 @@ irc.config = {}
local function setting(stype, name, default, required)
local value
if minetest.settings and minetest.settings.get and minetest.settings.get_bool then
-- The current methods for getting settings
if stype == "bool" then
value = minetest.settings:get_bool("irc."..name)
elseif stype == "string" then
value = minetest.settings:get("irc."..name)
elseif stype == "number" then
value = tonumber(minetest.settings:get("irc."..name))
end
else
-- The old methods for getting settings for backward compatibility. Deprecated on 0.4.16+
if stype == "bool" then
value = minetest.setting_getbool("irc."..name)
elseif stype == "string" then
value = minetest.setting_get("irc."..name)
elseif stype == "number" then
value = tonumber(minetest.setting_get("irc."..name))
end
end
if value == nil then
if required then
Expand Down
4 changes: 0 additions & 4 deletions description.txt

This file was deleted.

5 changes: 5 additions & 0 deletions hooks.lua
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ function irc.hooks.channelChat(msg)
text:find("^%*%*%* ([^%s]+) joined the game$")
local foundleave, _, leavenick =
text:find("^%*%*%* ([^%s]+) left the game$")
local foundtimedout, _, timedoutnick =
text:find("^%*%*%* ([^%s]+) left the game %(Timed out%)$")
local foundaction, _, actionnick, actionmessage =
text:find("^%* ([^%s]+) (.*)$")

Expand All @@ -136,6 +138,9 @@ function irc.hooks.channelChat(msg)
elseif foundleave then
irc.sendLocal(("*** %s left %s")
:format(leavenick, msg.user.nick))
elseif foundtimedout then
irc.sendLocal(("*** %s left %s (Timed out)")
:format(timedoutnick, msg.user.nick))
elseif foundaction then
irc.sendLocal(("* %s@%s %s")
:format(actionnick, msg.user.nick, actionmessage))
Expand Down
7 changes: 5 additions & 2 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ if not rawget(_G, "jit") and package.config:sub(1, 1) == "/" then
";/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"
";/usr/lib/lua/5.1/?.so"..
";/usr/lib64/lua/5.1/?.so"

ie.package.cpath = "/usr/lib/x86_64-linux-gnu/lua/5.1/?.so;"..ie.package.cpath
end

Expand Down Expand Up @@ -105,7 +107,8 @@ end

minetest.register_privilege("irc_admin", {
description = "Allow IRC administrative tasks to be performed.",
give_to_singleplayer = true
give_to_singleplayer = true,
give_to_admin = true,
})

local stepnum = 0
Expand Down
4 changes: 4 additions & 0 deletions mod.conf
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
name = irc
description = """
This mod is just a glue between IRC and Minetest.
It provides two-way communication between the in-game chat, and an arbitrary IRC channel.
"""

0 comments on commit 8f8aecf

Please sign in to comment.