aboutsummaryrefslogtreecommitdiff
path: root/src/server.cpp
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2011-05-16 23:59:28 +0300
committerPerttu Ahola <celeron55@gmail.com>2011-05-16 23:59:28 +0300
commit07ff1da6ae0728fa2f7bbf5d0e188e986344a0db (patch)
tree1df887cd431b470112e14d2dd1265fb0d505dd48 /src/server.cpp
parent5624dac3b78e4c1113aaecf05da645f2ab55c98d (diff)
parent29932d4bddad6a0ad4269606e38701d544784951 (diff)
downloadminetest-07ff1da6ae0728fa2f7bbf5d0e188e986344a0db.tar.gz
minetest-07ff1da6ae0728fa2f7bbf5d0e188e986344a0db.tar.bz2
minetest-07ff1da6ae0728fa2f7bbf5d0e188e986344a0db.zip
merged CiaranG's stuff again: auto-admin powers to local user, DSTACK macro -Wformat warnings
Diffstat (limited to 'src/server.cpp')
-rw-r--r--src/server.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/server.cpp b/src/server.cpp
index 6c57daa5c..d211186eb 100644
--- a/src/server.cpp
+++ b/src/server.cpp
@@ -2870,12 +2870,18 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id)
message = message.substr(commandprefix.size());
+ // Local player gets all privileges regardless of
+ // what's set on their account.
+ u64 privs = player->privs;
+ if(g_settings.get("name") == player->getName())
+ privs = PRIV_ALL;
+
ServerCommandContext *ctx = new ServerCommandContext(
str_split(message, L' '),
this,
&m_env,
- player
- );
+ player,
+ privs);
line += processServerCommand(ctx);
send_to_sender = ctx->flags & 1;