This is a fork of Zandronum Beta for TSPG.
リビジョン | 3731e2f6d00a3fb0a7cd33c5b6db5d9b527fa84b (tree) |
---|---|
日時 | 2022-06-27 00:37:18 |
作者 | Adam Kaminski <kaminskiadam9@gmai...> |
コミッター | Adam Kaminski |
Servers now check for bad words in the hostname and will shut down if any bad words are found.
@@ -753,6 +753,8 @@ | ||
753 | 753 | |
754 | 754 | CVAR(String, tspg_branding_hostnameprefix, "", CVAR_SERVERINFO|TSPG_NOSET); |
755 | 755 | |
756 | +// [TSPG] This declaration is needed in order to filter bad words in the hostname. | |
757 | +bool BADWORDS_ShouldFilter( const char *text ); | |
756 | 758 | // Name of this server on launchers. |
757 | 759 | CUSTOM_CVAR( String, sv_hostname, "Unnamed " GAMENAME " server", CVAR_ARCHIVE|CVAR_NOSETBYACS|CVAR_SERVERINFO ) |
758 | 760 | { |
@@ -763,6 +765,16 @@ | ||
763 | 765 | return; |
764 | 766 | } |
765 | 767 | |
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 | + | |
766 | 778 | if (static_cast<const char *>(tspg_branding_hostnameprefix)[0] != '\0') |
767 | 779 | { |
768 | 780 | tspgPrefixLock = true; |