Remove "Server -!- " prefix from player messages
authorShadowNinja <shadowninja@minetest.net>
Tue, 25 Feb 2014 01:41:40 +0000 (20:41 -0500)
committerShadowNinja <shadowninja@minetest.net>
Thu, 27 Feb 2014 05:00:22 +0000 (00:00 -0500)
builtin/chatcommands.lua
doc/lua_api.txt
src/script/lua_api/l_server.cpp
src/server.cpp
src/server.h

index 66fcab63ace46dba9a9f470a61e8fcca107c5b2f..03c278d4d919df4fec29e6bda1a249a4f8abefbb 100644 (file)
@@ -710,7 +710,7 @@ minetest.register_chatcommand("msg", {
                if found then
                        if minetest.get_player_by_name(sendto) then
                                minetest.log("action", "PM from "..name.." to "..sendto..": "..message)
-                               minetest.chat_send_player(sendto, "PM from "..name..": "..message, false)
+                               minetest.chat_send_player(sendto, "PM from "..name..": "..message)
                                minetest.chat_send_player(name, "Message sent")
                        else
                                minetest.chat_send_player(name, "The player "..sendto.." is not online")
index 0e2f6360e43c9bed121f7f49a87a1690fb54fb5a..f54684940e9ed2b9ed756eb8bdd3396d3a8b794d 100644 (file)
@@ -1327,8 +1327,7 @@ minetest.get_player_ip(name) -> IP address string
 
 Chat:
 minetest.chat_send_all(text)
-minetest.chat_send_player(name, text, prepend)
-^ prepend: optional, if it is set to false "Server -!- " will not be prepended to the message
+minetest.chat_send_player(name, text)
 
 Environment access:
 
index dc05ccbbe7f395c33f629df9a124ee7b12191be0..bbf5a707d0d48d08d7654c6ed3c25399328c0f45 100644 (file)
@@ -52,21 +52,17 @@ int ModApiServer::l_chat_send_all(lua_State *L)
        return 0;
 }
 
-// chat_send_player(name, text, prepend)
+// chat_send_player(name, text)
 int ModApiServer::l_chat_send_player(lua_State *L)
 {
        NO_MAP_LOCK_REQUIRED;
        const char *name = luaL_checkstring(L, 1);
        const char *text = luaL_checkstring(L, 2);
-       bool prepend = true;
-
-       if (lua_isboolean(L, 3))
-               prepend = lua_toboolean(L, 3);
 
        // Get server from registry
        Server *server = getServer(L);
        // Send
-       server->notifyPlayer(name, narrow_to_wide(text), prepend);
+       server->notifyPlayer(name, narrow_to_wide(text));
        return 0;
 }
 
index 4897df6a97456f0112e7753eeb10f4dee2dcf1d5..7eb78f3ef6756a1d319a62ab11be2c62eb57191e 100644 (file)
@@ -4385,7 +4385,7 @@ std::string Server::getBanDescription(const std::string &ip_or_name)
        return m_banmanager->getBanDescription(ip_or_name);
 }
 
-void Server::notifyPlayer(const char *name, const std::wstring msg, const bool prepend = true)
+void Server::notifyPlayer(const char *name, const std::wstring msg)
 {
        Player *player = m_env->getPlayer(name);
        if(!player)
@@ -4394,10 +4394,7 @@ void Server::notifyPlayer(const char *name, const std::wstring msg, const bool p
        if (player->peer_id == PEER_ID_INEXISTENT)
                return;
 
-       if (prepend)
-               SendChatMessage(player->peer_id, std::wstring(L"Server -!- ")+msg);
-       else
-               SendChatMessage(player->peer_id, msg);
+       SendChatMessage(player->peer_id, msg);
 }
 
 bool Server::showFormspec(const char *playername, const std::string &formspec, const std::string &formname)
index 54078defc33d8fb9cb81be067ed1911de0e8e93a..7ad9bcafb3f4dd443c98cc65ff7f0a04f006b116 100644 (file)
@@ -229,7 +229,7 @@ public:
        void unsetIpBanned(const std::string &ip_or_name);
        std::string getBanDescription(const std::string &ip_or_name);
 
-       void notifyPlayer(const char *name, const std::wstring msg, const bool prepend);
+       void notifyPlayer(const char *name, const std::wstring msg);
        void notifyPlayers(const std::wstring msg);
        void spawnParticle(const char *playername,
                v3f pos, v3f velocity, v3f acceleration,