Player IP API 1.2.11

A nice API that allows for VERY fast alt detection and Essentials-like /seen lookups

  1. egg82
    playeripapi-banner.jpg

    playeripapi-installation-tab.png
    Single / Personal servers
    Simply drop the jar into your "plugins" folder. The auto-generated config should default to reasonable values for you, but you may modify it if you wish.

    Multiple servers / Large networks
    Drop the jar into the plugins folder and configure the "sql" section to use MySQL instead of SQLite. RabbitMQ and/or Redis are optional but highly recommended if you have multiple servers.

    playeripapi-config-tab.png
    Code (Text):
    # This is the backing data for everything
    # SQL is used as long-term storage and cross-network updates every few seconds
    # Try to use an SQL source each server has access to, if possible
    # You may choose to use MySQL or SQLite
    # An SQL database of SOME description is required
    sql:
      # The type of database to use. May be either MySQL or SQLite
      type: 'sqlite'
      # Number of connections to use. Cannot be lower than 1
      # Recommended 2+ for parallel queries for non-Redis servers
      # If using Redis, set this to 2+ on hubs and 1 on servers
      threads: 2
      mysql:
        address: '127.0.0.1'
        port: 3306
        user: ''
        pass: ''
        database: 'ipapi'
      sqlite:
        file: 'ipapi.db'

    # Redis is used as a cache so lookups can be VERY fast
    # This is used in both the expensive and non-expensive lookups
    # It also provides the ability to push instant updates across the network
    # Redis is entirely optional
    redis:
      enabled: false
      address: ''
      port: 6379
      pass: ''

    # Rabbit is used to push instant updates across the network
    # If you don't have/use Redis you can use this to update faster than SQL
    # Even if you use Redis, this can be used as a backup source
    # Rabbit is entirely optional
    rabbit:
      enabled: false
      address: ''
      port: 5672
      user: 'guest'
      pass: 'guest'

    # The amount of time before in-memory caches expire after non-use
    # This prevents many sequential lookups from using more expensive networking constantly
    cacheTime: 1minute
    playeripapi-commands-tab.png
    /ipapireload - Reloads the plugin configuration. This will disconnect and reconnect (if appropriate) any services configured in the config.yml file.

    playeripapi-permissions-tab.png
    ipapi.admin - allows access to the /ipapireload command

    playeripapi-donations-tab.png
    Please consider donating to support this free plugin!
    PP_logo_h_150x38.png

    playeripapi-legal-tab.png
    According to the GDPR, you must specify that you are storing IP information to your players in a privacy policy when using this plugin (actually you need that if you're running a vanilla server without this plugin because of server logs). Depending on how data provided from this API is used, you may be required to manually remove some data from the databases.
    Disclaimer: I am a plugin developer, not a lawyer. This information is provided as a "best guess" and is not legal advice.

    playeripapi-api-tab.png
    Maven
    Code (Text):
    <repository>
      <id>egg82-ninja</id>
      <url>https://www.myget.org/F/egg82-java/maven/</url>
    </repository>
    Latest Repo
    https://www.myget.org/feed/egg82-java/package/maven/ninja.egg82.plugins/PlayerIPAPI

    API usage
    Code (Text):
    IPLookupAPI.getInstance();
    ...
    ImmutableSet<IPData> getIps(UUID playerUuid);
    ImmutableSet<UUIDData> getPlayers(String ip);
    ...
    IPData ipData = ips.get(0);
    ipData.getIp();
    ipData.getCreated();
    ipData.getUpdated();
    ...
    UUIDData uuidData = uuids.get(0);
    uuidData.getUuid();
    uuidData.getCreated();
    uuidData.getUpdated();
    Example - list all players logged into all IPs that a specified player has ever logged in on
    Code (Text):
    IPLookupAPI api = IPLookupAPI.getInstance();
    ImmutableSet<IPData> ips = api.getIps(event.getPlayer().getUniqueId());
    for (IPData iData : ips) {
        ImmutableSet<UUIDData> players = api.getPlayers(iData.getIp());
        for (UUIDData uData : players) {
            // Do something with uData.getUuid()
        }
    }
    Example - emulate Essentials /seen
    Code (Text):
    IPLookupAPI api = IPLookupAPI.getInstance();
    ImmutableSet<UUIDData> uuids = api.getPlayers(args[0]);
    for (UUIDData data : uuids) {
        // Do something with data.getUuid()
    }
    Royalty-free icon by Vitaly Gorbachev
    MindoTv likes this.

Recent Updates

  1. Minor bug fixes
  2. 1.13 & JSON Fixes
  3. SQLite and hanging thread fixes