This is a fork of Zandronum Beta for TSPG.
Revision | 77ce14c3ff09ddadccf2521fde45fd330202c093 (tree) |
---|---|
Time | 2022-03-12 10:36:49 |
Author | ![]() |
Commiter | Joshua Surace |
Fixed the issue when Bad Words Supposed to filter
@@ -2257,7 +2257,10 @@ | ||
2257 | 2257 | // If so, give the player a generic unused name and inform the client. |
2258 | 2258 | else if ( PLAYER_NameUsed ( value, g_lCurrentClient ) ) |
2259 | 2259 | { |
2260 | - message.Format ( "The name '%s' is already in use. ", value.GetChars() ); | |
2260 | + message.Format ( "The name '%s' is %s. ", value.GetChars(), ( filtered ? "not allowed" : "already in use" ) ); | |
2261 | + value = PLAYER_GenerateUniqueName(); | |
2262 | + message.AppendFormat ( "You are renamed to '%s'.\n", value.GetChars() ); | |
2263 | + message.AppendFormat ( "You have been renamed to '%s'.\n", value.GetChars() ); | |
2261 | 2264 | bOverriddenName = true; |
2262 | 2265 | } |
2263 | 2266 |
@@ -5879,14 +5882,16 @@ | ||
5879 | 5882 | SERVER_KickPlayer( ulPlayer, "Client sent an excessively long chat string" ); |
5880 | 5883 | return ( true ); |
5881 | 5884 | } |
5882 | - | |
5883 | - SERVER_SendChatMessage( ulPlayer, ulChatMode, pszChatString, ulReceiver ); | |
5885 | + | |
5884 | 5886 | if ( BADWORDS_ShouldFilter( pszChatString ) ) |
5885 | 5887 | { |
5886 | 5888 | SERVER_PrintfPlayer(ulPlayer, "Your message was discarded because it contained inappropriate language. Please note that attempts to circumvent this system may result in you being banned.\n"); |
5887 | 5889 | return ( false ); |
5888 | 5890 | } |
5889 | 5891 | |
5892 | + SERVER_SendChatMessage( ulPlayer, ulChatMode, pszChatString, ulReceiver ); | |
5893 | + | |
5894 | + | |
5890 | 5895 | return ( false ); |
5891 | 5896 | } |
5892 | 5897 | } |