Zombie Mod just crashed from a Client Overflow.
Timeleft was being spammed.
Just informing.
Zombie Mod just crashed from a Client Overflow.
Timeleft was being spammed.
Just informing.
Can we write an eventscript to prevent timeleft floods?
Possibly auto-permabanning the perpetrator?
# Here I'll help you start...
import es;
import playerlib;
def es_client_command(event_var):
if(str(event_var['command']) == 'timeleft'):es.tell(event_var['userid'], "Banned for flooding timeleft.");es.server.queuecmd("banid %i %s" %(0, event_var['userid'], ));
# I'm too lazy to write the rest... good luck ... :)
Yay for programming experience :D
Last edited by walterbrunswick; 07-08-2009 at 04:26 PM.
well i hope they make a campaign to get rid of that script :P i hate server crashes =(
Okay I updated my script...
Nothing fancy. Just a starting point. You can use whatever database you prefer. I was using dictionaries and tuples to store the userid and timediff integers.
TODO: More state control.
NOTE: DO NOT FIRE THIS BITCH UP, THE LOGIC IS WRONG! I need to fix that once I stop being lazy.
import es;
import time;
# Set these values to your preference.
# floodthresh requests in timeforflood seconds...
floodthresh = 5;
timeforflood = 10;
cl = dict();
def es_client_command(event_var):
if(str(event_var['command']) == 'timeleft'):userid = event_var['userid'];ct = abs(time.time());if(not(cl.has_key(userid))):cl[userid] = (1, ct);return;tdiff = cl.get(userid)[1] - ct;cl[userid] = (cl.get(userid)[0] + 1, ct);if((cl.get(userid)[0] > floodthresh) and (tdiff <= timeforflood)):es.tell(userid, "Banned for flooding timeleft (%i requests in % secs)." % (cl.get(userid)[0], tdiff));es.server.queuecmd("banid %i %s" %(0, userid, ));elif((cl.get(userid)[0] < floodthresh) and (tdiff > timeforflood)):cl[userid] = (0, 0);return;
Last edited by walterbrunswick; 07-09-2009 at 09:56 PM.