PDA

View Full Version : [562 Palidno76] Limited per IP.



Faab234
July 23rd, 2010, 08:31
This is my first tutorial for 562 server, so Maybe there are errors.

First we go to SocketManager and add this Import:


import java.util.ArrayList;

Now we Declare this:


private static ArrayList<String> connections = new ArrayList<String>();


Now we go to the addPendingConnections method, Under "String host = socket.socket().getInetAddress().getHostAddress();", we Add:


connections.add(host);

Above " socket.configureBlocking(false);", we add:


if (connections.contains(host)) {
socket.close();
continue;
}



If you allow more IP's, Declare:


private int limited = 0;

private int current = 0;

And change

if (connections.contains(host)) {
socket.close();
continue;
}

To



if (current == limited) {
if (connections.contains(host)) {
socket.close();
continue;
}
} else {
current++;
}

I don't tested it, so if you test Thanks. Post Errors.

elite beast
July 23rd, 2010, 15:36
you also know how it works on caulums bases?

i pwn u hard
July 23rd, 2010, 16:31
you also know how it works on caulums bases?

should be about same thing...

elite beast
July 23rd, 2010, 16:55
caulums servers don't have socketmanager

Faab234
July 24th, 2010, 08:51
No, Sorry, I used Palidino76 nio 562, Sorry.

Charlie`
July 24th, 2010, 08:52
Nice It's Cool

elite beast
July 24th, 2010, 09:41
No, Sorry, I used Palidino76 nio 562, Sorry.

so theres no way of doing this for caulums server?

teemuzz
July 24th, 2010, 16:51
elite there is, and faab there's already a limiter.

elite beast
July 25th, 2010, 01:33
theres only socketmethods.dat

Faab234
July 25th, 2010, 09:37
elite there is, and faab there's already a limiter.

Oh, People asked me About it so I released it, I will make a Anti-Flood.

David
July 25th, 2010, 10:30
Gj Faab! Keep up the good work ;D

Faab234
September 3rd, 2010, 06:44
Sorry, but I see some horrible Anti Flooders.

420
September 3rd, 2010, 06:46
Nice It's Cool

Faab234
September 3rd, 2010, 06:51
Thanks you.

Aaron
September 3rd, 2010, 07:00
It's okay Faab, even your first ones are probably better than the ones from people's 50th:D

davidpaceway
May 24th, 2011, 19:47
Can you make this RS2HD :D

Jon
May 24th, 2011, 20:09
Can you make this RS2HD :D

nice gravedig and use the search button..