Client Checker
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

Client Checker

Started by NightLitch, 22 January, 2004, 20:47:07

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

NightLitch

My new hole from the begining no copy/paste Client checker.

-- CLIENT CHECKER
--=================
-- Ver.: 0.7
-- By: NightLitch
-- Date: 2004/01/22
--=================
AllowClient = {
["++"] = "DC++",
["><"] = "oDC",
["oDC"] = "oDC",
["DC"] = "NeoModus",
["DCGUI"] = "DcGui",
["http://dc.ketelhot.de"] = "DcGui",
["DC:PRO"] = "DcPro",
}

function ParseMyInfo(MyInfo)
	local s,e,vTag = strfind( MyInfo, "^%$MyINFO %$ALL [^ ]+ [^$]*%s([^$<>]+)>%$" )
	local s,e,vSpeed,sShare = strfind( MyInfo, "^%$MyINFO %$ALL [^ ]+ [^$]*%$ $([^$]+)[^$]%$[^$]*%$%s*(%d+)%$" )
	local vShare = tonumber(sShare)
	local vShare = vShare / (1024 * 1024 * 1024)
	local vShare = format("%.2f",vShare)
	for t,n in AllowClient do
		if strfind(MyInfo,t) then
			vClient = n
		end
	end
	return vClient, vTag, vSpeed, vShare
end

function GetTagInfo(vTag)
	local _,_,DcVer = strfind(vTag, "V:(%x+.%x*)")
	local _,_,Mode = strfind(vTag, "M:([S,A,P,5])")
	local _,_,Hubs = strfind(vTag, "H:(%d+/%d+/%d+)")
	local _,_,Slots = strfind(vTag, "S:(%d+)")
	if strfind(vTag, "L:(%d+)") then 
		local _,_,Ls = strfind(vTag, "L:(%d+)")
		Bwidh = Ls
	elseif strfind(vTag, "B:(%d+)") then 
		local _,_,Bs = strfind(vTag, "B:(%d+)")
		Bwidh = Bs
	elseif strfind(vTag, "F:(%d+)/%d+") then
		local _,_,Fs = strfind(vTag, "F:(%d+)/%d+")
		Bwidh = Fs
	else
		Bwidh = "unlimited"
	end

	if Hubs == nil then
		FakeClient = 1
	else
		local _,_,Hub,RegHub,OpHub = strfind(Hubs, "(%d+)/(%d+)/(%d+)")
	end
	return DcVer, Mode, Slots, Hub, RegHub, OpHub, Bwidh
end

function NewUserConnected(curUser)
	local vClient, vTag, vSpeed, vShare = ParseMyInfo(curUser.sMyInfoString)

	if vClient == nil then
		curUser:SendData("Client-Check",curUser.sName.." Your Client is not allowed here!")
		curUser:Disconnect()
	elseif vTag == nil then
		curUser:SendData("No-Tag",curUser.sName.." you are hidding your Tag!")
		curUser:Disconnect()
	end

	local DcVer, Mode, Slots, Hub, RegHub, OpHub, Bwidh = GetTagInfo(vTag)
	
	if FakeClient == 1 then
		curUser:SendData("Faker",curUser.sName.." you are using a Fake Client")
		curUser:Disconnect()
		FakeClient = 0
	end
end

Checking slots, hubs, versions will come later.

NOTE! This is in User Connect so this is just to show my upcoming script.

Will be rewritten in Data Arrival soon!!

Hope you all like it.

And Plop, Chilla, Phatty, Tezlo and others,
Tell me what I can think of in this script, my point is to
fakers now.
And improvments.
//NL

c h i l l a

#1
k

NightLitch

If I make it as it is now to local client is nil...

but gonna work on this some more later.
//NL

NightLitch

just notice one thing, and I find your function I got is better. gonna check it out more...

Cause getting wrong version on old oDC
//NL

c h i l l a

#4
k

[NL]trucker

Nightlitch

