Skip to content

Commit

Permalink
fix permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
98ping committed Dec 26, 2022
1 parent dbeca4a commit eff2211
Show file tree
Hide file tree
Showing 89 changed files with 26 additions and 17 deletions.
Binary file modified .gradle/7.1/executionHistory/executionHistory.bin
Binary file not shown.
Binary file modified .gradle/7.1/executionHistory/executionHistory.lock
Binary file not shown.
Binary file modified .gradle/7.1/fileHashes/fileHashes.bin
Binary file not shown.
Binary file modified .gradle/7.1/fileHashes/fileHashes.lock
Binary file not shown.
Binary file modified .gradle/7.1/fileHashes/resourceHashesCache.bin
Binary file not shown.
Binary file modified .gradle/buildOutputCleanup/buildOutputCleanup.lock
Binary file not shown.
Binary file modified .gradle/buildOutputCleanup/outputFiles.bin
Binary file not shown.
Binary file modified .gradle/checksums/checksums.lock
Binary file not shown.
Binary file modified .gradle/checksums/md5-checksums.bin
Binary file not shown.
Binary file modified .gradle/checksums/sha1-checksums.bin
Binary file not shown.
2 changes: 1 addition & 1 deletion .idea/codestream.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Binary file not shown.
Binary file modified commons/build/kotlin/compileKotlin/build-history.bin
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
34
39
0
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified commons/build/kotlin/compileKotlin/last-build.bin
Binary file not shown.
Binary file modified commons/build/libs/commons-1.0-SNAPSHOT.jar
Binary file not shown.
Binary file modified commons/build/tmp/kapt3/incApCache/main/apt-cache.bin
Binary file not shown.
Binary file modified commons/build/tmp/kapt3/incApCache/main/java-cache.bin
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,17 @@ data class GameProfile(

val parents = getCurrentRank()!!.parents.map {
RankService.byId(it)
}.filter {
Objects.nonNull(it)
}

parents.forEach { rank ->
rank!!.permissions.forEach {
if (!allPerms.contains(it)) {
allPerms.add(it)
if (rank != null)
{
for (perm in rank.permissions)
{
if (!allPerms.contains(perm))
{
allPerms.add(perm)
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package ltd.matrixstudios.alchemist.models.ranks

import ltd.matrixstudios.alchemist.service.ranks.RankService
import sun.security.ec.point.ProjectivePoint.Mutable
import java.util.*
import kotlin.collections.ArrayList

Expand All @@ -18,4 +20,5 @@ class Rank(
var staff: Boolean = false,
var default: Boolean = false
) {

}
Binary file not shown.
Binary file modified spigot/build/kotlin/compileKotlin/build-history.bin
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
144
149
0
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified spigot/build/kotlin/compileKotlin/caches-jvm/lookups/lookups.tab
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
���9�q
���9�q����������
Binary file not shown.
Binary file modified spigot/build/kotlin/compileKotlin/last-build.bin
Binary file not shown.
Binary file modified spigot/build/tmp/kapt3/incApCache/main/apt-cache.bin
Binary file not shown.
Binary file modified spigot/build/tmp/kapt3/incApCache/main/classpath-structure.bin
Binary file not shown.
Binary file modified spigot/build/tmp/kapt3/incApCache/main/java-cache.bin
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import org.bukkit.event.Listener
import org.bukkit.event.player.AsyncPlayerChatEvent
import org.bukkit.event.player.AsyncPlayerPreLoginEvent
import org.bukkit.event.player.PlayerJoinEvent
import org.bukkit.event.player.PlayerQuitEvent
import java.util.*
import java.util.concurrent.CompletableFuture
import java.util.concurrent.TimeUnit
Expand Down Expand Up @@ -62,14 +63,9 @@ class ProfileJoinListener : Listener {
@EventHandler
fun applyPerms(event: PlayerJoinEvent) {
val player = event.player
val profile = ProfileGameService.byId(player.uniqueId) ?: return

val perms = AccessiblePermissionHandler.pendingLoadPermissions.getOrDefault(player.uniqueId, mapOf())

CompletableFuture.runAsync {
AccessiblePermissionHandler.update(player, perms)
}

AccessiblePermissionHandler.pendingLoadPermissions.remove(player.uniqueId)
AccessiblePermissionHandler.update(player, profile.getPermissions())
}

@EventHandler
Expand Down Expand Up @@ -107,7 +103,14 @@ class ProfileJoinListener : Listener {
//doing this for syncing purposes and because the network manager needs to track when they were last on
ProfileGameService.handler.storeAsync(profile.uuid, profile)

AccessiblePermissionHandler.setupPlayer(event.uniqueId, profile.getPermissions())
}

@EventHandler
fun leave(event: PlayerQuitEvent)
{
val player = event.player

AccessiblePermissionHandler.remove(player)

}
}
Expand Down

0 comments on commit eff2211

Please sign in to comment.