ConcurrentModification in player_move during recompile
LadyCailinBot opened this issue ยท 1 comments
CMDHELPER-3055 - Reported by PseudoKnight
Exception in thread "CommandHelperPlayerMoveEventRunner"
java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextEntry(Unknown Source)
at java.util.HashMap$KeyIterator.next(Unknown Source)
at com.laytonsmith.core.events.drivers.PlayerEvents$player_move$1.run(PlayerEvents.java:1912)
at java.lang.Thread.run(Unknown Source)
Comment by PseudoKnight
I've rewritten this to use actual PlayerMoveEvents on my fork and am testing it on my live server for the time being. It does add some extra overhead since it checks distances for thresholds on the main thread (fairly insignificant), and it fires more frequently since it's not throttled to run only every 500ms. (now it's more like 50 - 300 depending on how fast you're going, with walking being around 200-250) On the plus side it's far more accurate and canceling it doesn't set players way back. Moreover it's a lot safer since it's not threaded, so this (http://forum.enginehub.org/threads/posting-an-issue-here-since-youtrack-is-down.16448) won't happen.