void
drawgamemenu(int game)
{
- static int flood = 0;
-
if (loggedin) {
clear();
refresh ();
}
- /* for retarded clients */
- flood++;
- if (flood >= 20)
+ if (check_retard(0))
{
endwin();
graceful_exit (119);
/* launch program */
ttyrec_main (userchoice, me->username, gen_ttyrec_filename());
+ check_retard(1); /* reset retard counter */
setproctitle ("%s", me->username);
}
extern void catch_sighup(int signum);
extern void loadbanner(int game, struct dg_banner *ban);
extern void drawbanner(unsigned int start_line, unsigned int howmany);
+extern int check_retard(int reset);
extern char *dgl_format_str(int game, struct dg_user *me, char *str);
extern int dgl_exec_cmdqueue(struct dg_cmdpart *queue, int game, struct dg_user *me);
struct dg_globalconfig globalconfig;
+
+int
+check_retard(int reset)
+{
+ static int retardation = 0; /* counter for retarded clients & flooding */
+ if (reset) retardation = 0;
+ else retardation++;
+ return ((retardation > 20) ? 1 : 0);
+}
+
/*
* replace following codes with variables:
* %u == shed_uid (number)