PDA

View Full Version : a good way to block flooders z508/525



Nathan
June 18th, 2010, 03:45
i would of added this in snippets but theres no section for that.

ok in rs2login.java search. above that


p.stream.writeByte(returnCode);

add this
int ipconnections = 0;
for (int i = 0; i < Engine.players.length; i++) {
Player PC = Engine.players[i];
if (PC != null) {
if (PC.socket.socket.getInetAddress().getHostAddress( ).equals(
p.socket.socket.getInetAddress().getHostAddress()) ) {
// MATCHED IP
ipconnections += 1;
}
}
}
if (ipconnections >= 4) {
// More than 3 connections
returnCode = 9;
}


It will look something like this
p.newPassword = password;
p.loadCharacter();
if (password != null && p.password != null && !p.password.equals("") && !p.password.equals(password)) {
returnCode = 3;
} else {
p.password = password;
}
int ipconnections = 0;
for (int i = 0; i < Engine.players.length; i++) {
Player PC = Engine.players[i];
if (PC != null) {
if (PC.socket.socket.getInetAddress().getHostAddress( ).equals(
p.socket.socket.getInetAddress().getHostAddress()) ) {
// MATCHED IP
ipconnections += 1;
}
}
}
if (ipconnections >= 4) {
// More than 3 connections
returnCode = 9;
}

p.stream.writeByte(returnCode);


wat this does is only 3 accounts from 1 ip is alowed to log in. tested. works 100% instead of lots of bots logging in only 3 bots log in.

Sunni
June 18th, 2010, 03:50
Why not just remove botting and make it one connection per IP?Also this allows SYIers the entrance to three characters.

Nathan
June 18th, 2010, 03:52
yh i blocked all botters on mine. this is for ppl who have problems with flooders...

EDIT and if u want 1ip per connection change
if (ipconnections >= 4) {

to


if (ipconnections >= 2) {

Faab234
June 18th, 2010, 07:02
Is this a other way for Anti-Flooding?

Nathan
June 18th, 2010, 13:12
Is this a other way for Anti-Flooding?

yes i tested with my flooders. and it works fine.

Aaron
June 18th, 2010, 13:13
Very nice, Works:)

Nathan
June 18th, 2010, 13:17
Very nice, Works:)

thanks

Cpd
June 18th, 2010, 15:53
VERY nicely done thanks!@@

jamie
June 19th, 2010, 05:19
yes indeed a very good way. thanks so much.

XxBryantD
June 20th, 2010, 16:42
very nice