PtokaX forum

Archive => Archived 5.0 boards => Request for scripts => Topic started by: electronic_Psycho on 22 March, 2006, 23:51:29

Title: block users with 1 ip and diffrent names
Post by: electronic_Psycho on 22 March, 2006, 23:51:29
hey ppl  :)

i need Please Script That block users with 1 ip and diffrent names

like
psy
psy1
psy2
from same ip..

need help withthat please.. ::)
Title: Re: block users with 1 ip and diffrent names
Post by: electronic_Psycho on 23 March, 2006, 03:18:13
Hi Mutor.. Night.. ;)

To entry to hub.

You Can help please ?

i used untill now with That Script
--------------------------------
--Requested by [NL]trucker
--Made by nErBoS

Bot = ".???iN-System???."

dip = {}

function Main()
frmHub:RegBot(Bot)
end

function NewUserConnected(user, data)
if (dip[user.sIP] == nil) then
dip[user.sIP] = 1
elseif (dip[user.sIP] == 1) then
user:SendPM(Bot, "You are already connected to the HUB with another nick.")
ip2 = 1
user:Disconnect()
end
end

function UserDisconnected(user, data)
if (ip2 == 1) then
dip[user.sIP] = 1
ip2 = 0
else
dip[user.sIP] = nil
ip2 = 0
end
end
--------------------------------------------
but something wuth that script do me a problem..
& my users get blocked all the time.. even if the not mor then 1 time in the hub them get the msg
"You are already connected to the HUB with another nick"

if u can can help please
Title: Re: block users with 1 ip and diffrent names
Post by: 6Marilyn6Manson6 on 23 March, 2006, 12:52:59
--// Anti-Double-Login made by 6Marilyn6Manson6 23/03/2006
--// Include table for Immune nick

BotName = frmHub:GetHubBotName()
MessageADL = "Double-Login is not allowed in this HuB ;)"

tImmune = {
["6Marilyn6Manson6"] = 1,
["[ITA]6Marilyn6Manson6"] = 1,
}

function MyINFOArrival(curUser)
if not tImmune[curUser.sName] then
if not curUser.bOperator and not curUser.bConnected then
for _,LoggedUser in frmHub:GetOnlineNonOperators() do 
if curUser.sIP == LoggedUser.sIP then
curUser:SendData(BotName,MessageADL)
curUser:Disconnect()
end
end
end
end
end
--// 6Marilyn6Manson6


This is my light version :P
Title: Re: block users with 1 ip and diffrent names
Post by: bastya_elvtars on 23 March, 2006, 16:01:16
Now if there are 10 users behind a NAT, only 1 of them is able to connect. Very good.
Title: Re: block users with 1 ip and diffrent names
Post by: 6Marilyn6Manson6 on 23 March, 2006, 16:09:34
Yes.. this is small problem.. 90% of fastweb are blocked but.. you can added table for immune range-ip :P
Title: Re: block users with 1 ip and diffrent names
Post by: 6Marilyn6Manson6 on 23 March, 2006, 16:15:06
--// Anti-Double-Login made by 6Marilyn6Manson6 23/03/2006
--// Include table for Immune nick
--// Include table for Immune IP

BotName = frmHub:GetHubBotName()
MessageADL = "Double-Login is not allowed in this HuB ;)"

tImmune = {
["6Marilyn6Manson6"] = 1,
["[ITA]6Marilyn6Manson6"] = 1,
}

tIPImmune = {
["192.168.*"] = 1,
["213.*"] = 1,
}

function MyINFOArrival(curUser)
if not tIPImmune[curUser.sIP] then
if not tImmune[curUser.sName] then
if not curUser.bOperator and not curUser.bConnected then
for _,LoggedUser in frmHub:GetOnlineNonOperators() do 
if curUser.sIP == LoggedUser.sIP then
curUser:SendData(BotName,MessageADL)
curUser:Disconnect()
end
end
end
end
end
end
--// 6Marilyn6Manson6


This is ok
Title: Re: block users with 1 ip and diffrent names
Post by: bastya_elvtars on 23 March, 2006, 16:20:57
192.168.x.x can never be the value of user.sIP, same goes for 10.x.x.x and 172.16.x.x and 169.254.x.x
Title: Re: block users with 1 ip and diffrent names
Post by: 6Marilyn6Manson6 on 23 March, 2006, 16:22:02
Yes i know, but in script tIPImmune is only an example :)
Title: Re: block users with 1 ip and diffrent names
Post by: bastya_elvtars on 23 March, 2006, 16:27:02
A hint: the config for the immune list should be an arraa, like: tImmune = {"joe","fak0r"} and on startup you can make a hash table of it, so the config will be more user friendly.
Title: Re: block users with 1 ip and diffrent names
Post by: electronic_Psycho on 23 March, 2006, 17:09:59
 :o
Thanks You!!!! Mutor 6Marilyn6Manson6 bastya_elvtars   :-*

i go test it now!! tnx! :D