There's more!

Discussion in 'Archived: Plugin Requests' started by Reptar_, Jul 31, 2012.

  1. Offline

    Reptar_

    Now I only need someone to add banning and IP banning to this plugin. I will give source code.

    http://pastebin.com/rTZfaAF3

    Commands:
    /ban <player> <reason>
    /banip <ip>
    /unban <player>
    /unbanip <ip>

    Permissions:
    findip.ban - Allows to ban
    findip.banip - Allows to IP ban
    findip.unban - Allows to unban
    findip.unbanip - Allows to unban IP



    Plugin category: ADMIN

    Suggested name: FindIP

    What I want: I want a simple lightweight plugin that gets a player's IP. That's it. I don't want to use any other plugins because they're out of date or just offer way more than what I need.

    Ideas for commands: /ip <player> : Gets player's IP.

    Ideas for permissions: findip.get : Allows to get a player's IP.

    When I'd like it by: Today or tomorrow, please.
     
  2. Offline

    lol768

    Another one of your requests? :) I can do this if you want. I'll try and get it done tonight.
     
  3. Offline

    javoris767

  4. Offline

    Deathmarine

    Built into Ultrabans. /checkip {playername} - Pulls all gathered information from the ip and host name, and includes a 18000ms pingback to check for proxy.
     
  5. Offline

    lol768

  6. Offline

    Reptar_

    The plugins you guys referenced has features all my other plugins have. All I want is to find the IP. xP

    lol768
    I try to make the plugins first, then I request them. xP Shows how much I suck, right? xD Haha!

    That was fast! :confused:

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 27, 2016
  7. Offline

    lol768

     
  8. Offline

    Reptar_

    ^^ Well that's cleared up, and plugin works perfectly! Thanks a lot! :D
     
  9. Offline

    lol768

    Thanks!

    Edit: New version (http://www.filedropper.com/fip_1) allows console to use command. Don't know if you need this.

    I usually post the source:
    PHP:
    public boolean onCommand(CommandSender senderCommand cmdString commandLabel, final String[] args)
          {
                  if(
    cmd.getName().equalsIgnoreCase("ip"))
                {
                      if (
    sender.hasPermission("findip.get"))
                      {
                          if (
    args.length == 1)
                          {
                              try
                              {
                                  
    Player p Bukkit.getPlayer(args[0]);
                                  
    sender.sendMessage(p.getName() + " has an IP of " p.getAddress().getAddress().getHostAddress());
                              }
                              catch (
    Exception e)
                              {
                                  
    sender.sendMessage("No such user");
                              }
                             
                          }
                          else
                          {
                              if (
    sender instanceof Player)
                              {
                                  
    Player p = (Playersender;
                                  
    sender.sendMessage(p.getName() + " has an IP of " p.getAddress().getAddress().getHostAddress());
                              }
                              else
                              {
                                  
    sender.sendMessage("Unsupported command sender");
                              }
                          }
                      }
                      else
                      {
                          
    sender.sendMessage("You need permission: findip.get");
                      }
                }
                return 
    true;
          }
     
  10. Offline

    Reptar_

    lol768
    That's basically what I had. I just didn't know how to do the args and p.getAddress().getAddress().getHostAddress().
     
  11. Offline

    lol768

    You were pretty close then :D
    Good luck with your server/plugin development.
     
  12. Offline

    Reptar_

    Thanks! And if you don't mind, I took the code, edited some spelling errors, customized messages, and added color to them. :p I didn't specify it, but I just thought of it. So yeah, I helped make your plugin better! xP I can send it to you and you could maybe post it on BukkitDev. There aren't any lightweight IP plugins, so yours could be a hit!
     
  13. Offline

    lol768

    Sounds great! I've got a new keyboard and the keys are really close which leads to a load of typos (I keep doing lol678), so I'm not really surprised at the spelling errors :p. Anyway, that sounds awesome, if you want to PM the source I (or you, or someone) can add it to BukkitDev. You ok on using an open-source license? Most of my stuff is.

    Thanks for the idea, and for making my plugin better :)
     
  14. Offline

    anthonyc39

    would it be ok if i take and use this plugin or is it for the dude who requested it only?

    also Reptar_ if you wouldnt mind could i use your updated version?

    thanks
     
  15. Offline

    ogedi

    essentials offer the /whois (player) that gives the ip.
     
  16. Offline

    Reptar_

    I will send it to you. But if you distribute it, give all credit to lol768.
     
  17. Offline

    anthonyc39

    thank you very much and i will. (there will be a dedicated spot on my server for credits)
     
  18. Offline

    Reptar_

    You can do it. I don't know how to use BukkitDev or any of that licensing stuff. xP
     
  19. Offline

    lol768

    All of my plugins are free to use :) Credit is appreciated. Please credit Reptar_ for the modifications and idea as well :)
     
  20. Offline

    lol768

    Can you PM your modifications?
     
  21. Offline

    anthonyc39

    i'm not sure what the original one did but this one has the following:


    - when you try it on yourself you get your internal ip
    - when you use the command (/ip <player>) it Get's player's IP.
    - the permission is findip.get
    - when you use the command it returns in the format (<name> + s + chatcolor.gold + IP is + <ip>

    i think that is about it.
     
  22. Offline

    lol768

    Thanks! I'm hoping to put this on BukkitDev soon.
     
  23. Offline

    anthonyc39

    very hand and has the one feature i need/want as opposed to a million useless features i wouldn't use ones so i hope it goes up haha.
     
  24. Offline

    Reptar_

    I will put the source code up and you can pull directly from there.
    Here's the Pastebin:
    http://pastebin.com/rTZfaAF3

    Code will also be below.

    Code:
    package me.Reptar.FindIP;
     
    import org.bukkit.Bukkit;
    import org.bukkit.ChatColor;
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandSender;
    import org.bukkit.entity.Player;
    import org.bukkit.plugin.java.JavaPlugin;
     
    public class FindIP extends JavaPlugin {
    public static FindIP plugin;
     
    @Override
    public void onEnable() {
    System.out.println("[FindIP] Enabled!");
    }
     
    @Override
    public void onDisable() {
    System.out.println("[FindIP] Disabled!");
    }
     
    public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
    if(commandLabel.equalsIgnoreCase("ip")){
    if(sender.hasPermission("findip.get")){
    if(args.length ==1){
    try{
    Player p = Bukkit.getPlayer(args[0]);
    sender.sendMessage(p.getName() + "'s" + ChatColor.GOLD + " IP is: " + p.getAddress().getAddress().getHostAddress());
    }catch (Exception e){
    sender.sendMessage(ChatColor.RED + "Player does not exist!");
    }
    }else{
    if(sender instanceof Player) {
    Player p = (Player) sender;
    sender.sendMessage(p.getName() + "'s" + ChatColor.GOLD + "IP is: " + p.getAddress().getAddress().getHostAddress());
    }else{
    sender.sendMessage(ChatColor.RED + "Unsupported Command Sender!");
    }
    }
    }else{
    sender.sendMessage(ChatColor.RED + "You don't have permission!");
    }
    }
    return true;
    }
    }
    
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 27, 2016
  25. Offline

    anthonyc39

    i was going to do that but i didn't know if you wanted the edited code up for grabs haha
     
  26. Offline

    Reptar_

    Well it's not my code. It belongs to lol768 and his plugins are open source.
     
  27. Offline

    breezeyboy

    May i ask that the ip's are stored in a config to we can get offline players ips?
     
  28. Offline

    Reptar_

    You'll have to ask lol768 on that one. I'm not sure how to do that.
     
  29. Offline

    lol768

    If you post that request on the BukkitDev page, I can add support to store a list of past IPs in a file.

    Reptar_ Thanks, I'm just adding the project now.

    BukkitDev Project: http://dev.bukkit.org/server-mods/findip/

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 27, 2016
  30. Offline

    Reptar_

Share This Page