diff options
author | Perttu Ahola <celeron55@gmail.com> | 2011-08-22 14:46:54 +0300 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2011-08-22 14:46:54 +0300 |
commit | 5415256a529eca1317b835ceea54a6ee6633cb97 (patch) | |
tree | 85e53482194f189437bc848cbb225a235ac7fcac /src/servercommand.cpp | |
parent | 836e43db60ff1f3c9d160d0d58ba5a631c4293fc (diff) | |
parent | 9c94538fb7a7d7712d8da21d16790359a853f575 (diff) | |
download | minetest-5415256a529eca1317b835ceea54a6ee6633cb97.tar.gz minetest-5415256a529eca1317b835ceea54a6ee6633cb97.tar.bz2 minetest-5415256a529eca1317b835ceea54a6ee6633cb97.zip |
Merge remote-tracking branch 'oblomov/me_cmd'
Diffstat (limited to 'src/servercommand.cpp')
-rw-r--r-- | src/servercommand.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/servercommand.cpp b/src/servercommand.cpp index 663693b9a..89ba0771f 100644 --- a/src/servercommand.cpp +++ b/src/servercommand.cpp @@ -25,6 +25,14 @@ void cmd_status(std::wostringstream &os, os<<ctx->server->getStatusString(); } +void cmd_me(std::wostringstream &os, + ServerCommandContext *ctx) +{ + std::wstring name = narrow_to_wide(ctx->player->getName()); + os << L"* " << name << L" " << ctx->paramstring; + ctx->flags |= SEND_TO_OTHERS | SEND_NO_PREFIX; +} + void cmd_privs(std::wostringstream &os, ServerCommandContext *ctx) { @@ -130,7 +138,7 @@ void cmd_shutdown(std::wostringstream &os, ctx->server->requestShutdown(); os<<L"*** Server shutting down (operator request)"; - ctx->flags |= 2; + ctx->flags |= SEND_TO_OTHERS; } void cmd_setting(std::wostringstream &os, @@ -232,7 +240,7 @@ std::wstring processServerCommand(ServerCommandContext *ctx) { std::wostringstream os(std::ios_base::binary); - ctx->flags = 1; // Default, unless we change it. + ctx->flags = SEND_TO_SENDER; // Default, unless we change it. u64 privs = ctx->privs; @@ -283,6 +291,10 @@ std::wstring processServerCommand(ServerCommandContext *ctx) { cmd_banunban(os, ctx); } + else if(ctx->parms[0] == L"me") + { + cmd_me(os, ctx); + } else { os<<L"-!- Invalid command: " + ctx->parms[0]; |