summaryrefslogtreecommitdiff
path: root/src/servercommand.cpp
diff options
context:
space:
mode:
authorCiaran Gultnieks <ciaran@ciarang.com>2011-05-16 18:26:37 +0100
committerCiaran Gultnieks <ciaran@ciarang.com>2011-05-16 18:26:37 +0100
commit8bba9cde5c2536812679855e145954929a054d48 (patch)
treedc20b972f9ef7e10c99bcc278b9c1b37e4c69c8c /src/servercommand.cpp
parentbc59c185033c1d71d37da81261b72bd93f24e10c (diff)
downloadminetest-8bba9cde5c2536812679855e145954929a054d48.tar.gz
minetest-8bba9cde5c2536812679855e145954929a054d48.tar.bz2
minetest-8bba9cde5c2536812679855e145954929a054d48.zip
Restored the auto-admin powers of the local user (via name= in the config)
--HG-- extra : rebase_source : a35aa0d978990c28fa4fc158ce47d1f4aa967c04
Diffstat (limited to 'src/servercommand.cpp')
-rw-r--r--src/servercommand.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/servercommand.cpp b/src/servercommand.cpp
index 215dc0d27..5bb4f67f8 100644
--- a/src/servercommand.cpp
+++ b/src/servercommand.cpp
@@ -33,11 +33,13 @@ void cmd_privs(std::wostringstream &os,
{
if(ctx->parms.size() == 1)
{
+ // Show our own real privs, without any adjustments
+ // made for admin status
os<<L"-!- " + privsToString(ctx->player->privs);
return;
}
- if((ctx->player->privs & PRIV_PRIVS) == 0)
+ if((ctx->privs & PRIV_PRIVS) == 0)
{
os<<L"-!- You don't have permission to do that";
return;
@@ -62,7 +64,7 @@ void cmd_grantrevoke(std::wostringstream &os,
return;
}
- if((ctx->player->privs & PRIV_PRIVS) == 0)
+ if((ctx->privs & PRIV_PRIVS) == 0)
{
os<<L"-!- You don't have permission to do that";
return;
@@ -100,7 +102,7 @@ void cmd_time(std::wostringstream &os,
return;
}
- if((ctx->player->privs & PRIV_SETTIME) ==0)
+ if((ctx->privs & PRIV_SETTIME) ==0)
{
os<<L"-!- You don't have permission to do that";
return;
@@ -114,7 +116,7 @@ void cmd_time(std::wostringstream &os,
void cmd_shutdown(std::wostringstream &os,
ServerCommandContext *ctx)
{
- if((ctx->player->privs & PRIV_SERVER) ==0)
+ if((ctx->privs & PRIV_SERVER) ==0)
{
os<<L"-!- You don't have permission to do that";
return;
@@ -131,7 +133,7 @@ void cmd_shutdown(std::wostringstream &os,
void cmd_setting(std::wostringstream &os,
ServerCommandContext *ctx)
{
- if((ctx->player->privs & PRIV_SERVER) ==0)
+ if((ctx->privs & PRIV_SERVER) ==0)
{
os<<L"-!- You don't have permission to do that";
return;
@@ -145,7 +147,7 @@ void cmd_setting(std::wostringstream &os,
void cmd_teleport(std::wostringstream &os,
ServerCommandContext *ctx)
{
- if((ctx->player->privs & PRIV_TELEPORT) ==0)
+ if((ctx->privs & PRIV_TELEPORT) ==0)
{
os<<L"-!- You don't have permission to do that";
return;
@@ -178,7 +180,7 @@ std::wstring processServerCommand(ServerCommandContext *ctx)
std::wostringstream os(std::ios_base::binary);
ctx->flags = 1; // Default, unless we change it.
- u64 privs = ctx->player->privs;
+ u64 privs = ctx->privs;
if(ctx->parms.size() == 0 || ctx->parms[0] == L"help")
{