Help with ClientChecker
 

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

Help with ClientChecker

Started by Honey, 18 July, 2005, 21:30:00

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Honey

Hello guys,

Can you help me, please?

At this time PtokaX write this:
 This hub is running PtokaX DC Hub 0.3.3.1f [debug] Jul 16 2005 19:20:15 (UpTime: 0 days, 0 hours, 29 minutes)
Please change your client,  isn't allowed in this hub, because  can't TTH leaves. Use: original DC++, CZDC++, StrongDC++ or DCGUI!!
*** Disconnected

Please, how can I edit this line:
["oDC"] = {"6.0", "Please change your client,  isn't allowed in this hub, because  can't TTH leaves. Use: original DC++, CZDC++, StrongDC++ or DCGUI!!"},

So that PtokaX will be write this:
 This hub is running PtokaX DC Hub 0.3.3.1f [debug] Jul 16 2005 19:20:15 (UpTime: 0 days, 0 hours, 29 minutes)
Please change your client,  isn't allowed in this hub, because  can't TTH leaves. Use: original DC++, CZDC++, StrongDC++ or DCGUI!!
*** Disconnected

Thank you in advance for help!

Snooze

As i understand it, the only change you want is that the 2nd line should be send from the bot, is that correct?

If so, please supply a bit more code so we'll have something to work on..


Snooze

Honey

QuoteOriginally posted by Snooze
As i understand it, the only change you want is that the 2nd line should be send from the bot, is that correct?
Snooze
Yes, this is I think!

QuoteOriginally posted by Snooze
If so, please supply a bit more code so we'll have something to work on..
Snooze
OK, here is it:
-- Simply script to disallow old DC++ clients without TTH support by PPK

-- Changed into a minversion script by blackwings

-- Made It Into Tables by Herodes ( not tested @all but hopefully it works )

-- FIXED: version numbers with more than one numbers work - by Herodes & blackwings

-- ADDED: Bad clients to be blocked

-- ADDED: Option to block Dc++ versions 0.403-0.665



-- Stuff by Madman

-- FIXED: Bad client block error, missing then

-- ADDED: tCl2 beacuse of syntax error: attempt to compare nil with number

-- CHANGED: MyInfoArrival, from (User, data) to (curUser, data)

-- REMOVED: No need to check bOperator in NewUserConnected

-- FIXED: Detected CDM as Phantom

-- FIXED: badVer, it only checked if client version was below 401



-- FIXED: StrongDC++ giving error on badVer check

-- CHANGED: BCDC stuff =)

-- ADDED: Table to block unwanted clients

-- UPDATED: Minver for strongdc is now 1.00 RC5, 1.00 RC5 = 0.401



-- if version 0.403-0.665 of DC++ should be blocked

badVer = 1



tCl = {

	["DC++"] = { "0.401" , "Please upgrade your client, min version for  in this hub is <0.401>" },

	["oDC"] = {"6.0", "Please change your client,  isn't allowed in this hub, because  can't TTH leaves. Use: original DC++, CZDC++, StrongDC++ or DCGUI!!"},

	["DCGUI"] = { "0.2.20" , "Please upgrade your client, min version for  in this hub is <0.2.20>" },

	["NMDC2"] = { "2.02" , "Please upgrade your client, min version for  in this hub is <2.02>" },

	["iDC"] = { "1.03" , "Please upgrade your client, min version for  in this hub is <1.03>" },

}



tCl2 = {

	["StrongDC++"] = { "1.00 RC5" , "Please upgrade your client, min version for  in this hub is <1.00 RC5>" }

}



tClBad = {

	{"<.P>", "PhantomDC++","cccc"},

	{""},

}



tClBad2 = {

	["Client"] = { "Your client  isn't allowed in this hub" },

}



function NewUserConnected(curUser)

	if curUser.bHasTag then

		if badVer == 1 then

			if curUser.sClient == "StrongDC++" then

				if (curUser.sClientVersion >= "1.00 RC7") and (curUser.sClientVersion <= "1.00 RC8") then

					curUser:SendData("------------------------------------------------------------------------------")

					curUser:SendData("Clients with version numbers 403-665 isn't allowed in this hub.")

					curUser:SendData("------------------------------------------------------------------------------")

					curUser:Disconnect()

				end

			else

				if ((tonumber(curUser.sClientVersion) >= 0.403) and (tonumber(curUser.sClientVersion) <= 0.665)) then

					curUser:SendData("------------------------------------------------------------------------------")

					curUser:SendData("Clients with version numbers 403-665 isn't allowed in this hub.")

					curUser:SendData("------------------------------------------------------------------------------")

					curUser:Disconnect()

				end

			end

		end

		if tCl2[curUser.sClient] then

			if (curUser.sClientVersion) < (tCl2[curUser.sClient][1]) then

				curUser:SendData(tCl2[curUser.sClient][2])

				curUser:Disconnect()

				return 1

			end

		elseif tCl[curUser.sClient] then

			if tonumber(curUser.sClientVersion) < tonumber(tCl[curUser.sClient][1]) then

				curUser:SendData(tCl[curUser.sClient][2])

				curUser:Disconnect()

				return 1

			end

		elseif tClBad2[curUser.sClient] then

			curUser:SendData(tClBad2[curUser.sClient][1])

			curUser:Disconnect()

			return 1

		end

	end

end



--OpConnected = NewUserConnected --Uncomment to check op as well



function MyINFOArrival(curUser , data)

	if not curUser.bOperator then

		for i=1,table.getn(tClBad) do

			tClBad[i][1] = string.gsub(tClBad[i][1], "<" , "")

			if string.find(data,tClBad[i][1]) and not string.find(data,tClBad[i][3]) then

				local Client=tClBad[i][2]

				curUser:SendData("------------------------------------------------------------------------------")

				curUser:SendData("*** The Client <"..Client.."> isn't allowed in this hub.")

				curUser:SendData("*** Use Original DC++, NMDC, oDC or DCGUI")

				curUser:SendData("------------------------------------------------------------------------------")

				curUser:Disconnect()

			end

		end

	end

end

Thank you in advance for help with this :-)

SMF spam blocked by CleanTalk