diff --git a/archive/src/main/kotlin/org/openrs2/archive/key/KeyExporter.kt b/archive/src/main/kotlin/org/openrs2/archive/key/KeyExporter.kt index 56f235f6e6..f41b0d6538 100644 --- a/archive/src/main/kotlin/org/openrs2/archive/key/KeyExporter.kt +++ b/archive/src/main/kotlin/org/openrs2/archive/key/KeyExporter.kt @@ -14,7 +14,18 @@ public class KeyExporter @Inject constructor( val validKeys: Long, val encryptedGroups: Long, val validGroups: Long - ) + ) { + val validKeysFraction: Double = if (allKeys == 0L) { + 1.0 + } else { + validKeys.toDouble() / allKeys + } + val validGroupsFraction: Double = if (encryptedGroups == 0L) { + 1.0 + } else { + validGroups.toDouble() / encryptedGroups + } + } public suspend fun count(): Stats { return database.execute { connection -> diff --git a/archive/src/main/resources/org/openrs2/archive/templates/keys/index.html b/archive/src/main/resources/org/openrs2/archive/templates/keys/index.html index 9edf2aea94..7ebf7017bd 100644 --- a/archive/src/main/resources/org/openrs2/archive/templates/keys/index.html +++ b/archive/src/main/resources/org/openrs2/archive/templates/keys/index.html @@ -16,14 +16,16 @@ There are 0 candidate keys in the database, of which - 0 + 0 have been validated against at least one encrypted group.

There are 0 encrypted groups in the database, of which - 0 + 0 have a validated key. This is equal to the total number of validated keys if and only if keys are not re-used.