diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2011-08-13 17:09:23 +0200 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2011-08-22 13:02:08 +0200 |
commit | 153f07fdfb60ddfeeb3bdb59e5f061e870334d3a (patch) | |
tree | 961d5038cdb5dd644cc8925b344c47182c7794f5 /src/server.cpp | |
parent | 7e610aece52ad547d4ae263aff5297342d5a4bff (diff) | |
download | hax-minetest-server-153f07fdfb60ddfeeb3bdb59e5f061e870334d3a.tar.gz hax-minetest-server-153f07fdfb60ddfeeb3bdb59e5f061e870334d3a.zip |
Remove distinction between /# and / commands
No need to make the server command syntax more complicated than
necessary. If the need ever arise, we'll find some other way to
distinguish the client commands. Also, the /# syntax is deprecated and
will be made obsolete in time.
Diffstat (limited to '')
-rw-r--r-- | src/server.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/server.cpp b/src/server.cpp index 5b657bc2e..1f33a66f5 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -3245,12 +3245,14 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id) u64 privs = getPlayerPrivs(player); // Parse commands - std::wstring commandprefix = L"/#"; - if(message.substr(0, commandprefix.size()) == commandprefix) + if(message[0] == L'/') { line += L"Server: "; - message = message.substr(commandprefix.size()); + 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 |