[Tut] How to IP/address(host) ban via Server.java

Results 1 to 6 of 6
  1. #1
    Novice NoM is offline
    MemberRank
    Mar 2007 Join Date
    2Posts

    [Tut] How to IP/address(host) ban via Server.java

    My first tutorial, do not flame if it is bad.

    Difficulty: 1/10
    Description:
    How to IP / address ban using Server.java

    Files to be edited: server.java

    Open server.java
    Search
    Code:
    String connectingHost = s.getInetAddress().getHostName();
    Under that, you should see:
    Code:
                    if(clientListener != null) {

    Then under that, you probably see something like:
    Code:
                       if (connectingHost.startsWith("some.host.address.here") || connectingHost.startsWith("some.ip.address.here") ]
    After that if ( add:
    Code:
    connectingHost.startsWith("ip/address") ||
    Replace ip/address with a user's IP or host address.

    You can find this by going to /your_servers_directory/characters/ then opening the user's .txt file.

    Search or scroll until you find:
    Code:
    character-lastconnection =
    After that will be their host.

    Please rate this tutorial on a scale of [bad]1-5[good]
    I worked as hard as I could.

    Give feedback, and leave questions.


  2. #2
    Proficient Member SteveJR is offline
    MemberRank
    Nov 2007 Join Date
    Ivybridge, EnglandLocation
    169Posts

    Re: [TUTORIAL] How to IP/address(host) ban via Server.java

    Nice TuT, thanks for this NoM (scale of 1-5 = 4)

    - Steve

  3. #3
    Account Upgraded | Title Enabled! georgegeorge is offline
    MemberRank
    Oct 2005 Join Date
    Israel, Tel-AviLocation
    1,079Posts

    Re: [TUTORIAL] How to IP/address(host) ban via Server.java

    good for first tutorial :)

  4. #4
    NIKO STOLE MY BIKE! Cruvenium is offline
    MemberRank
    Jun 2007 Join Date
    Don't stalk me.Location
    259Posts

    Re: [TUTORIAL] How to IP/address(host) ban via Server.java

    Nice tutorial .

    But I don't think this is really needed, 'cause you see, we could do bans by in game by typing the ::players and ::ipban , or by going into the ban logs and add in them ?

    By doing this is just like going one big round to reach your destination .

  5. #5
    Apprentice kicktopje is offline
    MemberRank
    Mar 2007 Join Date
    9Posts

    Re: [TUTORIAL] How to IP/address(host) ban via Server.java

    i got a problem

    public void run() {
    // setup the listener
    try {
    shutdownClientHandler = false;
    clientListener = new java.net.ServerSocket(serverlistenerPort, 1, null);
    misc.println("Starting AquaScape Server on "+clientListener.().getHostAddress()+":" + clientListener.getLocalPort());
    while(true) {
    java.net.Socket s = clientListener.accept();
    s.setTcpNoDelay(true);
    String connectingHost = s.getInetAddress().getHostName();
    if(clientListener != null) {
    if (connectingHost.startsWith("5.125.54.36") || connectingHost.startsWith("5.125.54.36")) {
    misc.println(connectingHost+": Checking if server still is online...");
    }
    /*if(!banned(connectingHost))
    {
    misc.println("ClientHandler: Accepted from "+connectingHost+":"+s.getPort());
    where need i my ip I dont se it
    (sorry for my english )

  6. #6
    Account Upgraded | Title Enabled! Rainwizzard is offline
    MemberRank
    Aug 2007 Join Date
    CanadaLocation
    1,295Posts

    Re: [TUTORIAL] How to IP/address(host) ban via Server.java

    kind of confusing with the'after that' then'after that' part. but all onall 4/6



Advertisement