Some of these are copies from the respective origins from mtg, to make sure we have headers everywhere listing the proper code. I've relicensed spectator_mode from WT*PL to LGPL-2.1. No other licenses were changed.
34 lines
1.1 KiB
Lua
34 lines
1.1 KiB
Lua
|
|
--[[
|
|
|
|
ITB (insidethebox) minetest game - Copyright (C) 2017-2018 sofar & nore
|
|
|
|
This library is free software; you can redistribute it and/or
|
|
modify it under the terms of the GNU Lesser General Public License
|
|
as published by the Free Software Foundation; either version 2.1
|
|
of the License, or (at your option) any later version.
|
|
|
|
This library is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Lesser General Public License for more details.
|
|
|
|
You should have received a copy of the GNU Lesser General Public
|
|
License along with this library; if not, write to the Free
|
|
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
|
MA 02111-1307 USA
|
|
|
|
]]--
|
|
|
|
minetest.register_chatcommand("who", {
|
|
params = "who server",
|
|
description = "List online players",
|
|
privs = {server = true},
|
|
func = function(name, param)
|
|
minetest.chat_send_player(name, "Online players:")
|
|
for _, obj in pairs(minetest.get_connected_players()) do
|
|
minetest.chat_send_player(name, "* " .. obj:get_player_name())
|
|
end
|
|
end,
|
|
})
|