I saw the script that checks for min version in DC++, but does this also work, or does it only work for DC++? = -- Simply script to disallow old DC++ clients without TTH support by PPK
-- Changed into a minversion script by blackwings
function NewUserConnected(curUser)
if curUser.bHasTag then
if curUser.sClient == "DC++" then
if tonumber(curUser.sClientVersion) < 0.401 then
curUser:SendData("Please upgrade your client, min version for in this hub is <0.401>")
curUser:Disconnect()
return 1
end
elseif curUser.sClient == "oDC" then
if tonumber(curUser.sClientVersion) < 5.0 then
curUser:SendData("Please upgrade your client, min version for in this hub is <5.0>")
curUser:Disconnect()
return 1
end
elseif curUser.sClient == "DCGUI" then
if tonumber(curUser.sClientVersion) < 0.2.20 then
curUser:SendData("Please upgrade your client, min version for in this hub is <0.2.20>")
curUser:Disconnect()
return 1
end
elseif curUser.sClient == "NMDC2" then
if tonumber(curUser.sClientVersion) < 2.02 then
curUser:SendData("Please upgrade your client, min version for in this hub is <2.02>")
curUser:Disconnect()
return 1
end
elseif curUser.sClient == "iDC++" then
if tonumber(curUser.sClientVersion) < 1.03 then
curUser:SendData("Please upgrade your client, min version for in this hub is <1.03>")
curUser:Disconnect()
return 1
end
end
end
end
hm I thought saying it with tables would help ...
I apologise for the lack of testing on this one but many things need a piece of my time ...
-- 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 )
tCl = {
["DC++"] = { 0.401, "Please upgrade your client, min version for in this hub is <0.401>" } ,
["oDC"] = { 5.0, "Please upgrade your client, min version for in this hub is <5.0>" } ,
["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>" } ,
}
function NewUserConnected(curUser)
if curUser.bHasTag and tCl[curUser.sClient] then
if tonumber(curUser.sClientVersion) < tCl[curUser.sClient][1] then
curUser:SendData(tCl[curUser.sClient][2])
curUser:Disconnect()
return 1
end
end
end
Hmm, ptokax doesn't like DCGUI min version = ["DCGUI"] = { 0.2.20, "Please upgrade your client, min version for in this hub is <0.2.20>" } ,
Fastest of patches dont always work .. but should be tried nevertheless... -- 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 )
tCl = {
["DC++"] = { "0.401", "Please upgrade your client, min version for in this hub is <0.401>" } ,
["oDC"] = { "5.0", "Please upgrade your client, min version for in this hub is <5.0>" } ,
["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>" } ,
}
function NewUserConnected(curUser)
if curUser.bHasTag and 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
end
end
I added a bad client function. Unfortunely the same method for minversion detection cannot be used. So I mad a similar thing to my Deny detection script. Because clients like DCDM doesn't have their "identification" in the usual tag, but in description. Anyway, here is the new code = -- 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
tCl = {
["DC++"] = {"0.401","Please upgrade your client, min version for in this hub is <0.401>"},
["oDC"] = {"5.0","Please upgrade your client, min version for in this hub is <5.0>"},
["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>"},
}
tClBad = {
{"<%.%P>","Phantom DC++","cccc"},
{"{"{"reverseconnect.sf.net","ReverseConnect","cccc"},
{"www.RevConnect.com","ReverseConnect","cccc"},
{"[BL]:","BCDC++","<%.%P>"},
}
function NewUserConnected(curUser)
if not curUser.bOperator then
if curUser.bHasTag and 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
end
end
end
function MyINFOArrival(User , data)
if not User.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]
User:SendData("------------------------------------------------------------------------------")
User:SendData("*** The Client <"..Client.."> isn't allowed in this hub.")
User:SendData("*** Use Original DC++, NMDC, oDC or DCGUI")
User:SendData("------------------------------------------------------------------------------")
User:Disconnect()
end
end
end
end