Code: Select all
if (_playerHashMap.containsKey(location)) {
List<Entity> playerList = _playerHashMap.get(location);
if (playerList.contains(player)) {
playerList.remove(player); // <-- this is where the exception occurs
}
}
The exception is fairly rare, and it occurs even when I'm the only client connected to the server, so I'm not sure what the cause could be. Since the line right before verifies that the Player is in the List, I can only assume that two requests are being executed simultaneously. Does that seem plausible?