PtokaX forum

Lua 5.3/5.2/5.1 Scripts (for PtokaX 0.4.0.0 and newer) => Request for scripts => Topic started by: Derk_B_P on 24 May, 2009, 14:14:47

Title: Old clients kicker
Post by: Derk_B_P on 24 May, 2009, 14:14:47
Hello, i need a script.

Create a list of old clients:

["DC++"] = {
         ["0.694"] = 1, --1 = drop
         ["0.695"] = 1, --1 = drop
         ["0.696"] = 1, --1 = drop
         ...
                }

If user join hub with his tag, then bot drop him with message: "Your client is to old. Please change client."
Title: Re: Old clients kicker
Post by: Derk_B_P on 24 May, 2009, 15:36:19
Download this (http://forum.ptokax.org/index.php?topic=8084.msg75463#msg75463) script.

Change:
tCfg = {
--{"Tag","Version" or {"Version-A","Version-B","Version-C"},{Profile table}},
Clients = {
--DC++ 0.670 -> 0.699 & 0.707
{"^D*C*%+%+$",
{"^0%.6[7-9][0-9]$","0%.707","0%.694"},
{[-1] = false,[0] = false,[1] = false,[2] = false,[3] = false},
},
--RSX++
{"^RSX%+%+$",
"1.00",
{[-1] = false,[0] = false,[1] = false,[2] = false,[3] = false},
},
--Apex
{"^ApexDC%+%+$",
"1.1.0",
{[-1] = false,[0] = false,[1] = false,[2] = false,[3] = false},
},
},
-- Enter Message to be sent when client is not allowed.
Msg = "Your client is not allowed in this hub.",
--Allow all client in GUI, restrict only with script?
AnyTag = true,
}


Result:
*** Your client [FlylinkDC++ (r373)] is not allowed in this hub.
*** Your client [DC++ 0.694] is not allowed in this hub.
*** Your client [StrgDC++ 2.22] is not allowed in this hub.
*** Your client [pl++ 5.72] is not allowed in this hub.

I want to configure script to drop only DC++ clients, all versions (0.694, 0.695, 0.696 etc).
And allow all other clients.

PtokaX 0.4.1.1
Title: Re: Old clients kicker
Post by: Derk_B_P on 24 May, 2009, 23:30:24
Change line 45 to "if CheckClient(c,v,i) then"
Now all clients can enter the hub, include DC++ 0.694

tCfg = {...} didn`t change.
Title: Re: Old clients kicker
Post by: Derk_B_P on 25 May, 2009, 07:38:07
Thanks a lot! Script work perfectly.