Open-source multiplayer game server compatible with the RuneScape client https://www.openrs2.org/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
openrs2/archive/src/main/java/org/openrs2/archive/key/TextKeyReader.kt

17 lines
605 B

package org.openrs2.archive.key
import org.openrs2.crypto.XteaKey
import java.io.InputStream
public object TextKeyReader : KeyReader {
override fun read(input: InputStream): Sequence<XteaKey> {
val reader = input.bufferedReader()
val k0 = reader.readLine().toIntOrNull() ?: return emptySequence()
val k1 = reader.readLine().toIntOrNull() ?: return emptySequence()
val k2 = reader.readLine().toIntOrNull() ?: return emptySequence()
val k3 = reader.readLine().toIntOrNull() ?: return emptySequence()
return sequenceOf(XteaKey(k0, k1, k2, k3))
}
}