Proper naming for InstanceManager player reenter times map.

This commit is contained in:
MobiusDevelopment
2023-01-10 22:30:31 +00:00
parent 1bdd4b6bc1
commit 5ff9b568d6
29 changed files with 244 additions and 244 deletions

View File

@ -74,7 +74,7 @@ public class InstanceManager implements IXmlReader
private int _currentInstanceId = 0;
private final Map<Integer, Instance> _instanceWorlds = new ConcurrentHashMap<>();
// Player reenter times
private final Map<Integer, Map<Integer, Long>> _PlayerTimes = new ConcurrentHashMap<>();
private final Map<Integer, Map<Integer, Long>> _playerTimes = new ConcurrentHashMap<>();
protected InstanceManager()
{
@ -96,9 +96,9 @@ public class InstanceManager implements IXmlReader
parseDatapackDirectory("data/instances", true);
LOGGER.info(getClass().getSimpleName() + ": Loaded " + _instanceTemplates.size() + " instance templates.");
// Load player's reenter data
_PlayerTimes.clear();
_playerTimes.clear();
restoreInstanceTimes();
LOGGER.info(getClass().getSimpleName() + ": Loaded instance reenter times for " + _PlayerTimes.size() + " players.");
LOGGER.info(getClass().getSimpleName() + ": Loaded instance reenter times for " + _playerTimes.size() + " players.");
}
@Override
@ -545,7 +545,7 @@ public class InstanceManager implements IXmlReader
public Map<Integer, Long> getAllInstanceTimes(Player player)
{
// When player don't have any instance penalty
final Map<Integer, Long> instanceTimes = _PlayerTimes.get(player.getObjectId());
final Map<Integer, Long> instanceTimes = _playerTimes.get(player.getObjectId());
if ((instanceTimes == null) || instanceTimes.isEmpty())
{
return Collections.emptyMap();
@ -593,7 +593,7 @@ public class InstanceManager implements IXmlReader
*/
public void setReenterPenalty(int objectId, int id, long time)
{
_PlayerTimes.computeIfAbsent(objectId, k -> new ConcurrentHashMap<>()).put(id, time);
_playerTimes.computeIfAbsent(objectId, k -> new ConcurrentHashMap<>()).put(id, time);
}
/**
@ -606,7 +606,7 @@ public class InstanceManager implements IXmlReader
public long getInstanceTime(Player player, int id)
{
// Check if exists reenter data for player
final Map<Integer, Long> playerData = _PlayerTimes.get(player.getObjectId());
final Map<Integer, Long> playerData = _playerTimes.get(player.getObjectId());
if ((playerData == null) || !playerData.containsKey(id))
{
return -1;
@ -635,9 +635,9 @@ public class InstanceManager implements IXmlReader
ps.setInt(1, player.getObjectId());
ps.setInt(2, id);
ps.execute();
if (_PlayerTimes.get(player.getObjectId()) != null)
if (_playerTimes.get(player.getObjectId()) != null)
{
_PlayerTimes.get(player.getObjectId()).remove(id);
_playerTimes.get(player.getObjectId()).remove(id);
}
}
catch (Exception e)