I'd say this is pretty important

This commit is contained in:
Telesphoreo 2022-04-02 15:12:38 -05:00
parent aa18e5d11a
commit fd9fafb6bb

View File

@ -63,14 +63,13 @@ public class PlayerListener extends PlexListener
PlexLog.debug("New IP address detected for player: " + player.getName() + ". Adding " + currentIP + " to the database."); PlexLog.debug("New IP address detected for player: " + player.getName() + ". Adding " + currentIP + " to the database.");
ips.add(currentIP); ips.add(currentIP);
plexPlayer.setIps(ips); plexPlayer.setIps(ips);
if (mongoPlayerData != null) //back to mongo checking DataUtils.update(plexPlayer);
{ }
mongoPlayerData.update(plexPlayer); //update the player's document if (!plexPlayer.getName().equals(player.getName()))
} {
else if (sqlPlayerData != null) //sql checking PlexLog.log(plexPlayer.getName() + " has a new name. Changing it to " + player.getName());
{ plexPlayer.setName(player.getName());
sqlPlayerData.update(plexPlayer); DataUtils.update(plexPlayer);
}
} }
} }
@ -101,15 +100,7 @@ public class PlayerListener extends PlexListener
plugin.getAdminList().removeFromCache(UUID.fromString(plexPlayer.getUuid())); plugin.getAdminList().removeFromCache(UUID.fromString(plexPlayer.getUuid()));
} }
if (mongoPlayerData != null) //back to mongo checking DataUtils.update(plexPlayer);
{
mongoPlayerData.update(plexPlayer); //update the player's document
}
else if (sqlPlayerData != null) //sql checking
{
sqlPlayerData.update(plexPlayer);
}
PlayerCache.getPlexPlayerMap().remove(event.getPlayer().getUniqueId()); //remove them from cache PlayerCache.getPlexPlayerMap().remove(event.getPlayer().getUniqueId()); //remove them from cache
} }