• Welcome to Valhalla Legends Archive.
 

An idea for banning code

Started by CatVir, August 22, 2004, 10:52 AM

Previous topic - Next topic

CatVir

I've got an idea how it could be done instead of making timer:
for each user create record:

type BanInfo
  Account as string
  Activity as integer
  Timer as long
end type

'lets say account is set already
sub UserJoinsChannel(User as BanInfo)
  User.Activity = 0
  User.Timer = GetTickCount()
end sub

sub UserCountBan(User as BanInfo, Message as String)
  Temp as long
  Temp = GetTickCount()
  if Len(Message) / (Temp - User.Timer) > BAN_ACTIVITY_MAX / 1000 then
     BanUser (User.Account)
  end if
  User.Timer = GetTickCount()
end sub

BAN_ACTIVITY_MAX is in allowed bytes per second!
think about it! hope it helps, but i don't know if anybody did post it yet... anyway i found this on my own ;D
EDIT:sorry for no code tags :P

DeTaiLs

please use code tags when pasting a code



titan0060

sounds like a good idea for banning 5 or 6 users, but for some of these newer bots that load like a thousand bots, thats where i think your gonna be in trouble.