PtokaX forum

Archive => Archived 4.0 boards => Help with Lua 4 scripts => Topic started by: blackwings on 05 October, 2004, 18:07:59

Title: pDC++ get identfied as...
Post by: blackwings on 05 October, 2004, 18:07:59
Why does Phantom DC get identified as BCDC++ when there is no [BL]: in Phantom DC's description?

Here is the code that identify BCDC++ =

Client=""

if strsub(data, 1, 7) == "$MyINFO" then
if strfind(data, "<++") then
Client="Original DC"
elseif strfind(data, "[BL]:") then
Client="BCDC++"
        end
end
Title:
Post by: bastya_elvtars on 05 October, 2004, 18:17:43
this is cause of b/w limiting

se this, from lawmaker (NL requested this 2):
function determineclient(user)
local clienttype, version
if strfind(user.sMyInfoString," clienttype="DCGUI"
_,_, version = strfind(user.sMyInfoString,"V:0.(%d+.%d+)")
elseif strfind(user.sMyInfoString,"<++") or strfind(user.sMyInfoString," if strfind(user.sMyInfoString," clienttype = "oDC"
_,_,version=strfind(user.sMyInfoString,"V:(%d+.%d+)")
elseif strfind(user.sMyInfoString," clienttype = "oDC"
_,_,version=strfind(user.sMyInfoString," elseif (strfind(user.sMyInfoString,"reverseconnect.sf.net" )or strfind(user.sMyInfoString,"www.RevConnect.com")) then
clienttype = "ReverseConnect"
_,_,version=strfind(user.sMyInfoString,"V:(0.%d+)")
elseif strfind(user.sMyInfoString,"  clienttype = "DCDM++"
 _,_,version=strfind(user.sMyInfoString," elseif strfind(user.sMyInfoString,"  clienttype="rmDC++"
 _,_,version=strfind(user.sMyInfoString,"V:(0.%d+)")
elseif strfind(user.sMyInfoString,"  clienttype="DC@fe++"
 _,_,version=strfind(user.sMyInfoString,"V:(0.%d+)")
elseif strfind(user.sMyInfoString,"  clienttype="MS++V"
 _,_,version=strfind(user.sMyInfoString,"V:(0.%d+)")
elseif strfind(user.sMyInfoString," clienttype="DC:PRO"
_,_,version=strfind(user.sMyInfoString,"V:([^,]+).")
elseif strfind(user.sMyInfoString,"V:0.%d+%a") then
 clienttype = "CZDC++"
 _,_,version=strfind(user.sMyInfoString,"V:(0.%d+)")
elseif strfind(user.sMyInfoString,"zDC++") then
 clienttype = "zDC++"
 _,_,version=strfind(user.sMyInfoString,"V:(0.%d+)")
elseif strfind(user.sMyInfoString,"  clienttype="StrongDC++"
 _,_,version=strfind(user.sMyInfoString,"V:([^,]+).")
elseif strfind(user.sMyInfoString,"<.P>") then
 clienttype=".PhantomDC++"
 _,_,version=strfind(user.sMyInfoString,"V:(0.%d+)")
elseif strfind(user.sMyInfoString,"  clienttype="DC++k CDM"
 _,_,version=strfind(user.sMyInfoString," elseif strfind(user.sMyInfoString,"  clienttype="iDC++"
 _,_,version=strfind(user.sMyInfoString,"V:(0.%d+)")
elseif strfind(user.sMyInfoString,"v%[") then
 clienttype = "nDC++"
 _,_,version=strfind(user.sMyInfoString,"V:(0.%d+)")
elseif strfind(user.sMyInfoString,"[BL]:") then
 clienttype = "BCDC++"
 _,_,version=strfind(user.sMyInfoString,"V:(0.%d+)")
else
clienttype = "DC++"
_,_,version=strfind(user.sMyInfoString,"V:(0.%d+)")
end
end
return clienttype, version
end

PS: i know this needs 2 be cleaned up, but sorry
Title:
Post by: Herodes on 05 October, 2004, 18:20:00
"[BL]:" says to lua to find either "B:" or "L:" if pDC++ has those in the tag then they'll be recognised as BCDC++ ...

probably make another ' elseif ' in that dataArrival searching for the begining of the tag ... I am not sure but I think it is "
[*edit*] bast u are a sec too fast ;)
Title:
Post by: blackwings on 15 October, 2004, 10:42:07
hmm, I was thinking about the tag sequence you use to search for BCDC++ in scripting.
 If you have just [BL]:, all clients that has bandwith limiting and has it visible in their description tag, will get detected as BCDC++.

So I was thinking, where in the tag is the [BL]: for BCDC++.
If it's in the beginning, then why don't search for <[BL]: or ^[BL]:  ?
(both BCDC++ and pDC++ use the same way to show version, so the version search doesn't help here)
Title:
Post by: bastya_elvtars on 15 October, 2004, 11:18:28
if u search for the "<.P>" in the myinfo before the "[BL]" then u will get if its pdc
Title:
Post by: NightLitch on 15 October, 2004, 11:37:34
best way to get the right client for the bandwidth is to do an
standalone if after the client check.

ex:


if strfind(user.sMyInfoString, "[BL]:") and clienttype ~= ".PhantomDC++" then
    clienttype = "BCDC++"
end


now is only PhantomDC++ here just put the others that should not be taken as BCDC++ client there to eg.

clienttype ~= "client1" or clienttype ~= "client2" or clienttype ~= "client3"

you get the point...

/NightLitch
Title:
Post by: bastya_elvtars on 15 October, 2004, 11:45:37
yea, watch the code i posted, it works. altho gonna change it 2 table (btw would be hard, as it is more exact then shouuld :D)
Title:
Post by: blackwings on 15 October, 2004, 12:22:09
QuoteOriginally posted by bastya_elvtars
yea, watch the code i posted, it works. altho gonna change it 2 table (btw would be hard, as it is more exact then shouuld :D)

hmm, maybe you do more checks in another function in the script, because this isn't enough to make the script tell them apart (I use these in my deny client script and that isn't enough)=--pDC++
(user.sMyInfoString,"<.P>")
strfind(user.sMyInfoString,"V:(0.%d+)")

--BCDC++
strfind(user.sMyInfoString,"[BL]:")
strfind(user.sMyInfoString,"V:(0.%d+)")
I have made a different solution, check version 4.2 of my deny client script
Title:
Post by: bastya_elvtars on 15 October, 2004, 12:33:35
Quote[12:36] <-LawMaker->

Information on bastya_elvtars
=====================================

Profile: Superoperator
IP address: 160.114.xxx.xxx
Connection type: LAN(T3)
Mode: Active
Shared: 87.58 GB
Total hubs: 5
Hubs as guest: 2
Hubs as registered user: 1
Hubs as operator: 2
Number of slots: 20
Slot/hub ratio: 4
Bandwidth limiting: 200 kB/s.
Client type: .PhantomDC++
Client version: 0.306
Tag: <++ V:0.306,M:A,H:2/1/2,S:20,B:200>

=====================================

so, it WORKS
Title:
Post by: blackwings on 15 October, 2004, 12:41:45
QuoteOriginally posted by bastya_elvtars
Quote[12:36] <-LawMaker->

Information on bastya_elvtars
=====================================

Profile: Superoperator
IP address: 160.114.118.106
Connection type: LAN(T3)
Mode: Active
Shared: 87.58 GB
Total hubs: 5
Hubs as guest: 2
Hubs as registered user: 1
Hubs as operator: 2
Number of slots: 20
Slot/hub ratio: 4
Bandwidth limiting: 200 kB/s.
Client type: .PhantomDC++
Client version: 0.306
Tag: <++ V:0.306,M:A,H:2/1/2,S:20,B:200>

=====================================
so, it WORKS
Ya, but for example, what if you remove the code for pDC++ in your script and keep the code for BCDC++,
then it will identify pDC++ user (if bandwidth limiting is activated) as BCDC++.

Another thing you can test (I noticed this myself), is to put the elseif with BCDC++ before pDC++.
If you now login with pDC++ and has bandwidth limiting activated, the script will then identify pDC++ as BCDC++
Title:
Post by: bastya_elvtars on 15 October, 2004, 12:48:20
QuoteOriginally posted by blackwings
Ya, but for example, what if you remove the code for pDC++ in your script and keep the code for BCDC++,
then it will identify pDC++ user (if bandwidth limiting is activated) as BCDC++.

then do not remove. if you remove, it wont be capable of pdc.

QuoteOriginally posted by blackwings
Another thing you can test (I noticed this myself), is to put the elseif with BCDC++ before pDC++.
If you now login with pDC++ and has bandwidth limiting activated, the script will then identify pDC++ as BCDC++

yes, i experienced this too, but posted it above that bcdc should be after any other client determination as many clients are based on it.
Title:
Post by: blackwings on 15 October, 2004, 12:57:02
QuoteOriginally posted by bastya_elvtars
then do not remove. if you remove, it wont be capable of pdc.
lol,well, that's a bit hard when it comes to my deny client script. If you disable the check on pDC++(change 1 to 0), then it's the same thing as removing the check for pDC++. So if I should have BCDC++ in the table I need another way to check so it won't get confused with pDC++ (Check my deny client script, version 4.2 and you will see how I have done so pDC++ won't get confused with BCDC++)