These code be generated by CSM, a modded client or just copy and pasted by the player.
Changes
- Update configuration example and setting translation file.
- Remove colour codes before logging chat.
- Add setting to remove colour codes before processing the chat.
# If you want to announce your ipv6 address, use serverlist_url = v6.servers.minetest.net.
serverlist_url (Serverlist URL) string servers.minetest.net
+# Remove color codes from incoming chat messages
+# Use this to stop players from being able to use color in their messages
+strip_color_codes (Strip color codes) bool false
+
[*Network]
# Network port to listen (UDP).
# serverlist_file = favoriteservers.txt
# Maximum size of the out chat queue. 0 to disable queueing and -1 to make the queue size unlimited
-# type: int min: -1
-max_out_chat_queue_size = 20
+# type: int
+# max_out_chat_queue_size = 20
## Graphics
# type: int
# screenH = 600
-# Save the window size automatically when modified.
+# Save window size automatically when modified.
# type: bool
# autosave_screensize = true
# type: string
# serverlist_url = servers.minetest.net
-# Disable escape sequences, e.g. chat coloring.
-# Use this if you want to run a server with pre-0.4.14 clients and you want to disable
-# the escape sequences generated by mods.
+# Remove color codes from incoming chat messages
+# Use this to stop players from being able to use color in their messages
# type: bool
-# disable_escape_sequences = false
+# strip_color_codes = false
## Network
# Print the engine's profiling data in regular intervals (in seconds). 0 = disable. Useful for developers.
# type: int
# profiler_print_interval = 0
+
// Server
settings->setDefault("disable_escape_sequences", "false");
+ settings->setDefault("strip_color_codes", "false");
// Network
settings->setDefault("enable_ipv6", "true");
}
std::wstring Server::handleChat(const std::string &name, const std::wstring &wname,
- const std::wstring &wmessage, bool check_shout_priv, RemotePlayer *player)
+ std::wstring wmessage, bool check_shout_priv, RemotePlayer *player)
{
// If something goes wrong, this player is to blame
RollbackScopeActor rollback_scope(m_rollback,
std::string("player:") + name);
+ if (g_settings->getBool("strip_color_codes"))
+ wmessage = unescape_enriched(wmessage);
+
if (player) {
switch (player->canSendChatMessage()) {
case RPLAYER_CHATRESULT_FLOODING: {
/*
Send the message to others
*/
- actionstream << "CHAT: " << wide_to_narrow(line) << std::endl;
+ actionstream << "CHAT: " << wide_to_narrow(unescape_enriched(line)) << std::endl;
std::vector<u16> clients = m_clients.getClientIDs();
// This returns the answer to the sender of wmessage, or "" if there is none
std::wstring handleChat(const std::string &name, const std::wstring &wname,
- const std::wstring &wmessage,
+ std::wstring wmessage_input,
bool check_shout_priv = false,
RemotePlayer *player = NULL);
void handleAdminChat(const ChatEventChat *evt);
gettext("Random input");
gettext("Enable random user input (only used for testing).");
gettext("Continuous forward");
- gettext("Continuous forward movement (only used for testing).");
+ gettext("Continuous forward movement, toggled by autoforward key.");
gettext("Enable Joysticks");
gettext("Enable Joysticks");
gettext("Joystick ID");
gettext("Key for increasing the volume.\nSee http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3");
gettext("Dec. volume key");
gettext("Key for decreasing the volume.\nSee http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3");
- gettext("Autorun key");
- gettext("Key for toggling autorun.\nSee http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3");
+ gettext("Autoforward key");
+ gettext("Key for toggling autoforward.\nSee http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3");
gettext("Cinematic mode key");
gettext("Key for toggling cinematic mode.\nSee http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3");
gettext("Minimap key");
gettext("Automaticaly report to the serverlist.");
gettext("Serverlist URL");
gettext("Announce to this serverlist.\nIf you want to announce your ipv6 address, use serverlist_url = v6.servers.minetest.net.");
- gettext("Disable escape sequences");
- gettext("Disable escape sequences, e.g. chat coloring.\nUse this if you want to run a server with pre-0.4.14 clients and you want to disable\nthe escape sequences generated by mods.");
+ gettext("Strip color codes");
+ gettext("Remove color codes from incoming chat messages\nUse this to stop players from being able to use color in their messages");
gettext("Network");
gettext("Server port");
gettext("Network port to listen (UDP).\nThis value will be overridden when starting from the main menu.");