summaryrefslogtreecommitdiff
path: root/src/server.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server.cpp')
-rw-r--r--src/server.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/server.cpp b/src/server.cpp
index fabfbc84e..f66592047 100644
--- a/src/server.cpp
+++ b/src/server.cpp
@@ -3247,13 +3247,11 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id)
// Parse commands
if(message[0] == L'/')
{
- line += L"Server: ";
-
size_t strip_size = 1;
if (message[1] == L'#') // support old-style commans
++strip_size;
message = message.substr(strip_size);
-
+
WStrfnd f1(message);
f1.next(L" "); // Skip over /#whatever
std::wstring paramstring = f1.next(L"");
@@ -3266,9 +3264,15 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id)
player,
privs);
- line += processServerCommand(ctx);
+ std::wstring reply(processServerCommand(ctx));
send_to_sender = ctx->flags & SEND_TO_SENDER;
send_to_others = ctx->flags & SEND_TO_OTHERS;
+
+ if (ctx->flags & SEND_NO_PREFIX)
+ line += reply;
+ else
+ line += L"Server: " + reply;
+
delete ctx;
}