AllowClient = {
["++"] = "DC++",
["><"] = "oDC",
["oDC"] = "oDC",
["DC"] = "NeoModus",
["DCGUI"] = "DcGui",
["http://dc.ketelhot.de"] = "DcGui",
["DC:PRO"] = "DcPro",
}


what about non-allowed clients?
 
like dc++k or black dc

i think it is better to make a list of al clients and then with the option to allow or not allow.

and i had a normal user using odc who had his tag but i had in ptotax the option turned on dont allow clients with no dc++ tag on and he could,nt get in.

so perhaps a warn on this one should be better.

elseif vTag == nil then
      curUser:SendData("No-Tag",curUser.sName.." you are hidding your Tag!")
      curUser:Disconnect()

but i like the idear alot and perhaps if yuu asked phatty he could give you some descriptions on various tags; cause i know he was trying to do the same.
Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


NightLitch

#6
Here's a update, and this should work with out no bigger problems expect it doesn't detect fake hubs yet.

-- CLIENT CHECKER
--=================
-- Ver.: 1.03
-- By: NightLitch
-- Date: 2004/01/23
--=================

Bot = "Z-LeZ"

AllowClient = {
["<++"] = "DC++",
["<") then
		local _,_,DcVer = strfind(MyInfo , "")
		Version = DcVer
	else
		local _,_,DcVer = strfind(MyInfo , "V:(.+),M")
		Version = DcVer
	end
	local _,_,Mode = strfind(MyInfo , "M:([S,A,P,5])")
	local _,_,Hubs = strfind(MyInfo , "H:(%S+),S")
	local _,_,Slots = strfind(MyInfo , "S:(%d+)")
	if strfind(MyInfo, "L:(%d+)") then 
		local _,_,Ls = strfind(MyInfo , "L:(%d+)")
		Bwidh = Ls
	elseif strfind(MyInfo, "B:(%d+)") then 
		local _,_,Bs = strfind(MyInfo , "B:(%d+)")
		Bwidh = Bs
	elseif strfind(MyInfo, "F:(%d+)/%d+") then
		local _,_,Fs = strfind(MyInfo , "F:(%d+)/%d+")
		Bwidh = Fs
	else
		Bwidh = "unlimited"
	end

	vTag = { ["V"] = Version, ["M"] = Mode, ["H"] = Hubs, ["S"] = Slots, ["B"] = Bwidh} 
	if vTag == nil then
		vTag = { ["V"] = "N/A", ["M"] = "N/A", ["H"] = "N/A", ["S"] = "N/A", ["B"] = "N/A"}
	end
	return vClient, vTag, vSpeed, vShare
end

function NewUserConnected(curUser)
	local vClient, vTag, vSpeed, vShare = ParseMyInfo(curUser.sMyInfoString)

	local Msg = "\r\n\r\n"
	Msg = Msg .. "\r\n My Info Check "
	Msg = Msg .. "\r\n---------------------"
	Msg = Msg .. "\r\n Client: "..vClient..""
	Msg = Msg .. "\r\n Version: "..vTag["V"]..""
	Msg = Msg .. "\r\n Mode: "..vTag["M"]..""
	Msg = Msg .. "\r\n Slots: "..vTag["S"]..""
	Msg = Msg .. "\r\n Hubs: "..vTag["H"]..""
	Msg = Msg .. "\r\n Bandwidh: "..vTag["B"]..""
	Msg = Msg .. "\r\n---------------------"

	curUser:SendData(Bot,Msg)
end

function DataArrival(curUser,data)
	if (strsub(data,1,7) == "$MyINFO") then
		local vClient, vTag, vSpeed, vShare = ParseMyInfo(data)

		if vClient == nil then
			curUser:SendData(Bot,curUser.sName.." Your Client is not allowed here!")
			curUser:Disconnect()
		elseif vTag == nil then
			curUser:SendData(Bot,curUser.sName.." You are hidding your Tag!")
			curUser:Disconnect()
		end
	end
end

and Trucker about the client tag above is the most common clients.

dc++k have the same Tag as Dc++ ( <++ )
better use DC++ CMD then.

and Black DC can't be script or I don't know how.
//NL

c h i l l a

#7
k

plop

QuoteOriginally posted by NightLitch
Here's a update, and this should work with out no bigger problems expect it doesn't detect fake hubs yet.

and Trucker about the client tag above is the most common clients.

dc++k have the same Tag as Dc++ ( <++ )
better use DC++ CMD then.

and Black DC can't be script or I don't know how.
the old k fakers series have a k behind the version number.
a simple way 2 capture those is not 2 only search for a number but also for the K.

plop
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

NightLitch

k, thx alot plop, your words mean so much for me, like your
opinions thx.

Gonna optimize it more. As it say's above this is my first
client check without copy/paste. So the strfind is a little
new still for me.

/NL
//NL

NightLitch

#10
IF I can make vClient local pls show me... I don't get it working...

Am using Chilla's strfind/info line now.

Chilla maybe you could explain for me how you mean with
local vClient ???

notice I gave Plop the credits and forgot you. sry.
//NL

c h i l l a

got me, damn I feel like a baby.

just also do

function ParseMyInfo(MyInfo)
     local vClient = "N/A"
or

    local Client = ""

depends on what you need

NightLitch

ThX forgot I could do it like that. Thx Chilla.
//NL

NightLitch

what about this one then:

-- CLIENT CHECKER
--=================
-- Ver.: 1.05
-- By: NightLitch
-- Date: 2004/01/23
--=================

Bot = "Z-LeZ"

AllowClient = {
{ "<%+%+","oDC" },
{ "<") then
		local _,_,DcVer = strfind(MyInfo , "")
	end
	if strfind(MyInfo, "L:(%d+)") then 
		local _,_,Ls = strfind(MyInfo , "L:(%d+)")
		Bwidh = Ls
	elseif strfind(MyInfo, "B:(%d+)") then 
		local _,_,Bs = strfind(MyInfo , "B:(%d+)")
		Bwidh = Bs
	elseif strfind(MyInfo, "F:(%d+)/%d+") then
		local _,_,Fs = strfind(MyInfo , "F:(%d+)/%d+")
		Bwidh = Fs
	else
		Bwidh = "unlimited"
	end
	vTag = { ["V"] = DcVer, ["M"] = Mode, ["H"] = Hubs, ["S"] = Slots, ["B"] = Bwidh} 
	return vClient, vTag, vSpeed, vShare
end

function NewUserConnected(curUser)
	local vClient, vTag, vSpeed, vShare = ParseMyInfo(curUser.sMyInfoString)

	local Msg = "\r\n\r\n"
	Msg = Msg .. "\r\n My Info Check "
	Msg = Msg .. "\r\n---------------------"
	Msg = Msg .. "\r\n Client: "..vClient..""
	Msg = Msg .. "\r\n Version: "..vTag["V"]..""
	Msg = Msg .. "\r\n Mode: "..vTag["M"]..""
	Msg = Msg .. "\r\n Slots: "..vTag["S"]..""
	Msg = Msg .. "\r\n Hubs: "..vTag["H"]..""
	Msg = Msg .. "\r\n Bandwidh: "..vTag["B"]..""
	Msg = Msg .. "\r\n---------------------"

	curUser:SendData(Bot,Msg)
end

function DataArrival(curUser,data)
	if (strsub(data,1,7) == "$MyINFO") then
		local vClient, vTag, vSpeed, vShare = ParseMyInfo(data)
--
--		if vClient == nil then
--			curUser:SendData(Bot,curUser.sName.." Your Client is not allowed here!")
--			curUser:Disconnect()
--		elseif vTag == nil then
--			curUser:SendData(Bot,curUser.sName.." You are hidding your Tag!")
--			curUser:Disconnect()
--		end
	end
end

Come with more opinions. plz. optimizing etc.
//NL

plop

the version number not the start of the tag on k, for example.
<++ V:0.178k, etc.....  

no need 2 declare vShare 2 being local 4x, the 1st time you use it is enough.

plop
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

NightLitch

thx Plop. anymore I should now. One question do, I faked my Tag enormuslly in your hub and got kicked.
but got in, in mine. why. get kick came on hubs. and I didn't fake with " " just used NMDC EMU and put in a hole tag. What did your check sence or do, other words
how did you script that part.
//NL

NightLitch

Yet another new version:

-- CLIENT CHECKER
--=================
-- Ver.: 1.07
-- By: NightLitch
-- Date: 2004/01/24
--=================

Bot = "Z-LeZ"

AllowClient = {
{ "<%+%+","oDC" },
{ "<") then
		local _,_,DcVer = strfind(MyInfo , "")
	end
	if strfind( MyInfo,"V:%S+(k),M") then
		vClient = "DC++k"
	end
	if strfind(MyInfo, "L:") then 
		local _,_,Ls = strfind(MyInfo , "L:(%d+)")
		Bwidh = Ls
	elseif strfind(MyInfo, "B:") then 
		local _,_,Bs = strfind(MyInfo , "B:(%d+)")
		Bwidh = Bs
	elseif strfind(MyInfo, "F:") then
		local _,_,Fs = strfind(MyInfo , "F:%d+/(%d+)")
		Bwidh = Fs
	else
		Bwidh = "unlimited"
	end
	if strfind(MyInfo,"H:(\")%d+/") then
		vClient = "Fake"
	end
	tMode = {
	["S"] = "Socks",
	["A"] = "Active",
	["P"] = "Passive",
	["5"] = "Socks5",
	}
	vTag = { ["V"] = DcVer, ["M"] = tMode[Mode], ["H"] = Hubs, ["S"] = Slots, ["B"] = Bwidh} 
	return vClient, vTag, vSpeed, vShare
end

function NewUserConnected(curUser)
	local vClient, vTag, vSpeed, vShare = ParseMyInfo(curUser.sMyInfoString)

	local Msg = "\r\n\r\n"
	Msg = Msg .. "\r\n My Info Check "
	Msg = Msg .. "\r\n---------------------"
	Msg = Msg .. "\r\n Client: "..vClient..""
	Msg = Msg .. "\r\n Version: "..vTag["V"]..""
	Msg = Msg .. "\r\n Mode: "..vTag["M"]..""
	Msg = Msg .. "\r\n Slots: "..vTag["S"]..""
	Msg = Msg .. "\r\n Hubs: "..vTag["H"]..""
	Msg = Msg .. "\r\n Bandwidh: "..vTag["B"].." kB/s"
	Msg = Msg .. "\r\n---------------------"

	curUser:SendData(Bot,Msg)
end

function DataArrival(curUser,data)
	if (strsub(data,1,7) == "$MyINFO") then
		local vClient, vTag, vSpeed, vShare = ParseMyInfo(data)
		if vClient == nil then
			curUser:SendData(Bot,curUser.sName.." no tag info found!")
			curUser:Disconnect()
		end
		if vClient == "Fake" then
			curUser:SendData(Bot,curUser.sName.." you are using a fake tag or client!")
			curUser:Disconnect()
		end
	end
end

analyse this one to... :-D
//NL

plop

QuoteOriginally posted by NightLitch
thx Plop. anymore I should now. One question do, I faked my Tag enormuslly in your hub and got kicked.
but got in, in mine. why. get kick came on hubs. and I didn't fake with " " just used NMDC EMU and put in a hole tag. What did your check sence or do, other words
how did you script that part.
don't know what you faked in the tag, but basicly what i do is kick/ban everything which is not normal.
a.i. is locked up like hell. lol
this is why i had sutch a lot of work 2 add support for the new odc tag.
the quick fix i tryed on that caused incompatebilety with testdrive so i had 2 rewrite nearly the whole core of the tag checking stuff.
but it was sure worth it, i can make it even more locked now.
for every client a.i. supports it has a dedicated routine (currently 7) 2 filter out as much as posible faked tags (if needed).
btw no need 2 build sutch things for dcgui, they can't fake unless they alter it in the source, mathen made it imposible 2 use the < > in the description.

plop
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

[NL]trucker

#18
nightlitch


Perhaps it is an idear to add an on/off switch for each client so that any hubowner can decide wich to pass or wich to deny.

and i see your added socks5 could it fall under that to?

as it could be used to fake.
Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


NightLitch

Will see what I can do, this client check was ment to be as simple as it can be.

cause gonna use it the script-builder(Bot-Builder) me
and WooshMan gonna/are creating.

But sure can add some more features l8r, np.
//NL

NightLitch

#20
Here is some more features and updates hope you all like it.

-- CLIENT CHECKER
-- Ver.: 1.16
-- By: NightLitch
-- Date: 2004/01/25
---------------------------------------------------------------------

Bot = "Z-LeZ"

-- Allow Clients / 1:on/0:off

AllowDCPP = 1		-- DC++
AllowODC = 1		-- oDC
AllowNMDC2 = 1	-- Neo Modus DC 2
AllowDCGUI = 1		-- DcGui
AllowDCPRO = 1	-- DC:PRO
AllowNOTAG = 0		-- No Tag Client ex: Neo Modus DC 1
AllowFAKE = 0		-- Fake Client (Fake Taging)

-- Client Settings

MinSlots = 2
MaxSlots = 5
MaxHubs = 8

---------------------------------------------------------------------

ClientTAG = {
{ "<%+%+","oDC" },
{ "<") then
		local _,_,DcVer = strfind(MyInfo , "")
	end
	
	if strfind( MyInfo,"V:%S+(k),M") then
		vClient = "DC++k"
	end
	
	if strfind(MyInfo, "L:") then 
		local _,_,Ls = strfind(MyInfo , "L:(%d+)")
		Bwidh = Ls
	elseif strfind(MyInfo, "B:") then 
		local _,_,Bs = strfind(MyInfo , "B:(%d+)")
		Bwidh = Bs
	elseif strfind(MyInfo, "F:") then
		local _,_,Fs = strfind(MyInfo , "F:%d+/(%d+)")
		Bwidh = Fs
	else
		Bwidh = "unlimited"
	end

	if strfind(MyInfo,"H:(\")%d+/") then
		vClient = "Fake"
	end

	if DcVer == nil or Mode == nil or Hubs == nil or Slots == nil then
	DcVer = "N/A" Mode = "0" Hubs = "N/A" Slots = "N/A"
	end

	tMode = {
	["S"] = "Socks",
	["A"] = "Active",
	["P"] = "Passive",
	["5"] = "Socks5",
	["0"] = "N/A",
	}

	vTag = { ["V"] = DcVer, ["M"] = tMode[Mode], ["H"] = Hubs, ["S"] = Slots, ["B"] = Bwidh}
	return vClient, vTag, vSpeed, vShare
end

function NewUserConnected(curUser)
	local vClient, vTag, vSpeed, vShare = ParseMyInfo(curUser.sMyInfoString)

	local Msg = "\r\n\r\n"
	Msg = Msg .. "\r\n My Info Check "
	Msg = Msg .. "\r\n---------------------"
	Msg = Msg .. "\r\n Client: "..vClient..""
	Msg = Msg .. "\r\n Version: "..vTag["V"]..""
	Msg = Msg .. "\r\n Mode: "..vTag["M"]..""
	Msg = Msg .. "\r\n Slots: "..vTag["S"]..""
	Msg = Msg .. "\r\n Hubs: "..vTag["H"]..""
	Msg = Msg .. "\r\n Bandwidh: "..vTag["B"].." kB/s"
	Msg = Msg .. "\r\n---------------------"

	curUser:SendData(Bot,Msg)
end

function DataArrival(curUser,data)
	if (strsub(data,1,7) == "$MyINFO") then
		local vClient, vTag, vSpeed, vShare = ParseMyInfo(data)
		AllowClients(curUser,vClient)
	end
end

function AllowClients(curUser,vClient)
	if (vClient =="oDC" and AllowODC==1) then
		CheckSlotsHubs(curUser,vTag)
	elseif (vClient =="DC++" and AllowDCPP==1) then
		CheckSlotsHubs(curUser,vTag)
	elseif (vClient =="DC:PRO" and AllowDCPRO==1) then
		CheckSlotsHubs(curUser,vTag)
	elseif (vClient =="DCGUI" and AllowDCGUI==1) then
		CheckSlotsHubs(curUser,vTag)
	elseif (vClient =="NeoModus 2" and AllowNMDC2==1) then
		CheckSlotsHubs(curUser,vTag)
	elseif (vClient =="Fake" and AllowFAKE==1) then
		CheckSlotsHubs(curUser,vTag)
	elseif (vClient =="Unknown" and AllowNOTAG==1) then
		CheckSlotsHubs(curUser,vTag)
	elseif (vClient =="Fake" and AllowFAKE==0) then
		curUser:SendData(Bot,curUser.sName.." you are using a fake tag or client!")
		curUser:Disconnect()
	elseif (vClient =="Unknown" and AllowNOTAG==0) then
		curUser:SendData(Bot,curUser.sName.." you are using a client with no tag!")
		curUser:Disconnect()
	else
		curUser:SendData(Bot,curUser.sName..", "..vClient.." is not allowed here!")
		curUser:Disconnect()
	end
end

function CheckSlotsHubs(curUser,vTag)
	if (tonumber(vTag["S"]) < MinSlots) then
		curUser:SendData(Bot,"You have too litle slots open ( "..vTag["S"].." ) Minimum slots is ( "..MinSlots.." ). ")
		curUser:Disconnect()
	elseif (tonumber(vTag["S"]) > MaxSlots) then
		curUser:SendData(Bot,"You have too many slots open ( "..vTag["S"].." ) Maximum slots is ( "..MaxSlots.." ). ")
		curUser:Disconnect()
	elseif (tonumber(vTag["H"]) > MaxHubs) then
		curUser:SendData(Bot,"You are in too many hubs ( "..vTag["H"].." ) Max Hubs is ( "..MaxHubs.." ). ")
		curUser:Disconnect()
	end
end


More too come.
//NL

NightLitch

Probobly the finished version I guess, but you never now...

-- CLIENT CHECKER
-- Version: 2.02
-- By: NightLitch
-- Date: 2004/01/25
---------------------------------------------------------------------

Bot = "Z-LeZ"

--Level Checks / 1:on/0:off

LC = {
[0] = 0,	-- Check Masters
[1] = 0,	-- Check Operators
[2] = 1,	-- Check VIPs
[3] = 1,	-- Check REGs
[-1] = 1,	-- Check Users
}

-- Allow Clients / 1:on/0:off

AllowDCPP = 1		-- DC++
AllowODC = 1		-- oDC
AllowNMDC2 = 1	-- Neo Modus DC 2
AllowDCGUI = 1		-- DCGUI
AllowDCPRO = 1	-- DC:PRO
AllowNOTAG = 0		-- No Tag Client ex: Neo Modus DC 1
AllowFAKE = 0		-- Fake Client (Fake Taging)

-- Client Settings

MinSlots = 2		-- Min Slots
MaxSlots = 15		-- Max Slots
MaxHubs = 8		-- Max Hubs for users
LockBW = 10		-- Min Bandwidh Lock

-- Version Checks

DCPPver = 0.300		-- DC++ Min. Version
ODCver = 5.2			-- oDC Min. Version
NMDC2ver = 2.02		-- Neo Modus DC 2 Min. Version
DCPROver = "0.2.2.10"	-- DC:PRO Min. Version
DCGUIver = "0.2.20"		-- DCGUI Min. Version

---------------------------------------------------------------------

ClientTAG = {
{ "<%+%+","oDC" },
{ "<") then
		local _,_,DcVer = strfind(MyInfo , "")
	end
	
	if strfind( MyInfo,"V:%S+(k),M") then
		vClient = "DC++k"
	end
	
	if strfind(MyInfo, "L:") then 
		local _,_,Ls = strfind(MyInfo , "L:(%d+)")
		Bwidh = Ls
	elseif strfind(MyInfo, "B:") then 
		local _,_,Bs = strfind(MyInfo , "B:(%d+)")
		Bwidh = Bs
	elseif strfind(MyInfo, "F:") then
		local _,_,Fs = strfind(MyInfo , "F:%d+/(%d+)")
		Bwidh = Fs
	else
		Bwidh = "unlimited"
	end

	if strfind(MyInfo,"H:(\")%d+/") then
		vClient = "Fake"
	end

	if DcVer == nil or Mode == nil or Hubs == nil or Slots == nil then
	DcVer = "N/A" Mode = "0" Hubs = "N/A" Slots = "N/A"
	end

	tMode = {
	["S"] = "Socks",
	["A"] = "Active",
	["P"] = "Passive",
	["5"] = "Socks5",
	["0"] = "N/A",
	}

	local _,_,Hubs,rHub,oHub = strfind(Hubs,"(%d+)/(%d+)/(%d+)")
	
	vTag = { ["V"] = DcVer, ["M"] = tMode[Mode], ["H"] = Hubs, ["S"] = Slots, ["B"] = Bwidh}
	return vClient, vTag, vSpeed, vShare
end

function NewUserConnected(curUser)
	local vClient, vTag, vSpeed, vShare = ParseMyInfo(curUser.sMyInfoString)

	local Msg = "\r\n\r\n"
	Msg = Msg .. "\r\n Welcome "..curUser.sName.." !"
	Msg = Msg .. "\r\n-------------------------------------------"
	Msg = Msg .. "\r\n "
	Msg = Msg .. "\r\n You are using "..vClient.." Version: "..vTag["V"].."."
	Msg = Msg .. "\r\n You are Sharing "..vShare.." Gb and "..vTag["S"].." Slot(s)."
	Msg = Msg .. "\r\n You are in "..vTag["H"].." Hub(s)."
	Msg = Msg .. "\r\n Your Bandwidh is "..vTag["B"].." kB/s"
	Msg = Msg .. "\r\n "
	Msg = Msg .. "\r\n-------------------------------------------"
	curUser:SendData(Bot,Msg)
end

function DataArrival(curUser,data)
	if (strsub(data,1,7) == "$MyINFO") then
		local vClient, vTag, vSpeed, vShare = ParseMyInfo(data)
		AllowClients(curUser,vClient,vTag)
	end
end

function AllowClients(curUser,vClient,vTag)
	if (LC[curUser.iProfile]==1) then
		if (vClient =="oDC" and AllowODC==1) then
			CheckSlotsHubs(curUser,vTag)
			VersionCheck(curUser,vClient,vTag,ODCver,"http://gempond.com/odc")
			BandwidhCheck(curUser,vTag)
		elseif (vClient =="DC++" and AllowDCPP==1) then
			CheckSlotsHubs(curUser,vTag)
			VersionCheck(curUser,vClient,vTag,DCPPver,"http://dcplusplus.sourceforge.net")
			BandwidhCheck(curUser,vTag)
		elseif (vClient =="DC:PRO" and AllowDCPRO==1) then
			CheckSlotsHubs(curUser,vTag)
			VersionCheck(curUser,vClient,vTag,DCPROver,"http://btpro.altervista.org/index.php")
			BandwidhCheck(curUser,vTag)
		elseif (vClient =="DCGUI" and AllowDCGUI==1) then
			CheckSlotsHubs(curUser,vTag)
			VersionCheck(curUser,vClient,vTag,DCGUIver,"http://dc.ketelhot.de")
			BandwidhCheck(curUser,vTag)
		elseif (vClient =="NeoModus 2" and AllowNMDC2==1) then
			CheckSlotsHubs(curUser,vTag)
			VersionCheck(curUser,vClient,vTag,NMDC2ver,"http://neo-modus.com")
			BandwidhCheck(curUser,vTag)
		elseif (vClient =="Fake" and AllowFAKE==1) then
			CheckSlotsHubs(curUser,vTag)
			VersionCheck(curUser,vClient,vTag,DCPPver,"http://dcplusplus.sourceforge.net")
			BandwidhCheck(curUser,vTag)
		elseif (vClient =="Unknown" and AllowNOTAG==1) then

		elseif (vClient =="Fake" and AllowFAKE==0) then
			curUser:SendData(Bot,curUser.sName.." you are using a fake tag or client!")
			curUser:Disconnect()
		elseif (vClient =="Unknown" and AllowNOTAG==0) then
			curUser:SendData(Bot,curUser.sName.." you are using a client with no tag!")
			curUser:Disconnect()
		else
			curUser:SendData(Bot,curUser.sName..", "..vClient.." is not allowed here!")
			curUser:Disconnect()
		end
	end
end

function CheckSlotsHubs(curUser,vTag)
	if (tonumber(vTag["S"]) < MinSlots) then
		curUser:SendData(Bot,"You have too litle slots open ( "..vTag["S"].." ) Minimum slots is ( "..MinSlots.." ). ")
		curUser:Disconnect()
	elseif (tonumber(vTag["S"]) > MaxSlots) then
		curUser:SendData(Bot,"You have too many slots open ( "..vTag["S"].." ) Maximum slots is ( "..MaxSlots.." ). ")
		curUser:Disconnect()
	elseif (tonumber(vTag["H"]) > MaxHubs) then
		curUser:SendData(Bot,"You are in too many hubs ( "..vTag["H"].." ) Max Hubs is ( "..MaxHubs.." ). ")
		curUser:Disconnect()
	end
end

function VersionCheck(curUser,vClient,vTag,Version,Download)
	if (vClient == "DCGUI" or vClient == "DC:PRO") then
		if (vTag["V"] < Version) then
			curUser:SendData(Bot,"You are using "..vClient.." version [ "..vTag["V"].." ]") 
			curUser:SendData(Bot,"The oldest version allowed is "..vClient.." [ "..Version.." ], you may download the latest "..vClient.." at "..Download) 
			curUser:Disconnect()
		end
	else
		if (tonumber(vTag["V"]) < tonumber(Version)) then
			curUser:SendData(Bot,"You are using "..vClient.." version [ "..vTag["V"].." ]") 
			curUser:SendData(Bot,"The oldest version allowed is "..vClient.." [ "..Version.." ], you may download the latest "..vClient.." at "..Download) 
			curUser:Disconnect()
		end
	end
end

function BandwidhCheck(curUser,vTag)
	if vTag["B"] == "unlimited" then
	elseif (tonumber(vTag["B"]) < LockBW) then
		curUser:SendData(Bot,"You are using a Bandwidh Locker, locked to ( "..vTag["B"].."  kB/s  ), Minimum is ( "..LockBW.." kB/s ).") 
		curUser:Disconnect()
	end
end

Hope it works ok... :-)
//NL

kepp

AllowClients = {
   ["<++"] = 1,
   ["oDC"] = 1,
   ["DC"] = 0,
   ["DCGUI"] = 1,
   ["http://dc.ketelhot.de"] = 1,
   ["DC:PRO"] = 1
}

This is how i allow or block clients from entering my hub..

for key,v in AllowClients do
   if strfind(user.sMyInfoString,key) and ((v == 0)) then
Guarding    

Woodster

Hi having a few probs

was wondering does the bot name show up in user list?? bacause it is not in mine??

Woodster

:))
Owner of UK...     dc-hubs2     ...UK
Main Address dc-hubs2.ath.cx
Alt Address dc-hubs.no-ip.com
Apart of DC-HUBS NETWORK

[NL]trucker

Woodster

QuoteHi having a few probs

was wondering does the bot name show up in user list?? bacause it is not in mine??

Woodster



nope this bot isnt showing in userlist.
Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


SMF spam blocked by CleanTalk