3 #include <server/world.qh>
5 float autocvar_sv_clientcommand_antispam_time;
6 int autocvar_sv_clientcommand_antispam_count;
9 .string ignore_list; // stores player id's, maybe can be upgraded to store net address for reconnect protection
11 const int IGNORE_MAXPLAYERS = 16; // maximum players to be ignored in the personal chat
13 string MapVote_Suggest(entity this, string m);
15 // used by common/command/generic.qc:GenericCommand_dumpcommands to list all commands into a .txt file
16 void ClientCommand_macro_write_aliases(float fh);
18 // functions for ignore command
19 string ignore_removefromlist(entity list, entity ignore)
21 if(ignore.crypto_idfp && ignore.crypto_idfp != "" && list.crypto_idfp && list.crypto_idfp != "")
23 for(int j = 0; j < IGNORE_MAXPLAYERS; ++j)
25 string pos = db_get(ServerProgsDB, strcat("/ignore/", list.crypto_idfp, "/", ftos(j)));
26 if(pos == ignore.crypto_idfp)
28 db_remove(ServerProgsDB, strcat("/ignore/", list.crypto_idfp, "/", ftos(j)));
32 // should this fall back? we know advanced mode is being used
36 string theid = ftos(etof(ignore));
38 FOREACH_WORD(list.ignore_list, it != theid,
40 newlist = cons(newlist, it);
49 bool ignore_playerinlist(entity sender, entity targ)
51 // TODO: optimize this by saving it to .ignore_list?
52 if(targ.crypto_idfp && targ.crypto_idfp != "" && sender.crypto_idfp && sender.crypto_idfp != "")
55 for(int j = 0; j < IGNORE_MAXPLAYERS; ++j)
57 string pos = db_get(ServerProgsDB, strcat("/ignore/", targ.crypto_idfp, "/", ftos(j)));
58 thelist = cons(thelist, pos);
61 return ((thelist != "") ? PlayerInList(sender, thelist) : false);
63 else if(!targ.ignore_list || targ.ignore_list == "")
66 string theid = ftos(etof(sender));
68 FOREACH_WORD(targ.ignore_list, it == theid,
76 void ignore_clearall(entity this)
78 for(int j = 0; j < IGNORE_MAXPLAYERS; ++j)
80 string pos = db_get(ServerProgsDB, strcat("/ignore/", this.crypto_idfp, "/", ftos(j)));
82 db_remove(ServerProgsDB, strcat("/ignore/", this.crypto_idfp, "/", ftos(j)));