dc-gui tag checker functions
 

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

dc-gui tag checker functions

Started by plop, 20 October, 2003, 06:07:50

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

plop

no need 2 ask, free 2 use for every1 in every bot.
dcgui is NOT a fake client.

--original slots/limiter functions made by nathanos (channelbot 0.9f
--modified for dcgui by plop
--tag and version check made by plop
--all stripped from artificial insanety (channelbot 0.9f mod version O.g by plop)
--big thx to yep ([TGA]YEPSSSS) and mathen/ender
--and ofcourse just_a_cat for explaining/showing me a lot about dcgui
--without him yep might not have been able 2 help me



-- this function checks if dcgui has the tag enabled, kick if not found
function CheckIfDcguiHasTagEnabled(user)
   if strfind(user.sMyInfoString, "dc-gui", 1, 1) or strfind(user.sMyInfoString, "dc.ketelhot.de", 1, 1) or strfind(user.sMyInfoString, "DCGUI", 1, 1) then
      if not strfind(user.sMyInfoString, " Pls enable your dc tag, you are now being disconnected  |")
         user:Disconnect()
         return
      end
   end
end


-- this function kicks if the dcgui version is to old (keep 12 as minimum, solves the hub tag showing 0 on entry and no faked share posible)
DCGUIMINVERSION = 2
DCGUIMINVERSION2 = 12
function VersionCheckDcgui(user)
   _,b, dcver = strfind(user.sMyInfoString,"V:0.(%x+).%x+")
   _,b, dcver2 = strfind(user.sMyInfoString,"V:0.%x+.(%d+)")
   user:SendData(" The oldest allowed version of Dcgui is 0."..DCGUIMINVERSION.."."..DCGUIMINVERSION2.." |")
   user:SendData(" You are using Dcgui version 0."..dcver.."."..dcver2.." |")
   if (tonumber(dcver2) < DCGUIMINVERSION2) or (tonumber(dcver) < DCGUIMINVERSION) then
      user:SendData(" You are using a to old client use at least version 0."..DCGUIMINVERSION.."."..DCGUIMINVERSION2.." |")
      user:SendData(" you are now being disconnected ... |")
      user:Disconnect()
      return
   end
end


-- this function checks the bandwidth limiter
-- use supressionstate "on" in data arival, "off" in userconnected
function CheckTheBandwidthDcGui(user, suppressionstate)
	s,e,dcpp = strfind(user.sMyInfoString, "%$")

	if dcpp ~= nil then
      s,e,bandwidth = strfind( dcpp, "L:(%d+%.%d+)")
      s,e,slots = strfind( dcpp, "S:(%d+)")

      if bandwidth == nil then
         s,e,bandwidth = strfind( dcpp "L:(%d+)")
      end

		if bandwidth == nil then
			bandwidth = "unlimited"
      else
         bandwidth = bandwidth * slots -- the tag shows the speed per slot
		end
         
      minBandwidth = MinbandwithlimiterChecker(user)--- use this 1 if you have different settings for different connection types
      --minBandwidth =  -- uncomments this line and place the comment on the above line if you use a single setting for all connection types
		if suppressionstate == "off" then
			user:SendData(" The minimum amount of upload bandwidth in k/s required for your class is set to: "..minBandwidth.." |")
			user:SendData(" You currently are sharing with a maximum k/s upload restriction of: "..bandwidth.." |")
			if bandwidth ~= "unlimited" then
				if (tonumber(bandwidth) < minBandwidth) then
					user:SendData(" You do not meet the minimum upload bandwidth required, and are being disconnected ... |")
               user:Disconnect()
					return
				end
			end
		elseif suppressionstate == "on" then
			if bandwidth ~= "unlimited" then
				if (tonumber(bandwidth) < minBandwidth) then
					user:SendData(" You no longer meet the minimum upload bandwidth required, and are being disconnected ... |")
					user:Disconnect()
					return
				end
			end
		end
	else
		return
	end
end


-- this function checks the slots (it normaly kicks, but it can ban user who have isane high amounts of opened slots)
-- use supressionstate "on" in data arival, "off" in userconnected
WAYTOMUCHSLOTS = 
function CheckTheSlotsDcGui(user, suppressionstate)
	s,e,dcpp = strfind(user.sMyInfoString, "%$")

	minSlots = SSBDefinitions(user, "slot")   --- use this 1 if you have different settings for different connection types
   --minSlots =  -- uncomments this line and place the comment on the above line if you use a single setting for all connection types

	if dcpp ~= nil then
		s,e,slots = strfind( dcpp, "S:(%d+)")
      maxSlots = MaxSlotChecker(user)  --- use this 1 if you have different settings for different connection types
      --maxSlots =  -- uncomments this line and place the comment on the above line if you use a single setting for all connection types
   
   if slots == nil or slots == 0 then
         user:SendData(" Don't use unlimited slots, your connection isn't unlimited either. use a preset number ... |")
         user:SendData(" you are now being disconnected ... |")
         user:Disconnect()
         return
   end
   
		if suppressionstate == "off" then
			user:SendData(" The minimum number of open slots required for your class is set to: "..minSlots.." |")
         user:SendData(" The maximum number of open slots required for your class is set to: "..maxSlots.." |")
			user:SendData(" You currently have "..slots.." open slot(s). |")
			if (tonumber(slots) < minSlots) then
				user:SendData(" You do not meet the slot minimum, and are being disconnected ... |")
				user:Disconnect()
				return
         elseif (tonumber(slots) > maxSlots) then
            if WAYTOMUCHSLOTS ~= 0 then
               if (tonumber(slots)) > WAYTOMUCHSLOTS then
                  user:SendData(" You opened so much slots that your not getting a kick  |")
                  user:SendData(" you are now being banned ... |")
                  user:Ban()
                  return
               end
            end
				user:SendData(" You do not meet the slot maximum, and are being disconnected ... |")
				user:Disconnect()
				return
			end
		elseif suppressionstate == "on" then
			if (tonumber(slots) < minSlots) then
				user:SendData(" You no longer meet the slot minimum, and are being disconnected ... |")
				user:Disconnect()
				return
         elseif (tonumber(slots) > maxSlots) then
            if WAYTOMUCHSLOTS ~= 0 then
               if (tonumber(slots)) > WAYTOMUCHSLOTS then
                  user:SendData(" You opened so much slots that you whill not get a kick  |")
                  user:SendData(" you are now being banned ... |")
                  user:Ban()
                  return
               end
            end
				user:SendData(" You no longer meet the slot maximum, and are being disconnected ... |")
				user:Disconnect()
				return
			end
		end
	else
		return
	end
end

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 <----<<

plop

tiny update.
fixed bug wich caused dcgui version 0.3.0 2 be kicked as being 2 old.
fixed suppresion mode now works correct (damn should have seen this earlyer).
function CheckIfDcguiHasTagEnabled(user, suppressionstate)
   if strfind(user.sMyInfoString, "dc-gui", 1, 1) or strfind(user.sMyInfoString, "dc.ketelhot.de", 1, 1) or strfind(user.sMyInfoString, "DCGUI", 1, 1) then
      if not strfind(user.sMyInfoString, " Pls enable your dc tag, you are now being disconnected  |")
         user:Disconnect()
         return 1
      end
   end
end


function VersionCheckDcgui(user, suppressionstate)
   _,b, dcver,dcver2 = strfind(user.sMyInfoString,"V:0.(%x+).(%x+)")
   if suppressionstate == "off" then
      user:SendData(" The oldest allowed version of Dcgui is 0."..DCGUIMINVERSION.."."..DCGUIMINVERSION2.." |")
      user:SendData(" You are using Dcgui version 0."..dcver.."."..dcver2.." |")
   end
   if (tonumber(dcver2) < DCGUIMINVERSION2) and (tonumber(dcver) <= DCGUIMINVERSION) then
      user:SendData(" You are using a to old client use at least version 0."..DCGUIMINVERSION.."."..DCGUIMINVERSION2.." |")
      user:SendData(" you are now being disconnected ... |")
      user:Disconnect()
      return 1
   elseif (tonumber(dcver) < DCGUIMINVERSION) then
      user:SendData(" You are using a to old client use at least version 0."..DCGUIMINVERSION.."."..DCGUIMINVERSION2.." |")
      user:SendData(" you are now being disconnected ... |")
      user:Disconnect()
      return 1
   end
end
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 <----<<

_Satan_

is there a script to deny hub access to those who have limited uplad bandwidths

plop

if they show the tag they cannot hide it so just kick whenever the L: shows in the tag.

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 <----<<

SMF spam blocked by CleanTalk