Skip to content

Commit

Permalink
feat: handle bungee permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
98ping committed Sep 2, 2023
1 parent c8e6d71 commit c6b6015
Showing 1 changed file with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,20 @@ class BungeeListener : Listener {
}, 100L, TimeUnit.MILLISECONDS)
}

@EventHandler
fun handlePermissions(event: ServerConnectEvent)
{
val profile = ProfileGameService.byId(event.player.uniqueId) ?: return

for ((a, b) in profile.getPermissions())
{
if (!b)
{
event.player.setPermission(a, true)
}
}
}

@EventHandler
fun login(event: LoginEvent) {
val player = event.connection.uniqueId
Expand Down Expand Up @@ -66,7 +80,7 @@ class BungeeListener : Listener {
if (playerRank.staff) {
StaffMessagePacket("&b[S] &r" + playerRank.color + player.name + " &3left the network").action()
}
}, 1100L, TimeUnit.SECONDS)
}, 100L, TimeUnit.SECONDS)
}

@EventHandler
Expand All @@ -79,6 +93,6 @@ class BungeeListener : Listener {
event.player.disconnect(TextComponent(ChatColor.translateAlternateColorCodes('&',"&cServer is on lockdown and you do not have clearance!")))
}
}
}, 1100L, TimeUnit.MILLISECONDS)
}, 100L, TimeUnit.MILLISECONDS)
}
}

0 comments on commit c6b6015

Please sign in to comment.