aboutsummaryrefslogtreecommitdiff
path: root/textures/base/pack/dirt_bg.png
blob: 7cb9c89a637584b4e53c82a7c6eb1ec7109befae (plain)
ofshex dumpascii
0000 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52 00 00 00 10 00 00 00 10 08 02 00 00 00 90 91 68 .PNG........IHDR...............h
0020 36 00 00 03 00 50 4c 54 45 00 00 00 ff 00 00 00 ff 00 ff ff 00 00 00 ff ff 00 ff 00 ff ff ff ff 6....PLTE.......................
0040 ff db db db b6 b6 b6 92 92 92 6d 6d 6d 49 49 49 24 24 24 db 00 00 b6 00 00 92 00 00 6d 00 00 49 ..........mmmIII$$$.........m..I
0060 00 00 24 00 00 00 db 00 00 b6 00 00 92 00 00 6d 00 00 49 00 00 24 00 db db 00 b6 b6 00 92 92 00 ..$............m..I..$..........
0080 6d 6d 00 49 49 00 24 24 00 00 00 db 00 00 b6 00 00 92 00 00 6d 00 00 49 00 00 24 db 00 db b6 00 mm.II.$$............m..I..$.....
00a0 b6 92 00 92 6d 00 6d 49 00 49 24 00 24 00 db db 00 b6 b6 00 92 92 00 6d 6d 00 49 49 00 24 24 ff ....m.mI.I$.$..........mm.II.$$.
00c0 db db db b6 b6 b6 92 92 92 6d 6d 6d 49 49 49 24 24 ff b6 b6 db 92 92 b6 6d 6d 92 49 49 6d 24 24 .........mmmIII$$.......mm.IIm$$
00e0 ff 92 92 db 6d 6d b6 49 49 92 24 24 ff 6d 6d db 49 49 b6 24 24 ff 49 49 db 24 24 ff 24 24 db ff ....mm.II.$$.mm.II.$$.II.$$.$$..
0100 db b6 db b6 92 b6 92 6d 92 6d 49 6d 49 24 49 24 b6 ff b6 92 db 92 6d b6 6d 49 92 49 24 6d 24 92 .......m.mImI$I$......m.mI.I$m$.
0120 ff 92 6d db 6d 49 b6 49 24 92 24 6d ff 6d 49 db 49 24 b6 24 49 ff 49 24 db 24 24 ff 24 db db ff ..m.mI.I$.$m.mI.I$.$I.I$.$$.$...
0140 b6 b6 db 92 92 b6 6d 6d 92 49 49 6d 24 24 49 b6 b6 ff 92 92 db 6d 6d b6 49 49 92 24 24 6d 92 92 ......mm.IIm$$I......mm.II.$$m..
0160 ff 6d 6d db 49 49 b6 24 24 92 6d 6d ff 49 49 db 24 24 b6 49 49 ff 24 24 db 24 24 ff ff ff db db .mm.II.$$.mm.II.$$.II.$$.$$.....
0180 db b6 b6 b6 92 92 92 6d 6d 6d 49 49 49 24 ff ff b6 db db 92 b6 b6 6d 92 92 49 6d 6d 24 ff ff 92 .......mmmIII$........m..Imm$...
01a0 db db 6d b6 b6 49 92 92 24 ff ff 6d db db 49 b6 b6 24 ff ff 49 db db 24 ff ff 24 ff db ff db b6 ..m..I..$..m..I..$..I..$..$.....
01c0 db b6 92 b6 92 6d 92 6d 49 6d 49 24 49 ff b6 ff db 92 db b6 6d b6 92 49 92 6d 24 6d ff 92 ff db .....m.mImI$I.......m..I.m$m....
01e0 6d db b6 49 b6 92 24 92 ff 6d ff db 49 db b6 24 b6 ff 49 ff db 24 db ff 24 ff db ff ff b6 db db m..I..$..m..I..$..I..$..$.......
0200 92 b6 b6 6d 92 92 49 6d 6d 24 49 49 b6 ff ff 92 db db 6d b6 b6 49 92 92 24 6d 6d 92 ff ff 6d db ...m..Imm$II......m..I..$mm...m.
0220 db 49 b6 b6 24 92 92 6d ff ff 49 db db 24 b6 b6 49 ff ff 24 db db 24 ff ff ff db b6 db b6 92 b6 .I..$..m..I..$..I..$..$.........
0240 92 6d 92 6d 49 6d 49 24 49 24 00 ff b6 92 db 92 6d b6 6d 49 92 49 24 6d 24 00 ff b6 db db 92 b6 .m.mImI$I$......m.mI.I$m$.......
0260 b6 6d 92 92 49 6d 6d 24 49 49 00 24 ff 92 b6 db 6d 92 b6 49 6d 92 24 49 6d 00 24 db b6 ff b6 92 .m..Imm$II.$....m..Im.$Im.$.....
0280 db 92 6d b6 6d 49 92 49 24 6d 24 00 49 b6 92 ff 92 6d db 6d 49 b6 49 24 92 24 00 6d b6 db ff 92 ..m.mI.I$m$.I....m.mI.I$.$.m....
02a0 b6 db 6d 92 b6 49 6d 92 24 49 6d 00 24 49 92 b6 ff 6d 92 db 49 6d b6 24 49 92 00 24 6d b6 ff db ..m..Im.$Im.$I...m..Im.$I..$m...
02c0 92 db b6 6d b6 92 49 92 6d 24 6d 49 00 49 24 92 ff b6 6d db 92 49 b6 6d 24 92 49 00 6d 24 db ff ...m..I.m$mI.I$...m..I.m$.I.m$..
02e0 b6 b6 db 92 92 b6 6d 6d 92 49 49 6d 24 24 49 00 b6 ff 92 92 db 6d 6d b6 49 49 92 24 24 6d 00 ff ......mm.IIm$$I......mm.II.$$m..
0300 b6 00 db 92 00 b6 6d 00 92 49 00 ff 00 b6 db 00 92 b6 00 6d 92 00 49 00 b6 ff 00 92 db 00 6d b6 ......m..I.........m..I.......m.
0320 00 49 92 00 00 00 00 00 00 cf 2a 02 04 00 00 02 ed 49 44 41 54 28 cf 05 c1 db 6e db 64 00 00 60 .I........*......IDAT(....n.d..`
0340 fb ff 63 27 76 1c e7 e8 26 ab dd 1c 9a 43 bb 1c 26 25 85 88 ae a8 20 41 06 88 8b 4d 08 6e 06 12 ..c'v...&....C..&%.....A...M.n..
0360 e2 b1 b8 41 e2 25 d8 24 2e 2a 98 34 c6 5a 60 24 6d ba 24 66 4d 9b c4 cd d1 76 5c 3b f1 39 7c 1f ...A.%.$.*.4.Z`$m.$fM....v\;.9|.
0380 fa f5 e7 71 0c 43 a7 92 93 c8 ce 70 81 5b db 4e 26 59 6b 5f 3f db 49 1f fa 43 03 a0 70 e1 94 af ...q.C.....p.[.N&Yk_?.I..C..p...
03a0 d5 ea 39 53 12 b5 de ad 91 18 3c 7a 2f 0f 5d 31 4f a3 21 ab 48 26 df 06 02 b4 bb 14 a3 ac 15 09 ..9S......<z/.]1O.!.H&..........
03c0 94 8c 29 75 33 e2 7d 91 18 97 39 b0 f4 cb 33 61 53 da 27 c1 c0 33 57 a7 9b a5 c3 d0 6c 2b 48 7c ..)u3.}...9...3aS.'..3W.....l+H|
03e0 77 3d 14 a9 cc 91 c7 fb d9 f3 ee 4b 6f 44 bb 59 4b fe b0 7f 75 c3 93 06 51 df af 5a 40 03 04 6f w=.........KoD.YK...u...Q..Z@..o
0400 df a2 a6 57 55 b4 40 4a 19 9d e4 2a 0f 55 55 65 f6 b8 06 67 8d c7 b7 df 34 2a 93 e6 f5 36 45 8f ...WU.@J...*.UUe...g....4*...6E.
0420 27 9b 7c 12 ed f3 00 e6 f6 55 b6 bc 7d d9 d5 82 1e 52 b9 18 ef a7 e2 6b f1 ef bf 9e 9f 8e 6d fc '.|......U..}....R.....k......m.
0440 2d b2 38 fd e5 8e 2a 55 88 a0 50 2a ee 3d 3b 7b b5 3b 03 30 cd 16 10 37 f4 f8 ab 1f 66 37 62 b8 -.8...*U..P*.=;{.;.0...7....f7b.
0460 da 13 64 1a b2 00 47 d8 9d 6c d6 1c 9b 5c 04 14 53 e8 8f 3f 77 8c c9 b2 f1 e9 d3 37 7a 13 7e ff ..d...G..l...\..S..?w......7z.~.
0480 e4 48 97 9b 0b 7b 03 ef fe 7c f3 0e 1b da 6b bb 6b 76 47 4a bb 23 48 b2 91 28 50 33 45 c3 1c f7 .H...{...|....k.kvGJ.#H..(P3E...
04a0 a3 c6 17 23 e9 77 36 c1 c0 62 34 ae 22 ce c9 1f bd 46 ad 7e d2 e9 e7 6c da eb 85 32 bc 2b 73 24 ...#.w6..b4."....F.~...l...2.+s$
04c0 13 42 36 4e 32 66 4a f7 8e eb a8 74 ba 98 48 bf bd e8 c1 6d 6c 75 2e 0c 58 3a fa b2 f9 df 97 8f .B6N2fJ....t..H....mlu..X:......
04e0 2a 1a 29 fb d3 44 15 62 fe a8 35 17 83 e7 17 a3 a7 9f d4 c6 83 d7 21 ec 81 c1 cf 61 dc 86 c7 d5 *.)..D.b..5...........!....a....
0500 34 12 5c 85 e9 98 ba 91 5a ff 68 fe 18 b8 3c 13 b6 bc 81 a1 0a c8 f2 f6 b1 cf f3 53 b3 b9 b7 93 4.\.....Z.h...<............S....
0520 b5 7d de 05 b8 cc 47 6b b0 94 64 a2 34 90 a7 20 e2 01 54 50 a6 5c bd 10 89 77 91 a1 b2 b2 fd c2 .}....Gk..d.4.....TP.\...w......
0540 8a 37 e4 ca c3 18 b1 00 93 e5 b8 c8 14 85 c9 15 8c 67 dd 1c c9 65 76 31 3c 26 ed 80 14 17 c9 b9 .7...............g...ev1<&......
0560 7d 9d 2b e7 34 d1 ae 1f d7 95 5e 8f f6 a9 6c e5 f0 0e d9 f4 87 c2 4a 30 e0 b7 1f df ff 77 c4 bf }.+.4.....^...l.......J0.....w..
0580 e8 cd 3f 84 1c 9a c1 e5 50 20 5d 8a 2b bf 5e a5 0a 33 74 66 51 65 92 40 68 c7 b2 ef fb 99 f6 b9 ..?.....P.].+.^..3tfQe.@h.......
05a0 ca 53 3a fc 20 4b f0 d7 70 8f dd 72 10 7d a4 08 62 c7 69 0d 5f 15 6a 07 36 8e 3b b8 3e e1 01 91 .S:..K..p..r.}..b.i._.j.6.;.>...
05c0 ad b6 3b 7c 3b 61 eb f2 38 1d 5e c3 f7 73 b4 74 35 39 7c 94 41 22 d8 3d 33 8f 10 17 18 0e b6 36 ..;|;a..8.^..s.t59|.A".=3......6
05e0 a6 2c 2f bd 07 55 53 bc 9d 0c 3a 9b 29 7e d5 d6 53 87 09 52 4c c3 07 b5 14 9b 64 d6 96 e0 33 bc .,/..US...:.)~..S..RL.....d...3.
0600 af fb 22 e5 b8 2b 18 70 ad 68 6a 37 33 1f e0 50 6b 1b 86 8a 90 3e 12 63 c0 14 a1 cc e5 ff 1a 78 .."..+.p.hj73..Pk....>.c.......x
0620 72 6b ea 29 29 f1 00 00 00 00 49 45 4e 44 ae 42 60 82 rk.)).....IEND.B`.
d='n332' href='#n332'>332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743
-- Minetest: builtin/chatcommands.lua

--
-- Chat command handler
--

core.chatcommands = {}
function core.register_chatcommand(cmd, def)
	def = def or {}
	def.params = def.params or ""
	def.description = def.description or ""
	def.privs = def.privs or {}
	core.chatcommands[cmd] = def
end

if core.setting_getbool("mod_profiling") then
	local tracefct = profiling_print_log
	profiling_print_log = nil
	core.register_chatcommand("save_mod_profile",
			{
				params      = "",
				description = "save mod profiling data to logfile " ..
						"(depends on default loglevel)",
				func        = tracefct,
				privs       = { server=true }
			})
end

core.register_on_chat_message(function(name, message)
	local cmd, param = string.match(message, "^/([^ ]+) *(.*)")
	if not param then
		param = ""
	end
	local cmd_def = core.chatcommands[cmd]
	if not cmd_def then
		return false
	end
	local has_privs, missing_privs = core.check_player_privs(name, cmd_def.privs)
	if has_privs then
		local success, message = cmd_def.func(name, param)
		if message then
			core.chat_send_player(name, message)
		end
	else
		core.chat_send_player(name, "You don't have permission"
				.. " to run this command (missing privileges: "
				.. table.concat(missing_privs, ", ") .. ")")
	end
	return true  -- Handled chat message
end)

--
-- Chat commands
--
core.register_chatcommand("me", {
	params = "<action>",
	description = "chat action (eg. /me orders a pizza)",
	privs = {shout=true},
	func = function(name, param)
		core.chat_send_all("* " .. name .. " " .. param)
	end,
})

core.register_chatcommand("help", {
	privs = {},
	params = "[all/privs/<cmd>]",
	description = "Get help for commands or list privileges",
	func = function(name, param)
		local function format_help_line(cmd, def)
			local msg = "/"..cmd
			if def.params and def.params ~= "" then
				msg = msg .. " " .. def.params
			end
			if def.description and def.description ~= "" then
				msg = msg .. ": " .. def.description
			end
			return msg
		end
		if param == "" then
			local msg = ""
			local cmds = {}
			for cmd, def in pairs(core.chatcommands) do
				if core.check_player_privs(name, def.privs) then
					table.insert(cmds, cmd)
				end
			end
			table.sort(cmds)
			return true, "Available commands: " .. table.concat(cmds, " ") .. "\n"
					.. "Use '/help <cmd>' to get more information,"
					.. " or '/help all' to list everything."
		elseif param == "all" then
			local cmds = {}
			for cmd, def in pairs(core.chatcommands) do
				if core.check_player_privs(name, def.privs) then
					table.insert(cmds, format_help_line(cmd, def))
				end
			end
			table.sort(cmds)
			return true, "Available commands:\n"..table.concat(cmds, "\n")
		elseif param == "privs" then
			local privs = {}
			for priv, def in pairs(core.registered_privileges) do
				table.insert(privs, priv .. ": " .. def.description)
			end
			table.sort(privs)
			return true, "Available privileges:\n"..table.concat(privs, "\n")
		else
			local cmd = param
			local def = core.chatcommands[cmd]
			if not def then
				return false, "Command not available: "..cmd
			else
				return true, format_help_line(cmd, def)
			end
		end
	end,
})

core.register_chatcommand("privs", {
	params = "<name>",
	description = "print out privileges of player",
	func = function(name, param)
		param = (param ~= "" and param or name)
		return true, "Privileges of " .. param .. ": "
			.. core.privs_to_string(
				core.get_player_privs(param), ' ')
	end,
})
core.register_chatcommand("grant", {
	params = "<name> <privilege>|all",
	description = "Give privilege to player",
	func = function(name, param)
		if not core.check_player_privs(name, {privs=true}) and
				not core.check_player_privs(name, {basic_privs=true}) then
			return false, "Your privileges are insufficient."
		end
		local grantname, grantprivstr = string.match(param, "([^ ]+) (.+)")
		if not grantname or not grantprivstr then
			return false, "Invalid parameters (see /help grant)"
		elseif not core.auth_table[grantname] then
			return false, "Player " .. grantname .. " does not exist."
		end
		local grantprivs = core.string_to_privs(grantprivstr)
		if grantprivstr == "all" then
			grantprivs = core.registered_privileges
		end
		local privs = core.get_player_privs(grantname)
		local privs_unknown = ""
		for priv, _ in pairs(grantprivs) do
			if priv ~= "interact" and priv ~= "shout" and
					not core.check_player_privs(name, {privs=true}) then
				return false, "Your privileges are insufficient."
			end
			if not core.registered_privileges[priv] then
				privs_unknown = privs_unknown .. "Unknown privilege: " .. priv .. "\n"
			end
			privs[priv] = true
		end
		if privs_unknown ~= "" then
			return false, privs_unknown
		end
		core.set_player_privs(grantname, privs)
		core.log("action", name..' granted ('..core.privs_to_string(grantprivs, ', ')..') privileges to '..grantname)
		if grantname ~= name then
			core.chat_send_player(grantname, name
					.. " granted you privileges: "
					.. core.privs_to_string(grantprivs, ' '))
		end
		return true, "Privileges of " .. grantname .. ": "
			.. core.privs_to_string(
				core.get_player_privs(grantname), ' ')
	end,
})
core.register_chatcommand("revoke", {
	params = "<name> <privilege>|all",
	description = "Remove privilege from player",
	privs = {},
	func = function(name, param)
		if not core.check_player_privs(name, {privs=true}) and
				not core.check_player_privs(name, {basic_privs=true}) then
			return false, "Your privileges are insufficient."
		end
		local revoke_name, revoke_priv_str = string.match(param, "([^ ]+) (.+)")
		if not revoke_name or not revoke_priv_str then
			return false, "Invalid parameters (see /help revoke)"
		elseif not core.auth_table[revoke_name] then
			return false, "Player " .. revoke_name .. " does not exist."
		end
		local revoke_privs = core.string_to_privs(revoke_priv_str)
		local privs = core.get_player_privs(revoke_name)
		for priv, _ in pairs(revoke_privs) do
			if priv ~= "interact" and priv ~= "shout" and priv ~= "interact_extra" and
					not core.check_player_privs(name, {privs=true}) then
				return false, "Your privileges are insufficient."
			end
		end
		if revoke_priv_str == "all" then
			privs = {}
		else
			for priv, _ in pairs(revoke_privs) do
				privs[priv] = nil
			end
		end
		core.set_player_privs(revoke_name, privs)
		core.log("action", name..' revoked ('
				..core.privs_to_string(revoke_privs, ', ')
				..') privileges from '..revoke_name)
		if revoke_name ~= name then
			core.chat_send_player(revoke_name, name
					.. " revoked privileges from you: "
					.. core.privs_to_string(revoke_privs, ' '))
		end
		return true, "Privileges of " .. revoke_name .. ": "
			.. core.privs_to_string(
				core.get_player_privs(revoke_name), ' ')
	end,
})

core.register_chatcommand("setpassword", {
	params = "<name> <password>",
	description = "set given password",
	privs = {password=true},
	func = function(name, param)
		local toname, raw_password = string.match(param, "^([^ ]+) +(.+)$")
		if not toname then
			toname = param:match("^([^ ]+) *$")
			raw_password = nil
		end
		if not toname then
			return false, "Name field required"
		end
		local actstr = "?"
		if not raw_password then
			core.set_player_password(toname, "")
			actstr = "cleared"
		else
			core.set_player_password(toname,
					core.get_password_hash(toname,
							raw_password))
			actstr = "set"
		end
		if toname ~= name then
			core.chat_send_player(toname, "Your password was "
					.. actstr .. " by " .. name)
		end
		return true, "Password of player \"" .. toname .. "\" " .. actstr
	end,
})

core.register_chatcommand("clearpassword", {
	params = "<name>",
	description = "set empty password",
	privs = {password=true},
	func = function(name, param)
		local toname = param
		if toname == "" then
			return false, "Name field required"
		end
		core.set_player_password(toname, '')
		return true, "Password of player \"" .. toname .. "\" cleared"
	end,
})

core.register_chatcommand("auth_reload", {
	params = "",
	description = "reload authentication data",
	privs = {server=true},
	func = function(name, param)
		local done = core.auth_reload()
		return done, (done and "Done." or "Failed.")
	end,
})

core.register_chatcommand("teleport", {
	params = "<X>,<Y>,<Z> | <to_name> | <name> <X>,<Y>,<Z> | <name> <to_name>",
	description = "teleport to given position",
	privs = {teleport=true},
	func = function(name, param)
		-- Returns (pos, true) if found, otherwise (pos, false)
		local function find_free_position_near(pos)
			local tries = {
				{x=1,y=0,z=0},
				{x=-1,y=0,z=0},
				{x=0,y=0,z=1},
				{x=0,y=0,z=-1},
			}
			for _, d in ipairs(tries) do
				local p = {x = pos.x+d.x, y = pos.y+d.y, z = pos.z+d.z}
				local n = core.get_node_or_nil(p)
				if n and n.name then
					local def = core.registered_nodes[n.name]
					if def and not def.walkable then
						return p, true
					end
				end
			end
			return pos, false
		end

		local teleportee = nil
		local p = {}
		p.x, p.y, p.z = string.match(param, "^([%d.-]+)[, ] *([%d.-]+)[, ] *([%d.-]+)$")
		p.x = tonumber(p.x)
		p.y = tonumber(p.y)
		p.z = tonumber(p.z)
		teleportee = core.get_player_by_name(name)
		if teleportee and p.x and p.y and p.z then
			teleportee:setpos(p)
			return true, "Teleporting to "..core.pos_to_string(p)
		end
		
		local teleportee = nil
		local p = nil
		local target_name = nil
		target_name = param:match("^([^ ]+)$")
		teleportee = core.get_player_by_name(name)
		if target_name then