From d2c0b4905abd895b87d5ed9b8769b1a60d692970 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Sat, 13 Aug 2011 17:35:10 +0200 Subject: Defines for server command context flags --- src/servercommand.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/servercommand.cpp') diff --git a/src/servercommand.cpp b/src/servercommand.cpp index 663693b9a..31f18c53c 100644 --- a/src/servercommand.cpp +++ b/src/servercommand.cpp @@ -130,7 +130,7 @@ void cmd_shutdown(std::wostringstream &os, ctx->server->requestShutdown(); os<flags |= 2; + ctx->flags |= SEND_TO_OTHERS; } void cmd_setting(std::wostringstream &os, @@ -232,7 +232,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; -- cgit v1.2.3 From 0488bf54d3f0b767eb53a026b4b52de86cfbd4ab Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Sat, 13 Aug 2011 17:41:18 +0200 Subject: /me command --- src/servercommand.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/servercommand.cpp') diff --git a/src/servercommand.cpp b/src/servercommand.cpp index 31f18c53c..89ba0771f 100644 --- a/src/servercommand.cpp +++ b/src/servercommand.cpp @@ -25,6 +25,14 @@ void cmd_status(std::wostringstream &os, os<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) { @@ -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<parms[0]; -- cgit v1.2.3