mirror of
https://github.com/plexusorg/Plex.git
synced 2024-12-23 01:27:37 +00:00
Add new IPs
This commit is contained in:
parent
a4ce9511fd
commit
aa18e5d11a
@ -56,19 +56,22 @@ public class PlayerListener extends PlexListener
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
plexPlayer = DataUtils.getPlayer(player.getUniqueId());
|
plexPlayer = DataUtils.getPlayer(player.getUniqueId());
|
||||||
/*List<String> ips = plexPlayer.getIps();
|
List<String> ips = plexPlayer.getIps();
|
||||||
String currentIP = player.getAddress().getAddress().getHostAddress().trim();
|
String currentIP = player.getAddress().getAddress().getHostAddress().trim();
|
||||||
for (int i = 0; i < plexPlayer.getIps().size(); i++)
|
if (!ips.contains(currentIP))
|
||||||
{
|
{
|
||||||
if (!currentIP.equals(ips.get(i)))
|
PlexLog.debug("New IP address detected for player: " + player.getName() + ". Adding " + currentIP + " to the database.");
|
||||||
|
ips.add(currentIP);
|
||||||
|
plexPlayer.setIps(ips);
|
||||||
|
if (mongoPlayerData != null) //back to mongo checking
|
||||||
{
|
{
|
||||||
PlexLog.debug("New IP address detected for player: " + player.getName() + ". Adding " + currentIP + " to the database.");
|
mongoPlayerData.update(plexPlayer); //update the player's document
|
||||||
ips.add(currentIP);
|
|
||||||
plexPlayer.setIps(ips);
|
|
||||||
DataUtils.update(plexPlayer);
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}*/
|
else if (sqlPlayerData != null) //sql checking
|
||||||
|
{
|
||||||
|
sqlPlayerData.update(plexPlayer);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PunishedPlayer punishedPlayer = PlayerCache.getPunishedPlayer(player.getUniqueId());
|
PunishedPlayer punishedPlayer = PlayerCache.getPunishedPlayer(player.getUniqueId());
|
||||||
|
Loading…
Reference in New Issue
Block a user