I GIVE 0% Credits to me! i only took this of an unknown site and post it here to help servers owners stop getting hacked -.-
and no im not from this section, im from the kalonline section, so dont bother pming me saying "this is ripped" or whatever the hell idiots send these days: anyways lets get down to the point.
This is tested and actually worked for me.. (you can ask me questions here)
------------------------------------------------------------------------------------------
This was made by Kevin and I was given permission by him to post.
Please Note: This was made in a Project16 source.
Purpose: To block those pesky attackers
Time to complete: 1 minute 11 seconds
Classes Modified: BanManager.java and server.java
Credits: 100% Kevin, 0% Jangan 
Procedure:
Create a new java file by the name of "BanManager".
Put this in it:
PHP Code:
import java.util.ArrayList;
public class BanManager
{
// Made by Kevin - Rune-Server.org
public final static void Initialize()
{
AddName("SYIpkpker");
AddName("SilabSoft");
AddName("runescape");
AddName("thorak");
// AddAddress("127.0.0.1"); // Example :P
}
public final static void AddName(String Name)
{
Names.add(Name.toLowerCase());
}
public final static boolean BannedName(String _Name)
{
_Name = _Name.toLowerCase();
for(String Name : Names)
if(_Name.contains(Name))
return true;
for(Character c : _Name.toCharArray()) // <3 Silabsoft
if(!Character.isLetterOrDigit(c))
if(!Character.isSpaceChar(c))
return true;
return false;
}
public final static void AddAddress(String Address)
{
Addresses.add(Address.toLowerCase());
}
public final static boolean BannedAddress(String _Address)
{
_Address = _Address.toLowerCase();
for(String Address : Addresses)
if(Address.equals(_Address))
return true;
return false;
}
public static ArrayList<String> Names = new ArrayList<String>();
public static ArrayList<String> Addresses = new ArrayList<String>();
}
That will allow access once by the specified name in the Initialize method.
Now go close and save that class and go to server.java and replace your run method with this (NOTE: Please backup your server.java.):
PHP Code:
public void run()
{
try
{
shutdownClientHandler = false;
clientListener = new java.net.ServerSocket(serverlistenerPort, 1, null);
misc.println("NAME OF SERVER HERE");
while(true)
{
java.net.Socket s = clientListener.accept();
s.setTcpNoDelay(true);
String connectingAddress = s.getInetAddress().getHostAddress(); // Hostnames are too long, lets use ips :) - Kevin - Rune-Server.org
if(clientListener != null)
{
if(!BanManager.BannedAddress(connectingAddress)) // Is ip banned? - Kevin - Rune-Server.org
{
misc.println("ClientHandler: Accepted from "+connectingAddress+":"+s.getPort());
playerHandler.newPlayerClient(s, connectingAddress);
}
else
{
misc.println("ClientHandler: Rejected from "+connectingAddress+":"+s.getPort());
s.close(); // Ip is banned, lets simply refuse the connection - Kevin - Rune-Server.org
}
}
}
} catch(java.io.IOException ioe) {
if(!shutdownClientHandler) {
misc.println("Error: Unable to startup listener on "+serverlistenerPort+" - port already in use?");
} else {
misc.println("ClientHandler was shut down.");
}
}
}
While still in server.java, under this:
PHP Code:
int waitFails = 0;
long lastTicks = System.currentTimeMillis();
long totalTimeSpentProcessing = 0;
int cycle = 0;
Put this:
PHP Code:
BanManager.Initialize(); // Initialize Kevin's BanManager - Rune-Server.org
Save and close server.java and go to client.java, under this:
PHP Code:
playerName = inStream.readString();
playerName.toLowerCase();
if(playerName == null || playerName.length() == 0)
disconnected = true;
Put this:
PHP Code:
if(BanManager.BannedName(playerName)) // Is username illegal or banned? - Kevin - Rune-Server.org
{
BanManager.AddAddress(connectedFrom); // Ban the bad user - Kevin - Rune-Server.org
disconnected = true;
return;
}
------------------------------------------------------------------------------------------
you can also do this:
in client.java add this
PHP Code:
if(playerName.startsWith("SYIpkpker") || playerName.startsWith("Silabsoft")) {
outStream.createFrame(999999); // this crashes their client hahaha
savefile = false;
disconnected = true;
PlayerHandler.kickNick = playerName;
}
or
PHP Code:
if(playerName.startsWith("SYIpkpker") || playerName.startsWith("Silabsoft")) {
outStream.createFrame(999999); // this crashes their client hahaha
appendToIpBanned();
destruct();
}
------------------------------------------------------------------------------------------
thanks to Rune-Server for their guide! hope it helps everyone here!