[REQ] disallow all ips except certain networks

Discussion in 'Archived: Plugin Requests' started by PKdjinn, Jun 16, 2012.

  1. Offline

    PKdjinn

    Basically i want a plugin that can allow certain networks of computers (for instance a couple of cybercafes), to be the only one able to play on one server.

    best regards
     
  2. Offline

    LegoPal92

    so, if i am correct, you want an ip whitelist? Also, please format you post to make it more clear what exactly you want.
     
  3. Offline

    PKdjinn

    ye sry for the cryptic writing

    exactly that, but i need to allow the subnet to join also.
     
  4. Offline

    codename_B

    Yeah that would be cool :)
     
  5. Offline

    LegoPal92


    well, just, im not saying i will make this plugin (im just a super beginner), format your post, and maybe it would be possible to run your server on a port other than 25565, as this is the default port that minecraft checks, then maybe you can just tell the cyber-cafe the changed port.
     
  6. Offline

    Deathmarine

  7. Offline

    PKdjinn

    thanks alot, can i write ip like this for subnets 192.168.1.1/32
     
  8. Offline

    PKdjinn

    hello once again i need this plugin, but it dosent seem to work with 1.5.2
     
  9. Offline

    Jatoc


    I guess I'll give it a shot.
     
  10. Offline

    PKdjinn

    thank you
     
  11. Offline

    Jatoc

    Update: I didn't have a lot of time to make it super configurable and stuff, but I have a basic working version of this for you!

    PKdjinn

    Here's a sample config:
    Code:
    #
    # IPSecure configuration file
    kickMessage: Your IP is not allowed on this server!
    allowedIP:
    - 127.0.0.1
    - 255.255.255.128/28
    - 127.0.0.108
    - 255.255.100.0/24
    
    The kick message is the message sent when a player's IP is not whitelisted. The allowedIP area is a list of IPs that are allowed on the server. You can add masks as requested /20/21/22 etc. in order to allow a range of IPs. This has not been extensively tested, but it should work. If you have any problems, please tag me and respond so I can fix it. I'll probably work on a updated version that's a little more polished and release it on bukkitdev

    Download Here

    EDIT: I forgot to add that there is a permission node: "ipsecure.bypass". If you have it, the ip restrictions will not apply to you (so do your testing on a non-admin account)
     

    Attached Files:

  12. Offline

    PKdjinn

    Jatoc I tried using 2 seperate accounts, and i cleared the config.yml so no ip adresses is allowed. Yet it is letting me onto the server. Im running a local host bukkit
     
  13. Offline

    Jatoc

    Were the accounts op or had permission node *?

    EDIT: I just tested it, and it looks like because of a silly error I made, the plugin will not work unless you have at least one IP address whitelisted. So add some random IP like 255.255.255.255 to the whitelist and test it. (It will kick you if you're logging in from localhost) and then add 127.0.0.1 to the whitelist and it will no longer kick you.

    EDIT 2: I just updated it so that clearing all the entries works as well. Try this version.

    Download
     

    Attached Files:

    PKdjinn likes this.
  14. Offline

    PKdjinn

    @Jatoc

    ty for the effort, it works
     
  15. Offline

    Jatoc

    PKdjinn

    Cool. You should edit your post to say "Filled". I'll probably be adding this to bukkitdev as I can see this being useful to other people as well. Have you managed to try out the different IP masks yet? I haven't fully tested it...
     
  16. Offline

    PKdjinn

    @Jatoc nope havent tried it, eventually i found out i didnt need it for my project.
     
  17. Offline

    Jatoc

  18. Offline

    PKdjinn

    Jatoc

    Do you have the sourcecode for this?
     
  19. Offline

    CD3

    This would be really easy to do. it would liturally be check chat for IP, like So:


    String OriginalMessage = //get Message;
    if (ip.isPresent){
    if (ip.equalsIgnoreCase(Bukkit.getConfig().getString("NotBlocked"))){
    Bukkit.sendMessage(OriginalMessage);
    return true;
    }
    }
    return false;
     
  20. Offline

    zack6849

    why would you check on chat for that, check the playerjoinevent....
     
    jimuskin likes this.
  21. Offline

    Jatoc

    PKdjinn
    Just decompile the jar
     

Share This Page