• R/O
  • SSH

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#objective-cqtwindows誰得cocoapythonphprubygameguibathyscaphec翻訳omegat計画中(planning stage)frameworktwittertestdomvb.netdirectxbtronarduinopreviewerゲームエンジン

This is a fork of Zandronum used on servers hosted by The Sentinels Playground (TSPG).


Commit MetaInfo

Revision14feaa6d9045bef49708f8db16b661b87d7a698e (tree)
Time2022-06-27 00:37:18
AuthorAdam Kaminski <kaminskiadam9@gmai...>
CommiterAdam Kaminski

Log Message

Servers now check for bad words in the hostname and will shut down if any bad words are found.

Change Summary

Incremental Difference

diff -r 764eb4b13ef9 -r 14feaa6d9045 src/sv_master.cpp
--- a/src/sv_master.cpp Sun Jun 26 11:12:39 2022 -0400
+++ b/src/sv_master.cpp Sun Jun 26 11:37:18 2022 -0400
@@ -753,6 +753,8 @@
753753
754754 CVAR(String, tspg_branding_hostnameprefix, "", CVAR_SERVERINFO|TSPG_NOSET);
755755
756+// [TSPG] This declaration is needed in order to filter bad words in the hostname.
757+bool BADWORDS_ShouldFilter( const char *text );
756758 // Name of this server on launchers.
757759 CUSTOM_CVAR( String, sv_hostname, "Unnamed " GAMENAME " server", CVAR_ARCHIVE|CVAR_NOSETBYACS|CVAR_SERVERINFO )
758760 {
@@ -763,6 +765,16 @@
763765 return;
764766 }
765767
768+ // [TSPG] Don't allow any bad words if found in the new hostname.
769+ if ( BADWORDS_ShouldFilter( self ))
770+ {
771+ Printf( "ERROR: An inappropriate hostname was used. Please don't include any bad words in it.\n" );
772+ self = "Please use an appropriate hostname";
773+
774+ // [TSPG] If this happens, just shut down the server.
775+ exit( 0 );
776+ }
777+
766778 if (static_cast<const char *>(tspg_branding_hostnameprefix)[0] != '\0')
767779 {
768780 tspgPrefixLock = true;