Defines for server command context flags
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Sat, 13 Aug 2011 15:35:10 +0000 (17:35 +0200)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Mon, 22 Aug 2011 11:02:08 +0000 (13:02 +0200)
src/server.cpp
src/servercommand.cpp
src/servercommand.h

index 1f33a66f526eeb475a229ed45c75cf21a1a585d2..fabfbc84e31c42d11b1829da1d68fc032e27d1e3 100644 (file)
@@ -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;
 
                }
index 663693b9a350df310084acb1d77f84f6852058ba..31f18c53c3c603217fa19feecff44a9b2c06089c 100644 (file)
@@ -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;
 
index cee4976b165d29620d5f60060e6bc327e40394d3..15679f333b7ab418bc6dda79285dab19dcda8917 100644 (file)
@@ -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;