------- KONFIGURACJA ----------
local antyMagebombEnabled = 0 -- czy wlaczyc AntyMagebomb? / 0 by zablokowac
local maxClientsFromIp = 0 -- maksymalna liczba graczy z jednego ip / wpisz 0, by zablokowac
local loginPeriodSeconds = 2 -- po co najmniej ilu sekundach dozwolone zalogowanie z tego samego ip
local banAutoMagebombAccount = 0 -- automatyczna banicja KONTA Magebomb? / 0 by zablokowac
local banAutoMagebombIp = 0 -- automatyczna banicja IP Magebomb? / 0 by zablokowac
local banAccountPeriod = 2 * 60 * 60 -- w sekundach czas bana, domyslnie 2H
local banIpPeriod = 2 * 60 * 60 -- w sekundach czas bana, domyslnie 2H
------- / KONFIGURACJA --------
local last_login = os.time(t)
local last_ipaddr = 0
local magebomb_count = 0
local last_guid = 0
local last_account = 0
function onLogin(cid)
if antyMagebombEnabled == 1 then
local now = os.time(t)
local ip = getPlayerIp(cid)
local guid = getPlayerGUID(cid)
local gracz = getCreatureName(cid)
local playeracc = getAccountIdByName(gracz)
if(ip==last_ipaddr and last_guid ~= guid and last_account ~= playeracc) then
if(last_login+loginPeriodSeconds > now) then
magebomb_count = magebomb_count + 1
if magebomb_count > 1 then
if banAutoMagebombAccount == 1 then
doAddBanishment(playeracc, banAccountPeriod, 11, 2, 'Banished by AntyMagebomb System by Infinity', 0)
end
if banAutoMagebombIp == 1 then
doAddIpBanishment(ip, 4294967295, banIpPeriod, "Detected by AntyMagebomb System by Infinity")
end
end
return FALSE -- wyrzuca z gry
else
magebomb_count = 0
end
else
magebomb_count = 0
end
if maxClientsFromIp > 0 then
local list = {}
local ips = {}
local players = getPlayersOnline()
local i = 0
for i, pid in ipairs(players) do
local ip = getPlayerIp(pid)
local name = getCreatureName(pid)
local tmp = table.find(ips, ip)
if(tmp ~= nil) then
if(table.countElements(list, ip) == 0) then
list[players[tmp]] = ip
end
list[pid] = ip
end
table.insert(ips, ip)
end
if(table.maxn(list) > 0) then
for pid, ip in pairs(list) do
if getPlayerIp(cid) == ip then
i=i+1
end
end
end
if i > maxClientsFromIp and maxClientsFromIp > 0 then -- sprawdzanie ilosci graczy z tym samym IP
doPlayerPopupFYI(cid,'Sorry, only 3 multi-clients allowed (from one IP), not more!')
return FALSE
end
end
end
last_ipaddr = getPlayerIp(cid)
last_login = os.time(t)
last_guid = getPlayerGUID(cid)
last_account = playeracc
local names = getCreatureName(cid)
return true
end