diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2011-08-13 17:35:10 +0200 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2011-08-22 13:02:08 +0200 |
commit | d2c0b4905abd895b87d5ed9b8769b1a60d692970 (patch) | |
tree | 5bc1e683747aaad3647e420729e8b97cbc505fbb | |
parent | 153f07fdfb60ddfeeb3bdb59e5f061e870334d3a (diff) | |
download | minetest-d2c0b4905abd895b87d5ed9b8769b1a60d692970.tar.gz minetest-d2c0b4905abd895b87d5ed9b8769b1a60d692970.tar.bz2 minetest-d2c0b4905abd895b87d5ed9b8769b1a60d692970.zip |
Defines for server command context flags
-rw-r--r-- | src/server.cpp | 4 | ||||
-rw-r--r-- | src/servercommand.cpp | 4 | ||||
-rw-r--r-- | src/servercommand.h | 4 |
3 files changed, 7 insertions, 5 deletions
diff --git a/src/server.cpp b/src/server.cpp index 1f33a66f5..fabfbc84e 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -3267,8 +3267,8 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id) privs); line += processServerCommand(ctx); - send_to_sender = ctx->flags & 1; - send_to_others = ctx->flags & 2; + send_to_sender = ctx->flags & SEND_TO_SENDER; + send_to_others = ctx->flags & SEND_TO_OTHERS; delete ctx; } 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<<L"*** Server shutting down (operator request)"; - ctx->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; diff --git a/src/servercommand.h b/src/servercommand.h index cee4976b1..15679f333 100644 --- a/src/servercommand.h +++ b/src/servercommand.h @@ -25,9 +25,11 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "player.h" #include "server.h" +#define SEND_TO_SENDER (1<<0) +#define SEND_TO_OTHERS (1<<1) + struct ServerCommandContext { - std::vector<std::wstring> parms; std::wstring paramstring; Server* server; |