Skip to content

Commit

Permalink
fix(mindustry): Fix player permissions not immediately refreshing on …
Browse files Browse the repository at this point in the history
…login
  • Loading branch information
phinner committed Jan 14, 2025
1 parent 4cb42d4 commit 8b29deb
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import com.xpdustry.imperium.common.account.AccountManager
import com.xpdustry.imperium.common.account.Rank
import com.xpdustry.imperium.common.application.ImperiumApplication
import com.xpdustry.imperium.common.async.ImperiumScope
import com.xpdustry.imperium.mindustry.account.PlayerLoginEvent
import com.xpdustry.imperium.mindustry.misc.Entities
import com.xpdustry.imperium.mindustry.misc.PlayerMap
import com.xpdustry.imperium.mindustry.misc.runMindustryThread
Expand All @@ -46,6 +47,9 @@ class ImperiumRankProvider(plugin: MindustryPlugin, private val accounts: Accoun
@EventHandler(priority = Priority.HIGH)
fun onPlayerJoin(event: EventType.PlayerJoin) = updatePlayerRanks(event.player)

@EventHandler(priority = Priority.HIGH)
fun onPLayerLogin(event: PlayerLoginEvent) = updatePlayerRanks(event.player)

@TaskHandler(interval = 5L, unit = MindustryTimeUnit.SECONDS)
fun refreshPlayerRank() = Entities.getPlayers().forEach(::updatePlayerRanks)

Expand Down

0 comments on commit 8b29deb

Please sign in to comment.