-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
168 changed files
with
109 additions
and
64 deletions.
There are no files selected for viewing
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
BIN
+620 Bytes
(100%)
...ns/build/classes/kotlin/main/ltd/matrixstudios/alchemist/models/profile/GameProfile.class
Binary file not shown.
Binary file modified
BIN
-745 Bytes
(93%)
...classes/kotlin/main/ltd/matrixstudios/alchemist/service/expirable/PunishmentService.class
Binary file not shown.
Binary file modified
BIN
+3.1 KB
(140%)
.../classes/kotlin/main/ltd/matrixstudios/alchemist/service/expirable/RankGrantService.class
Binary file not shown.
Binary file modified
BIN
-143 Bytes
(99%)
...classes/kotlin/main/ltd/matrixstudios/alchemist/service/profiles/ProfileGameService.class
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
C:\Users\Maximus\Desktop\Matrix Development\Alchemist\commons\build\classes\kotlin\main\ltd\matrixstudios\alchemist\Alchemist.class;C:\Users\Maximus\Desktop\Matrix Development\Alchemist\commons\build\classes\kotlin\main\ltd\matrixstudios\alchemist\models\expirables\Expirable.class;C:\Users\Maximus\Desktop\Matrix Development\Alchemist\commons\build\classes\kotlin\main\ltd\matrixstudios\alchemist\models\filter\Filter.class;C:\Users\Maximus\Desktop\Matrix Development\Alchemist\commons\build\classes\kotlin\main\ltd\matrixstudios\alchemist\models\grant\Grantable.class;C:\Users\Maximus\Desktop\Matrix Development\Alchemist\commons\build\classes\kotlin\main\ltd\matrixstudios\alchemist\models\grant\types\Punishment.class;C:\Users\Maximus\Desktop\Matrix Development\Alchemist\commons\build\classes\kotlin\main\ltd\matrixstudios\alchemist\models\grant\types\RankGrant.class;C:\Users\Maximus\Desktop\Matrix Development\Alchemist\commons\build\classes\kotlin\main\ltd\matrixstudios\alchemist\models\grant\types\TagGrant.class;C:\Users\Maximus\Desktop\Matrix Development\Alchemist\commons\build\classes\kotlin\main\ltd\matrixstudios\alchemist\models\party\Party.class;C:\Users\Maximus\Desktop\Matrix Development\Alchemist\commons\build\classes\kotlin\main\ltd\matrixstudios\alchemist\models\party\PartyElevation.class;C:\Users\Maximus\Desktop\Matrix Development\Alchemist\commons\build\classes\kotlin\main\ltd\matrixstudios\alchemist\models\profile\GameProfile.class;C:\Users\Maximus\Desktop\Matrix Development\Alchemist\commons\build\classes\kotlin\main\ltd\matrixstudios\alchemist\models\ranks\Rank.class;C:\Users\Maximus\Desktop\Matrix Development\Alchemist\commons\build\classes\kotlin\main\ltd\matrixstudios\alchemist\models\server\UniqueServer.class;C:\Users\Maximus\Desktop\Matrix Development\Alchemist\commons\build\classes\kotlin\main\ltd\matrixstudios\alchemist\models\tags\Tag.class;C:\Users\Maximus\Desktop\Matrix Development\Alchemist\commons\build\classes\kotlin\main\ltd\matrixstudios\alchemist\punishments\PunishmentType.class;C:\Users\Maximus\Desktop\Matrix Development\Alchemist\commons\build\classes\kotlin\main\ltd\matrixstudios\alchemist\punishments\actor\ActorType.class;C:\Users\Maximus\Desktop\Matrix Development\Alchemist\commons\build\classes\kotlin\main\ltd\matrixstudios\alchemist\punishments\actor\DefaultActor.class;C:\Users\Maximus\Desktop\Matrix Development\Alchemist\commons\build\classes\kotlin\main\ltd\matrixstudios\alchemist\punishments\actor\executor\Executor.class;C:\Users\Maximus\Desktop\Matrix Development\Alchemist\commons\build\classes\kotlin\main\ltd\matrixstudios\alchemist\redis\RedisPacket.class;C:\Users\Maximus\Desktop\Matrix Development\Alchemist\commons\build\classes\kotlin\main\ltd\matrixstudios\alchemist\redis\RedisPacketManager.class;C:\Users\Maximus\Desktop\Matrix Development\Alchemist\commons\build\classes\kotlin\main\ltd\matrixstudios\alchemist\service\expirable\ExpiringService.class;C:\Users\Maximus\Desktop\Matrix Development\Alchemist\commons\build\classes\kotlin\main\ltd\matrixstudios\alchemist\service\expirable\PunishmentService.class;C:\Users\Maximus\Desktop\Matrix Development\Alchemist\commons\build\classes\kotlin\main\ltd\matrixstudios\alchemist\service\expirable\RankGrantService.class;C:\Users\Maximus\Desktop\Matrix Development\Alchemist\commons\build\classes\kotlin\main\ltd\matrixstudios\alchemist\service\expirable\TagGrantService.class;C:\Users\Maximus\Desktop\Matrix Development\Alchemist\commons\build\classes\kotlin\main\ltd\matrixstudios\alchemist\service\filter\FilterService.class;C:\Users\Maximus\Desktop\Matrix Development\Alchemist\commons\build\classes\kotlin\main\ltd\matrixstudios\alchemist\service\party\PartyService.class;C:\Users\Maximus\Desktop\Matrix Development\Alchemist\commons\build\classes\kotlin\main\ltd\matrixstudios\alchemist\service\profiles\ProfileGameService.class;C:\Users\Maximus\Desktop\Matrix Development\Alchemist\commons\build\classes\kotlin\main\ltd\matrixstudios\alchemist\service\ranks\RankService.class;C:\Users\Maximus\Desktop\Matrix Development\Alchemist\commons\build\classes\kotlin\main\ltd\matrixstudios\alchemist\service\server\UniqueServerService.class;C:\Users\Maximus\Desktop\Matrix Development\Alchemist\commons\build\classes\kotlin\main\ltd\matrixstudios\alchemist\service\tags\TagService.class | ||
C:\Users\Maximus\Desktop\Matrix Development\Alchemist\commons\build\classes\kotlin\main\ltd\matrixstudios\alchemist\Alchemist.class;C:\Users\Maximus\Desktop\Matrix Development\Alchemist\commons\build\classes\kotlin\main\ltd\matrixstudios\alchemist\models\expirables\Expirable.class;C:\Users\Maximus\Desktop\Matrix Development\Alchemist\commons\build\classes\kotlin\main\ltd\matrixstudios\alchemist\models\filter\Filter.class;C:\Users\Maximus\Desktop\Matrix Development\Alchemist\commons\build\classes\kotlin\main\ltd\matrixstudios\alchemist\models\grant\Grantable.class;C:\Users\Maximus\Desktop\Matrix Development\Alchemist\commons\build\classes\kotlin\main\ltd\matrixstudios\alchemist\models\grant\types\Punishment.class;C:\Users\Maximus\Desktop\Matrix Development\Alchemist\commons\build\classes\kotlin\main\ltd\matrixstudios\alchemist\models\grant\types\RankGrant.class;C:\Users\Maximus\Desktop\Matrix Development\Alchemist\commons\build\classes\kotlin\main\ltd\matrixstudios\alchemist\models\grant\types\TagGrant.class;C:\Users\Maximus\Desktop\Matrix Development\Alchemist\commons\build\classes\kotlin\main\ltd\matrixstudios\alchemist\models\party\Party.class;C:\Users\Maximus\Desktop\Matrix Development\Alchemist\commons\build\classes\kotlin\main\ltd\matrixstudios\alchemist\models\party\PartyElevation.class;C:\Users\Maximus\Desktop\Matrix Development\Alchemist\commons\build\classes\kotlin\main\ltd\matrixstudios\alchemist\models\profile\GameProfile$getCurrentRank$$inlined$sortedBy$1.class;C:\Users\Maximus\Desktop\Matrix Development\Alchemist\commons\build\classes\kotlin\main\ltd\matrixstudios\alchemist\models\profile\GameProfile.class;C:\Users\Maximus\Desktop\Matrix Development\Alchemist\commons\build\classes\kotlin\main\ltd\matrixstudios\alchemist\models\ranks\Rank.class;C:\Users\Maximus\Desktop\Matrix Development\Alchemist\commons\build\classes\kotlin\main\ltd\matrixstudios\alchemist\models\server\UniqueServer.class;C:\Users\Maximus\Desktop\Matrix Development\Alchemist\commons\build\classes\kotlin\main\ltd\matrixstudios\alchemist\models\tags\Tag.class;C:\Users\Maximus\Desktop\Matrix Development\Alchemist\commons\build\classes\kotlin\main\ltd\matrixstudios\alchemist\punishments\PunishmentType.class;C:\Users\Maximus\Desktop\Matrix Development\Alchemist\commons\build\classes\kotlin\main\ltd\matrixstudios\alchemist\punishments\actor\ActorType.class;C:\Users\Maximus\Desktop\Matrix Development\Alchemist\commons\build\classes\kotlin\main\ltd\matrixstudios\alchemist\punishments\actor\DefaultActor.class;C:\Users\Maximus\Desktop\Matrix Development\Alchemist\commons\build\classes\kotlin\main\ltd\matrixstudios\alchemist\punishments\actor\executor\Executor.class;C:\Users\Maximus\Desktop\Matrix Development\Alchemist\commons\build\classes\kotlin\main\ltd\matrixstudios\alchemist\redis\RedisPacket.class;C:\Users\Maximus\Desktop\Matrix Development\Alchemist\commons\build\classes\kotlin\main\ltd\matrixstudios\alchemist\redis\RedisPacketManager.class;C:\Users\Maximus\Desktop\Matrix Development\Alchemist\commons\build\classes\kotlin\main\ltd\matrixstudios\alchemist\service\expirable\ExpiringService.class;C:\Users\Maximus\Desktop\Matrix Development\Alchemist\commons\build\classes\kotlin\main\ltd\matrixstudios\alchemist\service\expirable\PunishmentService.class;C:\Users\Maximus\Desktop\Matrix Development\Alchemist\commons\build\classes\kotlin\main\ltd\matrixstudios\alchemist\service\expirable\RankGrantService.class;C:\Users\Maximus\Desktop\Matrix Development\Alchemist\commons\build\classes\kotlin\main\ltd\matrixstudios\alchemist\service\expirable\TagGrantService.class;C:\Users\Maximus\Desktop\Matrix Development\Alchemist\commons\build\classes\kotlin\main\ltd\matrixstudios\alchemist\service\filter\FilterService.class;C:\Users\Maximus\Desktop\Matrix Development\Alchemist\commons\build\classes\kotlin\main\ltd\matrixstudios\alchemist\service\party\PartyService.class;C:\Users\Maximus\Desktop\Matrix Development\Alchemist\commons\build\classes\kotlin\main\ltd\matrixstudios\alchemist\service\profiles\ProfileGameService.class;C:\Users\Maximus\Desktop\Matrix Development\Alchemist\commons\build\classes\kotlin\main\ltd\matrixstudios\alchemist\service\ranks\RankService.class;C:\Users\Maximus\Desktop\Matrix Development\Alchemist\commons\build\classes\kotlin\main\ltd\matrixstudios\alchemist\service\server\UniqueServerService.class;C:\Users\Maximus\Desktop\Matrix Development\Alchemist\commons\build\classes\kotlin\main\ltd\matrixstudios\alchemist\service\tags\TagService.class |
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
commons/build/kotlin/compileKotlin/caches-jvm/inputs/source-to-output.tab
Binary file not shown.
Binary file modified
BIN
+1.81 KB
(130%)
commons/build/kotlin/compileKotlin/caches-jvm/inputs/source-to-output.tab.values.at
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
commons/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/class-attributes.tab
Binary file not shown.
Binary file modified
BIN
+24 Bytes
(110%)
commons/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/class-attributes.tab.values.at
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
commons/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab
Binary file not shown.
Binary file modified
BIN
+826 Bytes
(120%)
...ns/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
commons/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...ns/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...uild/kotlin/compileKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
commons/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len
Binary file not shown.
Binary file modified
BIN
+1022 Bytes
(130%)
...ns/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
commons/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
commons/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/proto.tab
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
commons/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/proto.tab.values.at
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
commons/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab
Binary file not shown.
Binary file modified
BIN
+798 Bytes
(130%)
commons/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
commons/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/subtypes.tab
Binary file not shown.
Binary file modified
BIN
+259 Bytes
(130%)
commons/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/subtypes.tab.values.at
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
commons/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/supertypes.tab
Binary file not shown.
Binary file modified
BIN
+256 Bytes
(150%)
commons/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/supertypes.tab.values.at
Binary file not shown.
2 changes: 1 addition & 1 deletion
2
commons/build/kotlin/compileKotlin/caches-jvm/lookups/counters.tab
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
38 | ||
46 | ||
0 |
Binary file modified
BIN
+0 Bytes
(100%)
commons/build/kotlin/compileKotlin/caches-jvm/lookups/file-to-id.tab
Binary file not shown.
Binary file modified
BIN
+48 Bytes
(120%)
commons/build/kotlin/compileKotlin/caches-jvm/lookups/file-to-id.tab.values.at
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
commons/build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
commons/build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab.keystream
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
commons/build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab.keystream.len
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
commons/build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab.len
Binary file not shown.
Binary file modified
BIN
+826 Bytes
(120%)
commons/build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab.values.at
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
commons/build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab_i
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
commons/build/kotlin/compileKotlin/caches-jvm/lookups/lookups.tab
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
commons/build/kotlin/compileKotlin/caches-jvm/lookups/lookups.tab.keystream
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
commons/build/kotlin/compileKotlin/caches-jvm/lookups/lookups.tab.keystream.len
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
commons/build/kotlin/compileKotlin/caches-jvm/lookups/lookups.tab.len
Binary file not shown.
Binary file modified
BIN
+12.4 KB
(160%)
commons/build/kotlin/compileKotlin/caches-jvm/lookups/lookups.tab.values.at
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
commons/build/kotlin/compileKotlin/caches-jvm/lookups/lookups.tab_i
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
+1.49 KB
(170%)
...incrementalData/main/ltd/matrixstudios/alchemist/service/expirable/RankGrantService.class
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+2.31 KB
(180%)
...3/stubs/main/ltd/matrixstudios/alchemist/service/expirable/RankGrantService.kapt_metadata
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 27 additions & 15 deletions
42
commons/src/main/kotlin/ltd/matrixstudios/alchemist/service/expirable/RankGrantService.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,56 @@ | ||
package ltd.matrixstudios.alchemist.service.expirable | ||
|
||
import com.mongodb.client.model.Filters | ||
import io.github.nosequel.data.DataStoreType | ||
import ltd.matrixstudios.alchemist.Alchemist | ||
import ltd.matrixstudios.alchemist.models.grant.types.Punishment | ||
import ltd.matrixstudios.alchemist.models.grant.types.RankGrant | ||
import ltd.matrixstudios.alchemist.models.profile.GameProfile | ||
import ltd.matrixstudios.alchemist.models.ranks.Rank | ||
import ltd.matrixstudios.alchemist.punishments.PunishmentType | ||
import ltd.matrixstudios.alchemist.punishments.actor.ActorType | ||
import ltd.matrixstudios.alchemist.redis.RedisPacketManager | ||
import org.bson.Document | ||
import java.util.* | ||
import java.util.concurrent.CompletableFuture | ||
|
||
object RankGrantService : ExpiringService<RankGrant>() { | ||
|
||
var handler = Alchemist.dataHandler.createStoreType<UUID, RankGrant>(DataStoreType.MONGO) | ||
|
||
val collection = Alchemist.MongoConnectionPool.getCollection("rankgrant") //need this here because honey doesnt have a way to get raw collection | ||
|
||
var playerGrants = hashMapOf<UUID, Collection<RankGrant>>() | ||
|
||
fun getValues() : CompletableFuture<Collection<RankGrant>> { | ||
return handler.retrieveAllAsync() | ||
} | ||
|
||
fun getFromCache(uuid: UUID): Collection<RankGrant> { | ||
return playerGrants.getOrDefault(uuid, findByTarget(uuid).get()) | ||
} | ||
|
||
fun recalculatePlayer(gameProfile: GameProfile) { | ||
findByTarget(gameProfile.uuid).thenApply { playerGrants[gameProfile.uuid] = it } | ||
} | ||
|
||
|
||
fun save(rankGrant: RankGrant) { | ||
handler.storeAsync(rankGrant.uuid, rankGrant) | ||
} | ||
|
||
fun findByTarget(target: UUID) : Collection<RankGrant> { | ||
return getValues().get().filter { it.target == target } | ||
} | ||
fun findByTarget(target: UUID) : CompletableFuture<Collection<RankGrant>> { | ||
return CompletableFuture.supplyAsync { | ||
val sorted = collection.find(Document("target", target.toString())) | ||
|
||
val toReturn = mutableListOf<RankGrant>() | ||
|
||
for (rawDoc in sorted) | ||
{ | ||
val json = rawDoc.toJson() | ||
|
||
override fun clearOutModels() { | ||
getValues().get().forEach { | ||
if (!it.expirable.isActive() && it.removedBy == null) { | ||
it.removedBy = UUID.fromString("00000000-0000-0000-0000-000000000000") | ||
it.removedReason = "Expired" | ||
val gson = Alchemist.gson.fromJson(json, RankGrant::class.java) | ||
|
||
save(it) | ||
toReturn.add(gson) | ||
} | ||
|
||
return@supplyAsync toReturn | ||
} | ||
} | ||
|
||
override fun clearOutModels() { } | ||
} |
Oops, something went wrong.