/********************************************************************* v.1 connect_spam_patch.cz simple patch to prevent high numbers of newbie connections to your talker from the same site. Requirments: ewtoo derivitive talker Notes: MAX_SITE_NEWBIES should be altered if you want more or less that 20 newbies From A Given Site Simultaneouly connected Bug Reports: send to phypor@benland.muc.edu Licences: freely distributable and modifiable, as long as credit given in appropritate places for any distrubitions (be it this alone or within another package) Warranty: non, the author is in no way responsible for use, misuse, abuse, or any other actions misactions, reactions of this code, its provided as is. Author: phypor "if it breaks you get to keep both pieces" ~old linux proverb *********************************************************************/ socket.c or player.h : #define MAX_SITE_NEWBIES 20 socket.c : anywhere above accept_new_connection () : int no_more_gits ( player * p ) { int i = 0; player *scan; for (scan = flatlist_start; scan; scan = scan->flat_next) if (!strcmp (p->num_addr, scan->num_addr) && !(scan->residency & BASE)) i++; return (i > MAX_SITE_NEWBIES) ? 1 : 0; } socket.c : accept_new_connection () : directly after the line that reads: strncpy(p->num_addr, inet_ntoa(incoming.sin_addr), MAX_INET_ADDR - 2); if (no_more_gits (p)) { /* optionally you could do any stuff here to log, or write back on the connection loads of garbage.. */ destroy_player (p); return; }