PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: blackwings on 11 June, 2004, 09:09:26

Title: anti p2p:stand alone
Post by: blackwings on 11 June, 2004, 09:09:26
Chill use in his bot guardian.p2p instead of have it in the code. Could someone make a stand alone script that use the guardian.p2p .
Title:
Post by: chill on 11 June, 2004, 17:08:32
there is just one thing why I don't think guardian is a good script, and it is because it uses a normal search through the IP table

for i,v in IPTable do
end

that is not a good way of doing what it should.

so i think this is better here (http://board.univ-angers.fr/thread.php?threadid=310&boardid=12&styleid=1&sid=2b8ed5baa8a24cd341c83769fccb9049)

and for some tests go here (http://board.univ-angers.fr/thread.php?threadid=1274&boardid=5&sid=2b8ed5baa8a24cd341c83769fccb9049)

blackwingfs do you still want the ip bot from sl, then I can rip it for ya, wouldn't be much work since its already a standalone script.
Title:
Post by: [G-T-E]Gate? on 11 June, 2004, 20:07:35
NIce work Mutor

Looking forward to when u had time to reformat the script.
Ps ,  should the .dat files be placed in the script folder aswell? Ds.

G8
Title:
Post by: blackwings on 11 June, 2004, 21:32:59
sorry chill and Mutor, but I always want the latest update on the blocklist and the easiest way and the quickest way, is to use the guardian.p2p.

Anyway, I get a error with the script in Nerbos last post in the link Mutor posted at first.

here it is(I use Ptokax 03.2.4 Icecube IV build 1)

No syntax errors in script file C:\ptokaxIceCube\scripts\block.lua
Syntax Error: attempt to concat local `comp' (a nil value)
Title:
Post by: blackwings on 12 June, 2004, 08:54:35
I still get this error message =
Syntax Error: attempt to concat local `comp' (a nil value)

Dunno if it's because of the error, but the scripts think that I'm one of the banned ones(the script sends the message, but it doesn't ban/disconnect me). If it isn't because of the error, you might have coded it so it only allow regged users.

EDIT: This error message might be more helpful(tested the script in 0.3.3.0 build 15.25) =

Syntax error: attempt to concat local `comp' (a nil value)
stack traceback:
   1:  function `NewUserConnected' at line 36 [file `C:\Ptokax\scripts\block.lua']
Title:
Post by: blackwings on 12 June, 2004, 09:45:15
QuoteOriginally posted by Mutor
MetalPriest had same error with 0.330 build 15.25
and he and nerbos got it working on the debug ver.

I don't get any error messages at this moment, so it seems like it works with Ptokax 0.3.2.4 Icecube IV build 1.
Title:
Post by: chill on 12 June, 2004, 10:35:47
depends on what you want, but for sure,
easyranger is slow with 10.000 denyranges, thats just why I don# like linear searches , binary searches are in that case much better, if you know what I mean.
Title:
Post by: chill on 12 June, 2004, 17:31:18
this one here (http://board.univ-angers.fr/thread.php?threadid=2066&boardid=13)
the same, binary searches are always better then when you have tables that are sortable and many of em'.

also used in the GeoIP script (http://board.univ-angers.fr/thread.php?threadid=1776&boardid=12&styleid=1&sid=e85ad33aabeaeda3dcf9de09ee417171)

I think everybody should use binary searches, when using ip-ranges.
Title:
Post by: VERMiN on 12 June, 2004, 17:41:47
You can also try my script. I don't know how it compares to the rest of the .P2P scripts but I tried a PeerGuardian file with the size of 22MB (quite a lot of ranges, fake made..) and on my computer I timed the operation to be around 1.2 seconds. The whole P2P file are read into memory at main().

Well well....
Title:
Post by: blackwings on 16 June, 2004, 13:24:38
if I add this line to the p2p file, will the IP in the example be blocked?

Example:

block name:63.142.115.271-63.142.115.271
Title:
Post by: blackwings on 17 June, 2004, 00:37:12
I have a idea, don't know if it's possible or not, anyway here it is =

Why don't make the script so when it starts, it splits all the IP ranges in the p2p files, into several files with like 1000 ranges per file. The files could be .dat or whatever you want them to be. If the scripts finds these splited files, it doesn't try to split the p2p file anymore, it just start to read from these splited files(and block users that have IP that match). And when you want to update the ipranges, you just replace the old p2p file with the new one, delete the splitted files and restart the script.