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.
# 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'
# Config version, no touchy plz
version: 2.0
/ipapireload - Reloads the plugin configuration. This will disconnect and reconnect (if appropriate) any services configured in the config.yml file.
ipapi.admin - allows access to the ipapireload command
Please consider donating to support this free plugin!
Disclaimer: I am a plugin developer, not a lawyer. This information is provided as a "best guess" and is not legal advice.
Maven
<repository>
<id>egg82-ninja</id>
<url>https://www.myget.org/F/egg82-java/maven/</url>
</repository>
https://www.myget.org/feed/egg82-java/package/maven/ninja.egg82.plugins/PlayerIPAPI
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();
IPLookupAPI api = IPLookupAPI.getInstance();
ImmutableSet<IPData> ips = api.getIps(event.getPlayer().getUniqueId());
for (IPData ip : ips) {
ImmutableSet<UUIDData> players = api.getPlayers(ip.getIp());
for (UUIDData uuid : players) {
// Do something with uuid.getUuid()
}
}
IPLookupAPI api = IPLookupAPI.getInstance();
ImmutableSet<UUIDData> uuids = api.getPlayers(args[0]);
for (UUIDData uuid : uuids) {
// Do something with uuid.getUuid()
}
Royalty-free icon by Vitaly Gorbachev