Merge pull request #33 from SKBotNL/master
Switch to a thread-safe list in EventManager
This commit was merged in pull request #33.
This commit is contained in:
1 file changed
+2
-1
@@ -1,9 +1,10 @@
|
||||
package net.trueog.diamondbankog
|
||||
|
||||
import java.util.*
|
||||
import java.util.concurrent.CopyOnWriteArrayList
|
||||
|
||||
internal class EventManager {
|
||||
private var listeners = listOf<PlayerBalanceChangedListener>()
|
||||
private var listeners = CopyOnWriteArrayList<PlayerBalanceChangedListener>()
|
||||
|
||||
fun sendUpdate(uuid: UUID, playerShards: PostgreSQL.PlayerShards) {
|
||||
listeners.forEach { it.onUpdate(PlayerBalanceChangedEvent(uuid, playerShards)) }
|
||||
|
||||
Reference in new issue
Block a user