diff options
author | nea <nea@nea.moe> | 2023-06-02 02:32:02 +0200 |
---|---|---|
committer | nea <nea@nea.moe> | 2023-06-02 02:32:02 +0200 |
commit | 3d76538cef0cb150415ef5db734c80fb0dec7e85 (patch) | |
tree | 1fdeaf1f42e4a34d6637c3c74e9993ffcf8e4064 /src/main/kotlin/moe/nea/firmament/apis | |
parent | b61476608ec00642c5dc27cbfe02b4acf26c18d2 (diff) | |
download | firmament-3d76538cef0cb150415ef5db734c80fb0dec7e85.tar.gz firmament-3d76538cef0cb150415ef5db734c80fb0dec7e85.tar.bz2 firmament-3d76538cef0cb150415ef5db734c80fb0dec7e85.zip |
Display rank alongside name
Diffstat (limited to 'src/main/kotlin/moe/nea/firmament/apis')
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/apis/Profiles.kt | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/src/main/kotlin/moe/nea/firmament/apis/Profiles.kt b/src/main/kotlin/moe/nea/firmament/apis/Profiles.kt index b05d2fc..3e6b2cb 100644 --- a/src/main/kotlin/moe/nea/firmament/apis/Profiles.kt +++ b/src/main/kotlin/moe/nea/firmament/apis/Profiles.kt @@ -11,6 +11,8 @@ import kotlinx.serialization.Serializable import kotlinx.serialization.UseSerializers import kotlin.reflect.KProperty1 import net.minecraft.util.DyeColor +import moe.nea.firmament.repo.RepoManager +import moe.nea.firmament.util.LegacyFormattingCode import moe.nea.firmament.util.json.DashlessUUIDSerializer import moe.nea.firmament.util.json.InstantAsLongSerializer @@ -105,5 +107,33 @@ data class Pet( val candyUsed: Int, val heldItem: String?, val skin: String?, +) + +@Serializable +data class PlayerResponse( + val success: Boolean, + val player: PlayerData, +) - ) +@Serializable +data class PlayerData( + val uuid: UUID, + val firstLogin: Instant, + val lastLogin: Instant, + @SerialName("playername") + val playerName: String, + val achievementsOneTime: List<String> = listOf(), + @SerialName("newPackageRank") + val packageRank: String?, + val monthlyPackageRank: String? = null, + val rankPlusColor: String = "GOLD" +) { + val rankPlusDyeColor = LegacyFormattingCode.values().find { it.name == rankPlusColor } ?: LegacyFormattingCode.GOLD + val rankData get() = RepoManager.neuRepo.constants.misc.ranks[monthlyPackageRank ?: packageRank] +} + +@Serializable +data class AshconNameLookup( + val username: String, + val uuid: UUID, +) |