• R/O
  • SSH

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

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


Commit MetaInfo

Revisiondd665db7e154dda80a15bac37a30d5946f176d12 (tree)
Time2022-07-08 10:04:38
AuthorAdam Kaminski <kaminskiadam9@gmai...>
CommiterAdam Kaminski

Log Message

Added the compiler flag SERVER_ALLOWBOTS that decides if the "addbot" CCMD is usable or not. Also added a message to informs users if bots are not allowed.

Change Summary

Incremental Difference

diff -r 08dce2175aab -r dd665db7e154 src/CMakeLists.txt
--- a/src/CMakeLists.txt Thu Jul 07 21:01:51 2022 -0400
+++ b/src/CMakeLists.txt Thu Jul 07 21:04:38 2022 -0400
@@ -192,7 +192,8 @@
192192 if( SERVERONLY )
193193 # [TSPG]
194194 option( TSPG_BLACKLIST "Disable blacklisted commands and protect some cvars" )
195-
195+ option( TSPG_ALLOWBOTS "Allow bots to be added to the server" )
196+
196197 set( NO_SOUND ON )
197198 set( NO_GTK ON )
198199 set( NO_GL ON )
@@ -202,6 +203,10 @@
202203 if( TSPG_BLACKLIST )
203204 add_definitions( -DSERVER_BLACKLIST=1 )
204205 endif( TSPG_BLACKLIST )
206+ if( TSPG_ALLOWBOTS )
207+ add_definitions( -DSERVER_ALLOWBOTS=1 )
208+ endif( TSPG_ALLOWBOTS )
209+
205210 endif( SERVERONLY )
206211
207212 set( FMOD_SEARCH_PATHS
diff -r 08dce2175aab -r dd665db7e154 src/bots.cpp
--- a/src/bots.cpp Thu Jul 07 21:01:51 2022 -0400
+++ b/src/bots.cpp Thu Jul 07 21:04:38 2022 -0400
@@ -3841,9 +3841,12 @@
38413841 CCMD( addbot )
38423842 {
38433843 // [TSPG]
3844- #if defined( SERVER_ONLY ) && defined( SERVER_BLACKLIST )
3844+ #if defined( SERVER_ONLY ) && !defined( SERVER_ALLOWBOTS )
38453845 if ( gamestate != GS_STARTUP )
3846+ {
3847+ Printf( "Bots are not allowed!\n" );
38463848 return;
3849+ }
38473850 #endif
38483851
38493852 CSkullBot *pBot;