• R/O
  • SSH

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#objective-cqt誰得cocoapythonrubywindowsphpgameguibathyscaphec翻訳omegatframework計画中(planning stage)twitterdombtronvb.nettestarduinodirectxpreviewerゲームエンジン

This is a fork of Zandronum Beta for TSPG.


Commit MetaInfo

Revision77ce14c3ff09ddadccf2521fde45fd330202c093 (tree)
Time2022-03-12 10:36:49
AuthorJoshua Surace <doomjoshuaboy@live...>
CommiterJoshua Surace

Log Message

Fixed the issue when Bad Words Supposed to filter

Change Summary

Incremental Difference

diff -r 1a0631efaa05 -r 77ce14c3ff09 src/sv_main.cpp
--- a/src/sv_main.cpp Mon Dec 13 11:25:36 2021 +1100
+++ b/src/sv_main.cpp Sat Mar 12 12:36:49 2022 +1100
@@ -2257,7 +2257,10 @@
22572257 // If so, give the player a generic unused name and inform the client.
22582258 else if ( PLAYER_NameUsed ( value, g_lCurrentClient ) )
22592259 {
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() );
22612264 bOverriddenName = true;
22622265 }
22632266
@@ -5879,14 +5882,16 @@
58795882 SERVER_KickPlayer( ulPlayer, "Client sent an excessively long chat string" );
58805883 return ( true );
58815884 }
5882-
5883- SERVER_SendChatMessage( ulPlayer, ulChatMode, pszChatString, ulReceiver );
5885+
58845886 if ( BADWORDS_ShouldFilter( pszChatString ) )
58855887 {
58865888 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");
58875889 return ( false );
58885890 }
58895891
5892+ SERVER_SendChatMessage( ulPlayer, ulChatMode, pszChatString, ulReceiver );
5893+
5894+
58905895 return ( false );
58915896 }
58925897 }