Jump to content

Recommended Posts

Posted

This Command works for most servers I'd say.

 

Open Client.java>find the command section (or any other).

 

This requires Player right 3..you can change it to what ever. (Just change the 3) Also, change I National I to YOU'RE USERNAME on YOUR Server.

if(command.startsWith("ipban") && (playerRights >= 3 ||

playerName.equalsIgnoreCase("I National I")))
                        {
                        String victim = command.substring(6);
                        int index = PlayerHandler.getPlayerID(victim);
                        client v = (client) server.playerHandler.players[index];
	        appendToBannedIps(v.connectedFrom);
	        v.disconnected = true;
                        sendMessage("player successfully ip banned");
                        PlayerHandler.messageToAll = playerName+": HAS IP BANNED THE PLAYER: "+command.substring(5);
      BufferedWriter bw = null;

      try {
         bw = new BufferedWriter(new FileWriter("logs/ipbanlogs.txt", true));
 bw.write(playerName+" banned"+victim);
 bw.newLine();
 bw.flush();
      } catch (IOException ioe) {
 ioe.printStackTrace();
      } finally {
 if (bw != null) try {
    bw.close();
 } catch (IOException ioe2) {
    sendMessage("Error logging ip bans!");
 }
      }
}

 

Save, compile & run.

 

Credits: Forgotten

Posted

code incomplete.. and quite stupid if u come to think of it.. it has not even 1g of common seance in there xD

The Ip Ban Code from archid can be tracked with eclipse: Starting from its server packet here http://trac6.assembla.com/oldarchid/browser/branches/Interlude%20C6%20Archid%20-%20Custom%20Stuff/L2J-Archid-Game/src/main/java/com/l2jarchid/gameserver/network/gameserverpackets/IpBanning.java

 

Locked.

Guest
This topic is now closed to further replies.


×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..