forked from minetest-mods/irc
		
	Merge branch 'master' of yunohost.local:minetest-mods/irc into nalc-1.2-dev
This commit is contained in:
		@@ -139,7 +139,7 @@ irc.register_bot_command("whereis", {
 | 
			
		||||
			return false, "There is no player named '"..args.."'"
 | 
			
		||||
		end
 | 
			
		||||
		local fmt = "Player %s is at (%.2f,%.2f,%.2f)"
 | 
			
		||||
		local pos = player:getpos()
 | 
			
		||||
		local pos = player:get_pos()
 | 
			
		||||
		return true, fmt:format(args, pos.x, pos.y, pos.z)
 | 
			
		||||
	end
 | 
			
		||||
})
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										10
									
								
								config.lua
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								config.lua
									
									
									
									
									
								
							@@ -7,7 +7,6 @@ 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
 | 
			
		||||
@@ -15,15 +14,6 @@ local function setting(stype, name, default, required)
 | 
			
		||||
		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
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +0,0 @@
 | 
			
		||||
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.
 | 
			
		||||
@@ -120,6 +120,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]+) (.*)$")
 | 
			
		||||
 | 
			
		||||
@@ -134,6 +136,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))
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										6
									
								
								init.lua
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								init.lua
									
									
									
									
									
								
							@@ -29,7 +29,8 @@ if not rawget(_G, "jit") and package.config:sub(1, 1) == "/" then
 | 
			
		||||
			";/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
 | 
			
		||||
 | 
			
		||||
@@ -110,7 +111,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
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user