1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-31 18:31:04 +00:00

minetest.register_chatcommand(cmd, def)

This commit is contained in:
Perttu Ahola 2012-03-30 01:45:23 +03:00
parent 9d456ca87a
commit b9ffb5f30d
4 changed files with 126 additions and 20 deletions

View file

@ -376,26 +376,7 @@ std::wstring processServerCommand(ServerCommandContext *ctx)
std::wostringstream os(std::ios_base::binary);
ctx->flags = SEND_TO_SENDER; // Default, unless we change it.
u64 privs = ctx->privs;
if(ctx->parms.size() == 0 || ctx->parms[0] == L"help")
{
os<<L"-!- Available commands: ";
os<<L"me status privs";
if(privs & PRIV_SERVER)
os<<L" shutdown setting clearobjects";
if(privs & PRIV_SETTIME)
os<<L" time";
if(privs & PRIV_TELEPORT)
os<<L" teleport";
if(privs & PRIV_PRIVS)
os<<L" grant revoke";
if(privs & PRIV_BAN)
os<<L" ban unban";
if(privs & PRIV_PASSWORD)
os<<L" setpassword clearpassword";
}
else if(ctx->parms[0] == L"status")
if(ctx->parms[0] == L"status")
cmd_status(os, ctx);
else if(ctx->parms[0] == L"privs")
cmd_privs(os, ctx);