Update kotlinter

Signed-off-by: Graham <gpe@openrs2.org>
Graham 2 years ago
parent d63af29679
commit c0056f9cb1
  1. 2
      .editorconfig
  2. 2
      archive/src/main/kotlin/org/openrs2/archive/cache/CacheDownloader.kt
  3. 2
      archive/src/main/kotlin/org/openrs2/archive/cache/OsrsJs5ChannelHandler.kt
  4. 4
      archive/src/main/kotlin/org/openrs2/archive/name/RuneStarNameDownloader.kt
  5. 12
      archive/src/main/kotlin/org/openrs2/archive/web/CachesController.kt
  6. 2
      asm/src/main/kotlin/org/openrs2/asm/packclass/PackClass.kt
  7. 140
      buffer/src/main/kotlin/org/openrs2/buffer/GeneratedByteBufExtensions.kt
  8. 2
      build.gradle.kts
  9. 2
      cache-550/src/main/kotlin/org/openrs2/cache/sprite/Sprite.kt
  10. 2
      cache/src/main/kotlin/org/openrs2/cache/Js5Index.kt
  11. 2
      cache/src/main/kotlin/org/openrs2/cache/Js5Pack.kt
  12. 2
      cache/src/main/kotlin/org/openrs2/cache/VersionList.kt
  13. 2
      cache/src/test/kotlin/org/openrs2/cache/Js5MasterIndexTest.kt
  14. 2
      compress/src/main/kotlin/org/openrs2/compress/bzip2/LibBzip2.kt
  15. 2
      conf/src/main/kotlin/org/openrs2/conf/CountryCode.kt
  16. 2
      game/src/main/kotlin/org/openrs2/game/net/login/LoginChannelHandler.kt
  17. 2
      game/src/main/kotlin/org/openrs2/game/store/PlayerStore.kt
  18. 2
      gradle/libs.versions.toml
  19. 8
      util/src/main/kotlin/org/openrs2/util/io/PathExtensions.kt

@ -15,7 +15,7 @@ indent_style = space
indent_size = 4 indent_size = 4
# see https://github.com/pinterest/ktlint/issues/764 # see https://github.com/pinterest/ktlint/issues/764
# noinspection EditorConfigKeyCorrectness # noinspection EditorConfigKeyCorrectness
disabled_rules = indent, parameter-list-wrapping disabled_rules = argument-list-wrapping, parameter-list-wrapping, wrapping
[*.md] [*.md]
max_line_length = 80 max_line_length = 80

@ -50,7 +50,7 @@ public class CacheDownloader @Inject constructor(
buildMajor, buildMajor,
game.lastMasterIndexId, game.lastMasterIndexId,
continuation, continuation,
importer, importer
) )
) )
} }

@ -24,7 +24,7 @@ public class OsrsJs5ChannelHandler(
build: Int, build: Int,
lastMasterIndexId: Int?, lastMasterIndexId: Int?,
continuation: Continuation<Unit>, continuation: Continuation<Unit>,
importer: CacheImporter, importer: CacheImporter
) : Js5ChannelHandler( ) : Js5ChannelHandler(
bootstrap, bootstrap,
scopeId, scopeId,

@ -51,11 +51,11 @@ public class RuneStarNameDownloader @Inject constructor(
private companion object { private companion object {
private val NAMES_ENDPOINTS = listOf( private val NAMES_ENDPOINTS = listOf(
URI("https://raw.githubusercontent.com/RuneStar/cache-names/master/names.tsv"), URI("https://raw.githubusercontent.com/RuneStar/cache-names/master/names.tsv"),
URI("https://raw.githubusercontent.com/Joshua-F/cache-names/master/names.tsv"), URI("https://raw.githubusercontent.com/Joshua-F/cache-names/master/names.tsv")
) )
private val INDIVIDUAL_NAMES_ENDPOINTS = listOf( private val INDIVIDUAL_NAMES_ENDPOINTS = listOf(
URI("https://raw.githubusercontent.com/RuneStar/cache-names/master/individual-names.tsv"), URI("https://raw.githubusercontent.com/RuneStar/cache-names/master/individual-names.tsv"),
URI("https://raw.githubusercontent.com/Joshua-F/cache-names/master/individual-names.tsv"), URI("https://raw.githubusercontent.com/Joshua-F/cache-names/master/individual-names.tsv")
) )
} }
} }

@ -58,9 +58,9 @@ public class CachesController @Inject constructor(
call.caching = CachingOptions( call.caching = CachingOptions(
cacheControl = CacheControl.MaxAge( cacheControl = CacheControl.MaxAge(
maxAgeSeconds = 900, maxAgeSeconds = 900,
visibility = CacheControl.Visibility.Public, visibility = CacheControl.Visibility.Public
), ),
expires = ZonedDateTime.now(ZoneOffset.UTC).plusSeconds(900), expires = ZonedDateTime.now(ZoneOffset.UTC).plusSeconds(900)
) )
call.respond(caches) call.respond(caches)
} }
@ -83,7 +83,7 @@ public class CachesController @Inject constructor(
ThymeleafContent( ThymeleafContent(
"caches/show.html", mapOf( "caches/show.html", mapOf(
"cache" to cache, "cache" to cache,
"scope" to scope, "scope" to scope
) )
) )
) )
@ -113,12 +113,12 @@ public class CachesController @Inject constructor(
caching = CachingOptions( caching = CachingOptions(
cacheControl = CacheControl.MaxAge( cacheControl = CacheControl.MaxAge(
maxAgeSeconds = 86400, maxAgeSeconds = 86400,
visibility = CacheControl.Visibility.Public, visibility = CacheControl.Visibility.Public
), ),
expires = ZonedDateTime.now(ZoneOffset.UTC).plusSeconds(86400), expires = ZonedDateTime.now(ZoneOffset.UTC).plusSeconds(86400)
) )
versions = listOf( versions = listOf(
EntityTagVersion(etag, weak = false), EntityTagVersion(etag, weak = false)
) )
} }
} }

@ -42,7 +42,7 @@ public object PackClass {
Opcodes.V1_3, Opcodes.V1_3,
Opcodes.V1_4, Opcodes.V1_4,
Opcodes.V1_5, Opcodes.V1_5,
Opcodes.V1_6, Opcodes.V1_6
) )
private const val INT_DESCRIPTOR = "I" private const val INT_DESCRIPTOR = "I"

@ -446,7 +446,7 @@ public fun ByteBuf.getBytesA(
index: Int, index: Int,
dst: ByteArray, dst: ByteArray,
dstIndex: Int, dstIndex: Int,
len: Int, len: Int
): ByteBuf { ): ByteBuf {
getBytes(index, dst, dstIndex, len) getBytes(index, dst, dstIndex, len)
for (i in 0 until len) { for (i in 0 until len) {
@ -467,7 +467,7 @@ public fun ByteBuf.getBytesA(index: Int, dst: ByteBuf): ByteBuf {
public fun ByteBuf.getBytesA( public fun ByteBuf.getBytesA(
index: Int, index: Int,
dst: ByteBuf, dst: ByteBuf,
len: Int, len: Int
): ByteBuf { ): ByteBuf {
val dstIndex = dst.writerIndex() val dstIndex = dst.writerIndex()
dst.ensureWritable(len) dst.ensureWritable(len)
@ -480,7 +480,7 @@ public fun ByteBuf.getBytesA(
index: Int, index: Int,
dst: ByteBuf, dst: ByteBuf,
dstIndex: Int, dstIndex: Int,
len: Int, len: Int
): ByteBuf { ): ByteBuf {
for (i in 0 until len) { for (i in 0 until len) {
dst.setByte(dstIndex + i, getByteA(index + i).toInt()) dst.setByte(dstIndex + i, getByteA(index + i).toInt())
@ -496,7 +496,7 @@ public fun ByteBuf.readBytesA(dst: ByteArray): ByteBuf {
public fun ByteBuf.readBytesA( public fun ByteBuf.readBytesA(
dst: ByteArray, dst: ByteArray,
dstIndex: Int, dstIndex: Int,
len: Int, len: Int
): ByteBuf { ): ByteBuf {
val index = readerIndex() val index = readerIndex()
getBytesA(index, dst, dstIndex, len) getBytesA(index, dst, dstIndex, len)
@ -524,7 +524,7 @@ public fun ByteBuf.readBytesA(dst: ByteBuf, len: Int): ByteBuf {
public fun ByteBuf.readBytesA( public fun ByteBuf.readBytesA(
dst: ByteBuf, dst: ByteBuf,
dstIndex: Int, dstIndex: Int,
len: Int, len: Int
): ByteBuf { ): ByteBuf {
val index = readerIndex() val index = readerIndex()
getBytesA(index, dst, dstIndex, len) getBytesA(index, dst, dstIndex, len)
@ -551,7 +551,7 @@ public fun ByteBuf.setBytesA(
index: Int, index: Int,
src: ByteArray, src: ByteArray,
srcIndex: Int, srcIndex: Int,
len: Int, len: Int
): ByteBuf { ): ByteBuf {
Unpooled.wrappedBuffer(src).use { buf -> Unpooled.wrappedBuffer(src).use { buf ->
setBytesA(index, buf, srcIndex, len) setBytesA(index, buf, srcIndex, len)
@ -570,7 +570,7 @@ public fun ByteBuf.setBytesA(index: Int, src: ByteBuf): ByteBuf {
public fun ByteBuf.setBytesA( public fun ByteBuf.setBytesA(
index: Int, index: Int,
src: ByteBuf, src: ByteBuf,
len: Int, len: Int
): ByteBuf { ): ByteBuf {
val srcIndex = src.readerIndex() val srcIndex = src.readerIndex()
setBytesA(index, src, srcIndex, len) setBytesA(index, src, srcIndex, len)
@ -582,7 +582,7 @@ public fun ByteBuf.setBytesA(
index: Int, index: Int,
src: ByteBuf, src: ByteBuf,
srcIndex: Int, srcIndex: Int,
len: Int, len: Int
): ByteBuf { ): ByteBuf {
for (i in 0 until len) { for (i in 0 until len) {
setByteA(index + i, src.getByte(srcIndex + i).toInt()) setByteA(index + i, src.getByte(srcIndex + i).toInt())
@ -598,7 +598,7 @@ public fun ByteBuf.writeBytesA(src: ByteArray): ByteBuf {
public fun ByteBuf.writeBytesA( public fun ByteBuf.writeBytesA(
src: ByteArray, src: ByteArray,
srcIndex: Int, srcIndex: Int,
len: Int, len: Int
): ByteBuf { ): ByteBuf {
val index = writerIndex() val index = writerIndex()
ensureWritable(len) ensureWritable(len)
@ -625,7 +625,7 @@ public fun ByteBuf.writeBytesA(src: ByteBuf, len: Int): ByteBuf {
public fun ByteBuf.writeBytesA( public fun ByteBuf.writeBytesA(
src: ByteBuf, src: ByteBuf,
srcIndex: Int, srcIndex: Int,
len: Int, len: Int
): ByteBuf { ): ByteBuf {
val index = writerIndex() val index = writerIndex()
ensureWritable(len) ensureWritable(len)
@ -643,7 +643,7 @@ public fun ByteBuf.getBytesC(
index: Int, index: Int,
dst: ByteArray, dst: ByteArray,
dstIndex: Int, dstIndex: Int,
len: Int, len: Int
): ByteBuf { ): ByteBuf {
getBytes(index, dst, dstIndex, len) getBytes(index, dst, dstIndex, len)
for (i in 0 until len) { for (i in 0 until len) {
@ -664,7 +664,7 @@ public fun ByteBuf.getBytesC(index: Int, dst: ByteBuf): ByteBuf {
public fun ByteBuf.getBytesC( public fun ByteBuf.getBytesC(
index: Int, index: Int,
dst: ByteBuf, dst: ByteBuf,
len: Int, len: Int
): ByteBuf { ): ByteBuf {
val dstIndex = dst.writerIndex() val dstIndex = dst.writerIndex()
dst.ensureWritable(len) dst.ensureWritable(len)
@ -677,7 +677,7 @@ public fun ByteBuf.getBytesC(
index: Int, index: Int,
dst: ByteBuf, dst: ByteBuf,
dstIndex: Int, dstIndex: Int,
len: Int, len: Int
): ByteBuf { ): ByteBuf {
for (i in 0 until len) { for (i in 0 until len) {
dst.setByte(dstIndex + i, getByteC(index + i).toInt()) dst.setByte(dstIndex + i, getByteC(index + i).toInt())
@ -693,7 +693,7 @@ public fun ByteBuf.readBytesC(dst: ByteArray): ByteBuf {
public fun ByteBuf.readBytesC( public fun ByteBuf.readBytesC(
dst: ByteArray, dst: ByteArray,
dstIndex: Int, dstIndex: Int,
len: Int, len: Int
): ByteBuf { ): ByteBuf {
val index = readerIndex() val index = readerIndex()
getBytesC(index, dst, dstIndex, len) getBytesC(index, dst, dstIndex, len)
@ -721,7 +721,7 @@ public fun ByteBuf.readBytesC(dst: ByteBuf, len: Int): ByteBuf {
public fun ByteBuf.readBytesC( public fun ByteBuf.readBytesC(
dst: ByteBuf, dst: ByteBuf,
dstIndex: Int, dstIndex: Int,
len: Int, len: Int
): ByteBuf { ): ByteBuf {
val index = readerIndex() val index = readerIndex()
getBytesC(index, dst, dstIndex, len) getBytesC(index, dst, dstIndex, len)
@ -748,7 +748,7 @@ public fun ByteBuf.setBytesC(
index: Int, index: Int,
src: ByteArray, src: ByteArray,
srcIndex: Int, srcIndex: Int,
len: Int, len: Int
): ByteBuf { ): ByteBuf {
Unpooled.wrappedBuffer(src).use { buf -> Unpooled.wrappedBuffer(src).use { buf ->
setBytesC(index, buf, srcIndex, len) setBytesC(index, buf, srcIndex, len)
@ -767,7 +767,7 @@ public fun ByteBuf.setBytesC(index: Int, src: ByteBuf): ByteBuf {
public fun ByteBuf.setBytesC( public fun ByteBuf.setBytesC(
index: Int, index: Int,
src: ByteBuf, src: ByteBuf,
len: Int, len: Int
): ByteBuf { ): ByteBuf {
val srcIndex = src.readerIndex() val srcIndex = src.readerIndex()
setBytesC(index, src, srcIndex, len) setBytesC(index, src, srcIndex, len)
@ -779,7 +779,7 @@ public fun ByteBuf.setBytesC(
index: Int, index: Int,
src: ByteBuf, src: ByteBuf,
srcIndex: Int, srcIndex: Int,
len: Int, len: Int
): ByteBuf { ): ByteBuf {
for (i in 0 until len) { for (i in 0 until len) {
setByteC(index + i, src.getByte(srcIndex + i).toInt()) setByteC(index + i, src.getByte(srcIndex + i).toInt())
@ -795,7 +795,7 @@ public fun ByteBuf.writeBytesC(src: ByteArray): ByteBuf {
public fun ByteBuf.writeBytesC( public fun ByteBuf.writeBytesC(
src: ByteArray, src: ByteArray,
srcIndex: Int, srcIndex: Int,
len: Int, len: Int
): ByteBuf { ): ByteBuf {
val index = writerIndex() val index = writerIndex()
ensureWritable(len) ensureWritable(len)
@ -822,7 +822,7 @@ public fun ByteBuf.writeBytesC(src: ByteBuf, len: Int): ByteBuf {
public fun ByteBuf.writeBytesC( public fun ByteBuf.writeBytesC(
src: ByteBuf, src: ByteBuf,
srcIndex: Int, srcIndex: Int,
len: Int, len: Int
): ByteBuf { ): ByteBuf {
val index = writerIndex() val index = writerIndex()
ensureWritable(len) ensureWritable(len)
@ -840,7 +840,7 @@ public fun ByteBuf.getBytesS(
index: Int, index: Int,
dst: ByteArray, dst: ByteArray,
dstIndex: Int, dstIndex: Int,
len: Int, len: Int
): ByteBuf { ): ByteBuf {
getBytes(index, dst, dstIndex, len) getBytes(index, dst, dstIndex, len)
for (i in 0 until len) { for (i in 0 until len) {
@ -861,7 +861,7 @@ public fun ByteBuf.getBytesS(index: Int, dst: ByteBuf): ByteBuf {
public fun ByteBuf.getBytesS( public fun ByteBuf.getBytesS(
index: Int, index: Int,
dst: ByteBuf, dst: ByteBuf,
len: Int, len: Int
): ByteBuf { ): ByteBuf {
val dstIndex = dst.writerIndex() val dstIndex = dst.writerIndex()
dst.ensureWritable(len) dst.ensureWritable(len)
@ -874,7 +874,7 @@ public fun ByteBuf.getBytesS(
index: Int, index: Int,
dst: ByteBuf, dst: ByteBuf,
dstIndex: Int, dstIndex: Int,
len: Int, len: Int
): ByteBuf { ): ByteBuf {
for (i in 0 until len) { for (i in 0 until len) {
dst.setByte(dstIndex + i, getByteS(index + i).toInt()) dst.setByte(dstIndex + i, getByteS(index + i).toInt())
@ -890,7 +890,7 @@ public fun ByteBuf.readBytesS(dst: ByteArray): ByteBuf {
public fun ByteBuf.readBytesS( public fun ByteBuf.readBytesS(
dst: ByteArray, dst: ByteArray,
dstIndex: Int, dstIndex: Int,
len: Int, len: Int
): ByteBuf { ): ByteBuf {
val index = readerIndex() val index = readerIndex()
getBytesS(index, dst, dstIndex, len) getBytesS(index, dst, dstIndex, len)
@ -918,7 +918,7 @@ public fun ByteBuf.readBytesS(dst: ByteBuf, len: Int): ByteBuf {
public fun ByteBuf.readBytesS( public fun ByteBuf.readBytesS(
dst: ByteBuf, dst: ByteBuf,
dstIndex: Int, dstIndex: Int,
len: Int, len: Int
): ByteBuf { ): ByteBuf {
val index = readerIndex() val index = readerIndex()
getBytesS(index, dst, dstIndex, len) getBytesS(index, dst, dstIndex, len)
@ -945,7 +945,7 @@ public fun ByteBuf.setBytesS(
index: Int, index: Int,
src: ByteArray, src: ByteArray,
srcIndex: Int, srcIndex: Int,
len: Int, len: Int
): ByteBuf { ): ByteBuf {
Unpooled.wrappedBuffer(src).use { buf -> Unpooled.wrappedBuffer(src).use { buf ->
setBytesS(index, buf, srcIndex, len) setBytesS(index, buf, srcIndex, len)
@ -964,7 +964,7 @@ public fun ByteBuf.setBytesS(index: Int, src: ByteBuf): ByteBuf {
public fun ByteBuf.setBytesS( public fun ByteBuf.setBytesS(
index: Int, index: Int,
src: ByteBuf, src: ByteBuf,
len: Int, len: Int
): ByteBuf { ): ByteBuf {
val srcIndex = src.readerIndex() val srcIndex = src.readerIndex()
setBytesS(index, src, srcIndex, len) setBytesS(index, src, srcIndex, len)
@ -976,7 +976,7 @@ public fun ByteBuf.setBytesS(
index: Int, index: Int,
src: ByteBuf, src: ByteBuf,
srcIndex: Int, srcIndex: Int,
len: Int, len: Int
): ByteBuf { ): ByteBuf {
for (i in 0 until len) { for (i in 0 until len) {
setByteS(index + i, src.getByte(srcIndex + i).toInt()) setByteS(index + i, src.getByte(srcIndex + i).toInt())
@ -992,7 +992,7 @@ public fun ByteBuf.writeBytesS(src: ByteArray): ByteBuf {
public fun ByteBuf.writeBytesS( public fun ByteBuf.writeBytesS(
src: ByteArray, src: ByteArray,
srcIndex: Int, srcIndex: Int,
len: Int, len: Int
): ByteBuf { ): ByteBuf {
val index = writerIndex() val index = writerIndex()
ensureWritable(len) ensureWritable(len)
@ -1019,7 +1019,7 @@ public fun ByteBuf.writeBytesS(src: ByteBuf, len: Int): ByteBuf {
public fun ByteBuf.writeBytesS( public fun ByteBuf.writeBytesS(
src: ByteBuf, src: ByteBuf,
srcIndex: Int, srcIndex: Int,
len: Int, len: Int
): ByteBuf { ): ByteBuf {
val index = writerIndex() val index = writerIndex()
ensureWritable(len) ensureWritable(len)
@ -1037,7 +1037,7 @@ public fun ByteBuf.getBytesReverse(
index: Int, index: Int,
dst: ByteArray, dst: ByteArray,
dstIndex: Int, dstIndex: Int,
len: Int, len: Int
): ByteBuf { ): ByteBuf {
getBytes(index, dst, dstIndex, len) getBytes(index, dst, dstIndex, len)
for (i in 0 until len) { for (i in 0 until len) {
@ -1059,7 +1059,7 @@ public fun ByteBuf.getBytesReverse(index: Int, dst: ByteBuf): ByteBuf {
public fun ByteBuf.getBytesReverse( public fun ByteBuf.getBytesReverse(
index: Int, index: Int,
dst: ByteBuf, dst: ByteBuf,
len: Int, len: Int
): ByteBuf { ): ByteBuf {
val dstIndex = dst.writerIndex() val dstIndex = dst.writerIndex()
dst.ensureWritable(len) dst.ensureWritable(len)
@ -1072,7 +1072,7 @@ public fun ByteBuf.getBytesReverse(
index: Int, index: Int,
dst: ByteBuf, dst: ByteBuf,
dstIndex: Int, dstIndex: Int,
len: Int, len: Int
): ByteBuf { ): ByteBuf {
for (i in 0 until len) { for (i in 0 until len) {
dst.setByte(dstIndex + i, getByte(index + len - i - 1).toInt()) dst.setByte(dstIndex + i, getByte(index + len - i - 1).toInt())
@ -1088,7 +1088,7 @@ public fun ByteBuf.readBytesReverse(dst: ByteArray): ByteBuf {
public fun ByteBuf.readBytesReverse( public fun ByteBuf.readBytesReverse(
dst: ByteArray, dst: ByteArray,
dstIndex: Int, dstIndex: Int,
len: Int, len: Int
): ByteBuf { ): ByteBuf {
val index = readerIndex() val index = readerIndex()
getBytesReverse(index, dst, dstIndex, len) getBytesReverse(index, dst, dstIndex, len)
@ -1116,7 +1116,7 @@ public fun ByteBuf.readBytesReverse(dst: ByteBuf, len: Int): ByteBuf {
public fun ByteBuf.readBytesReverse( public fun ByteBuf.readBytesReverse(
dst: ByteBuf, dst: ByteBuf,
dstIndex: Int, dstIndex: Int,
len: Int, len: Int
): ByteBuf { ): ByteBuf {
val index = readerIndex() val index = readerIndex()
getBytesReverse(index, dst, dstIndex, len) getBytesReverse(index, dst, dstIndex, len)
@ -1143,7 +1143,7 @@ public fun ByteBuf.setBytesReverse(
index: Int, index: Int,
src: ByteArray, src: ByteArray,
srcIndex: Int, srcIndex: Int,
len: Int, len: Int
): ByteBuf { ): ByteBuf {
Unpooled.wrappedBuffer(src).use { buf -> Unpooled.wrappedBuffer(src).use { buf ->
setBytesReverse(index, buf, srcIndex, len) setBytesReverse(index, buf, srcIndex, len)
@ -1162,7 +1162,7 @@ public fun ByteBuf.setBytesReverse(index: Int, src: ByteBuf): ByteBuf {
public fun ByteBuf.setBytesReverse( public fun ByteBuf.setBytesReverse(
index: Int, index: Int,
src: ByteBuf, src: ByteBuf,
len: Int, len: Int
): ByteBuf { ): ByteBuf {
val srcIndex = src.readerIndex() val srcIndex = src.readerIndex()
setBytesReverse(index, src, srcIndex, len) setBytesReverse(index, src, srcIndex, len)
@ -1174,7 +1174,7 @@ public fun ByteBuf.setBytesReverse(
index: Int, index: Int,
src: ByteBuf, src: ByteBuf,
srcIndex: Int, srcIndex: Int,
len: Int, len: Int
): ByteBuf { ): ByteBuf {
for (i in 0 until len) { for (i in 0 until len) {
setByte(index + i, src.getByte(srcIndex + len - i - 1).toInt()) setByte(index + i, src.getByte(srcIndex + len - i - 1).toInt())
@ -1190,7 +1190,7 @@ public fun ByteBuf.writeBytesReverse(src: ByteArray): ByteBuf {
public fun ByteBuf.writeBytesReverse( public fun ByteBuf.writeBytesReverse(
src: ByteArray, src: ByteArray,
srcIndex: Int, srcIndex: Int,
len: Int, len: Int
): ByteBuf { ): ByteBuf {
val index = writerIndex() val index = writerIndex()
ensureWritable(len) ensureWritable(len)
@ -1217,7 +1217,7 @@ public fun ByteBuf.writeBytesReverse(src: ByteBuf, len: Int): ByteBuf {
public fun ByteBuf.writeBytesReverse( public fun ByteBuf.writeBytesReverse(
src: ByteBuf, src: ByteBuf,
srcIndex: Int, srcIndex: Int,
len: Int, len: Int
): ByteBuf { ): ByteBuf {
val index = writerIndex() val index = writerIndex()
ensureWritable(len) ensureWritable(len)
@ -1235,7 +1235,7 @@ public fun ByteBuf.getBytesReverseA(
index: Int, index: Int,
dst: ByteArray, dst: ByteArray,
dstIndex: Int, dstIndex: Int,
len: Int, len: Int
): ByteBuf { ): ByteBuf {
getBytes(index, dst, dstIndex, len) getBytes(index, dst, dstIndex, len)
for (i in 0 until len) { for (i in 0 until len) {
@ -1257,7 +1257,7 @@ public fun ByteBuf.getBytesReverseA(index: Int, dst: ByteBuf): ByteBuf {
public fun ByteBuf.getBytesReverseA( public fun ByteBuf.getBytesReverseA(
index: Int, index: Int,
dst: ByteBuf, dst: ByteBuf,
len: Int, len: Int
): ByteBuf { ): ByteBuf {
val dstIndex = dst.writerIndex() val dstIndex = dst.writerIndex()
dst.ensureWritable(len) dst.ensureWritable(len)
@ -1270,7 +1270,7 @@ public fun ByteBuf.getBytesReverseA(
index: Int, index: Int,
dst: ByteBuf, dst: ByteBuf,
dstIndex: Int, dstIndex: Int,
len: Int, len: Int
): ByteBuf { ): ByteBuf {
for (i in 0 until len) { for (i in 0 until len) {
dst.setByte(dstIndex + i, getByteA(index + len - i - 1).toInt()) dst.setByte(dstIndex + i, getByteA(index + len - i - 1).toInt())
@ -1286,7 +1286,7 @@ public fun ByteBuf.readBytesReverseA(dst: ByteArray): ByteBuf {
public fun ByteBuf.readBytesReverseA( public fun ByteBuf.readBytesReverseA(
dst: ByteArray, dst: ByteArray,
dstIndex: Int, dstIndex: Int,
len: Int, len: Int
): ByteBuf { ): ByteBuf {
val index = readerIndex() val index = readerIndex()
getBytesReverseA(index, dst, dstIndex, len) getBytesReverseA(index, dst, dstIndex, len)
@ -1314,7 +1314,7 @@ public fun ByteBuf.readBytesReverseA(dst: ByteBuf, len: Int): ByteBuf {
public fun ByteBuf.readBytesReverseA( public fun ByteBuf.readBytesReverseA(
dst: ByteBuf, dst: ByteBuf,
dstIndex: Int, dstIndex: Int,
len: Int, len: Int
): ByteBuf { ): ByteBuf {
val index = readerIndex() val index = readerIndex()
getBytesReverseA(index, dst, dstIndex, len) getBytesReverseA(index, dst, dstIndex, len)
@ -1341,7 +1341,7 @@ public fun ByteBuf.setBytesReverseA(
index: Int, index: Int,
src: ByteArray, src: ByteArray,
srcIndex: Int, srcIndex: Int,
len: Int, len: Int
): ByteBuf { ): ByteBuf {
Unpooled.wrappedBuffer(src).use { buf -> Unpooled.wrappedBuffer(src).use { buf ->
setBytesReverseA(index, buf, srcIndex, len) setBytesReverseA(index, buf, srcIndex, len)
@ -1360,7 +1360,7 @@ public fun ByteBuf.setBytesReverseA(index: Int, src: ByteBuf): ByteBuf {
public fun ByteBuf.setBytesReverseA( public fun ByteBuf.setBytesReverseA(
index: Int, index: Int,
src: ByteBuf, src: ByteBuf,
len: Int, len: Int
): ByteBuf { ): ByteBuf {
val srcIndex = src.readerIndex() val srcIndex = src.readerIndex()
setBytesReverseA(index, src, srcIndex, len) setBytesReverseA(index, src, srcIndex, len)
@ -1372,7 +1372,7 @@ public fun ByteBuf.setBytesReverseA(
index: Int, index: Int,
src: ByteBuf, src: ByteBuf,
srcIndex: Int, srcIndex: Int,
len: Int, len: Int
): ByteBuf { ): ByteBuf {
for (i in 0 until len) { for (i in 0 until len) {
setByteA(index + i, src.getByte(srcIndex + len - i - 1).toInt()) setByteA(index + i, src.getByte(srcIndex + len - i - 1).toInt())
@ -1388,7 +1388,7 @@ public fun ByteBuf.writeBytesReverseA(src: ByteArray): ByteBuf {
public fun ByteBuf.writeBytesReverseA( public fun ByteBuf.writeBytesReverseA(
src: ByteArray, src: ByteArray,
srcIndex: Int, srcIndex: Int,
len: Int, len: Int
): ByteBuf { ): ByteBuf {
val index = writerIndex() val index = writerIndex()
ensureWritable(len) ensureWritable(len)
@ -1415,7 +1415,7 @@ public fun ByteBuf.writeBytesReverseA(src: ByteBuf, len: Int): ByteBuf {
public fun ByteBuf.writeBytesReverseA( public fun ByteBuf.writeBytesReverseA(
src: ByteBuf, src: ByteBuf,
srcIndex: Int, srcIndex: Int,
len: Int, len: Int
): ByteBuf { ): ByteBuf {
val index = writerIndex() val index = writerIndex()
ensureWritable(len) ensureWritable(len)
@ -1433,7 +1433,7 @@ public fun ByteBuf.getBytesReverseC(
index: Int, index: Int,
dst: ByteArray, dst: ByteArray,
dstIndex: Int, dstIndex: Int,
len: Int, len: Int
): ByteBuf { ): ByteBuf {
getBytes(index, dst, dstIndex, len) getBytes(index, dst, dstIndex, len)
for (i in 0 until len) { for (i in 0 until len) {
@ -1455,7 +1455,7 @@ public fun ByteBuf.getBytesReverseC(index: Int, dst: ByteBuf): ByteBuf {
public fun ByteBuf.getBytesReverseC( public fun ByteBuf.getBytesReverseC(
index: Int, index: Int,
dst: ByteBuf, dst: ByteBuf,
len: Int, len: Int
): ByteBuf { ): ByteBuf {
val dstIndex = dst.writerIndex() val dstIndex = dst.writerIndex()
dst.ensureWritable(len) dst.ensureWritable(len)
@ -1468,7 +1468,7 @@ public fun ByteBuf.getBytesReverseC(
index: Int, index: Int,
dst: ByteBuf, dst: ByteBuf,
dstIndex: Int, dstIndex: Int,
len: Int, len: Int
): ByteBuf { ): ByteBuf {
for (i in 0 until len) { for (i in 0 until len) {
dst.setByte(dstIndex + i, getByteC(index + len - i - 1).toInt()) dst.setByte(dstIndex + i, getByteC(index + len - i - 1).toInt())
@ -1484,7 +1484,7 @@ public fun ByteBuf.readBytesReverseC(dst: ByteArray): ByteBuf {
public fun ByteBuf.readBytesReverseC( public fun ByteBuf.readBytesReverseC(
dst: ByteArray, dst: ByteArray,
dstIndex: Int, dstIndex: Int,
len: Int, len: Int
): ByteBuf { ): ByteBuf {
val index = readerIndex() val index = readerIndex()
getBytesReverseC(index, dst, dstIndex, len) getBytesReverseC(index, dst, dstIndex, len)
@ -1512,7 +1512,7 @@ public fun ByteBuf.readBytesReverseC(dst: ByteBuf, len: Int): ByteBuf {
public fun ByteBuf.readBytesReverseC( public fun ByteBuf.readBytesReverseC(
dst: ByteBuf, dst: ByteBuf,
dstIndex: Int, dstIndex: Int,
len: Int, len: Int
): ByteBuf { ): ByteBuf {
val index = readerIndex() val index = readerIndex()
getBytesReverseC(index, dst, dstIndex, len) getBytesReverseC(index, dst, dstIndex, len)
@ -1539,7 +1539,7 @@ public fun ByteBuf.setBytesReverseC(
index: Int, index: Int,
src: ByteArray, src: ByteArray,
srcIndex: Int, srcIndex: Int,
len: Int, len: Int
): ByteBuf { ): ByteBuf {
Unpooled.wrappedBuffer(src).use { buf -> Unpooled.wrappedBuffer(src).use { buf ->
setBytesReverseC(index, buf, srcIndex, len) setBytesReverseC(index, buf, srcIndex, len)
@ -1558,7 +1558,7 @@ public fun ByteBuf.setBytesReverseC(index: Int, src: ByteBuf): ByteBuf {
public fun ByteBuf.setBytesReverseC( public fun ByteBuf.setBytesReverseC(
index: Int, index: Int,
src: ByteBuf, src: ByteBuf,
len: Int, len: Int
): ByteBuf { ): ByteBuf {
val srcIndex = src.readerIndex() val srcIndex = src.readerIndex()
setBytesReverseC(index, src, srcIndex, len) setBytesReverseC(index, src, srcIndex, len)
@ -1570,7 +1570,7 @@ public fun ByteBuf.setBytesReverseC(
index: Int, index: Int,
src: ByteBuf, src: ByteBuf,
srcIndex: Int, srcIndex: Int,
len: Int, len: Int
): ByteBuf { ): ByteBuf {
for (i in 0 until len) { for (i in 0 until len) {
setByteC(index + i, src.getByte(srcIndex + len - i - 1).toInt()) setByteC(index + i, src.getByte(srcIndex + len - i - 1).toInt())
@ -1586,7 +1586,7 @@ public fun ByteBuf.writeBytesReverseC(src: ByteArray): ByteBuf {
public fun ByteBuf.writeBytesReverseC( public fun ByteBuf.writeBytesReverseC(
src: ByteArray, src: ByteArray,
srcIndex: Int, srcIndex: Int,
len: Int, len: Int
): ByteBuf { ): ByteBuf {
val index = writerIndex() val index = writerIndex()
ensureWritable(len) ensureWritable(len)
@ -1613,7 +1613,7 @@ public fun ByteBuf.writeBytesReverseC(src: ByteBuf, len: Int): ByteBuf {
public fun ByteBuf.writeBytesReverseC( public fun ByteBuf.writeBytesReverseC(
src: ByteBuf, src: ByteBuf,
srcIndex: Int, srcIndex: Int,
len: Int, len: Int
): ByteBuf { ): ByteBuf {
val index = writerIndex() val index = writerIndex()
ensureWritable(len) ensureWritable(len)
@ -1631,7 +1631,7 @@ public fun ByteBuf.getBytesReverseS(
index: Int, index: Int,
dst: ByteArray, dst: ByteArray,
dstIndex: Int, dstIndex: Int,
len: Int, len: Int
): ByteBuf { ): ByteBuf {
getBytes(index, dst, dstIndex, len) getBytes(index, dst, dstIndex, len)
for (i in 0 until len) { for (i in 0 until len) {
@ -1653,7 +1653,7 @@ public fun ByteBuf.getBytesReverseS(index: Int, dst: ByteBuf): ByteBuf {
public fun ByteBuf.getBytesReverseS( public fun ByteBuf.getBytesReverseS(
index: Int, index: Int,
dst: ByteBuf, dst: ByteBuf,
len: Int, len: Int
): ByteBuf { ): ByteBuf {
val dstIndex = dst.writerIndex() val dstIndex = dst.writerIndex()
dst.ensureWritable(len) dst.ensureWritable(len)
@ -1666,7 +1666,7 @@ public fun ByteBuf.getBytesReverseS(
index: Int, index: Int,
dst: ByteBuf, dst: ByteBuf,
dstIndex: Int, dstIndex: Int,
len: Int, len: Int
): ByteBuf { ): ByteBuf {
for (i in 0 until len) { for (i in 0 until len) {
dst.setByte(dstIndex + i, getByteS(index + len - i - 1).toInt()) dst.setByte(dstIndex + i, getByteS(index + len - i - 1).toInt())
@ -1682,7 +1682,7 @@ public fun ByteBuf.readBytesReverseS(dst: ByteArray): ByteBuf {
public fun ByteBuf.readBytesReverseS( public fun ByteBuf.readBytesReverseS(
dst: ByteArray, dst: ByteArray,
dstIndex: Int, dstIndex: Int,
len: Int, len: Int
): ByteBuf { ): ByteBuf {
val index = readerIndex() val index = readerIndex()
getBytesReverseS(index, dst, dstIndex, len) getBytesReverseS(index, dst, dstIndex, len)
@ -1710,7 +1710,7 @@ public fun ByteBuf.readBytesReverseS(dst: ByteBuf, len: Int): ByteBuf {
public fun ByteBuf.readBytesReverseS( public fun ByteBuf.readBytesReverseS(
dst: ByteBuf, dst: ByteBuf,
dstIndex: Int, dstIndex: Int,
len: Int, len: Int
): ByteBuf { ): ByteBuf {
val index = readerIndex() val index = readerIndex()
getBytesReverseS(index, dst, dstIndex, len) getBytesReverseS(index, dst, dstIndex, len)
@ -1737,7 +1737,7 @@ public fun ByteBuf.setBytesReverseS(
index: Int, index: Int,
src: ByteArray, src: ByteArray,
srcIndex: Int, srcIndex: Int,
len: Int, len: Int
): ByteBuf { ): ByteBuf {
Unpooled.wrappedBuffer(src).use { buf -> Unpooled.wrappedBuffer(src).use { buf ->
setBytesReverseS(index, buf, srcIndex, len) setBytesReverseS(index, buf, srcIndex, len)
@ -1756,7 +1756,7 @@ public fun ByteBuf.setBytesReverseS(index: Int, src: ByteBuf): ByteBuf {
public fun ByteBuf.setBytesReverseS( public fun ByteBuf.setBytesReverseS(
index: Int, index: Int,
src: ByteBuf, src: ByteBuf,
len: Int, len: Int
): ByteBuf { ): ByteBuf {
val srcIndex = src.readerIndex() val srcIndex = src.readerIndex()
setBytesReverseS(index, src, srcIndex, len) setBytesReverseS(index, src, srcIndex, len)
@ -1768,7 +1768,7 @@ public fun ByteBuf.setBytesReverseS(
index: Int, index: Int,
src: ByteBuf, src: ByteBuf,
srcIndex: Int, srcIndex: Int,
len: Int, len: Int
): ByteBuf { ): ByteBuf {
for (i in 0 until len) { for (i in 0 until len) {
setByteS(index + i, src.getByte(srcIndex + len - i - 1).toInt()) setByteS(index + i, src.getByte(srcIndex + len - i - 1).toInt())
@ -1784,7 +1784,7 @@ public fun ByteBuf.writeBytesReverseS(src: ByteArray): ByteBuf {
public fun ByteBuf.writeBytesReverseS( public fun ByteBuf.writeBytesReverseS(
src: ByteArray, src: ByteArray,
srcIndex: Int, srcIndex: Int,
len: Int, len: Int
): ByteBuf { ): ByteBuf {
val index = writerIndex() val index = writerIndex()
ensureWritable(len) ensureWritable(len)
@ -1811,7 +1811,7 @@ public fun ByteBuf.writeBytesReverseS(src: ByteBuf, len: Int): ByteBuf {
public fun ByteBuf.writeBytesReverseS( public fun ByteBuf.writeBytesReverseS(
src: ByteBuf, src: ByteBuf,
srcIndex: Int, srcIndex: Int,
len: Int, len: Int
): ByteBuf { ): ByteBuf {
val index = writerIndex() val index = writerIndex()
ensureWritable(len) ensureWritable(len)

@ -53,7 +53,7 @@ allprojects {
plugins.withType<KotlinterPlugin> { plugins.withType<KotlinterPlugin> {
configure<KotlinterExtension> { configure<KotlinterExtension> {
// see https://github.com/pinterest/ktlint/issues/764 // see https://github.com/pinterest/ktlint/issues/764
disabledRules = arrayOf("indent", "parameter-list-wrapping") disabledRules = arrayOf("argument-list-wrapping", "parameter-list-wrapping", "wrapping")
} }
} }

@ -14,7 +14,7 @@ public class Sprite private constructor(
val xOffset: Int, val xOffset: Int,
val yOffset: Int, val yOffset: Int,
val innerWidth: Int, val innerWidth: Int,
val innerHeight: Int, val innerHeight: Int
) { ) {
val pixels = ByteArray(innerWidth * innerHeight) val pixels = ByteArray(innerWidth * innerHeight)
var alpha: ByteArray? = null var alpha: ByteArray? = null

@ -102,7 +102,7 @@ public class Js5Index(
public class MutableFile internal constructor( public class MutableFile internal constructor(
parent: MutableNamedEntryCollection<MutableFile>, parent: MutableNamedEntryCollection<MutableFile>,
override val id: Int, override val id: Int
) : MutableNamedEntry, File { ) : MutableNamedEntry, File {
private var parent: MutableNamedEntryCollection<MutableFile>? = parent private var parent: MutableNamedEntryCollection<MutableFile>? = parent

@ -23,7 +23,7 @@ public class Js5Pack private constructor(
index: Js5Index, index: Js5Index,
unpackedCacheSize: Int, unpackedCacheSize: Int,
private var packedIndex: ByteBuf, private var packedIndex: ByteBuf,
private val packed: Int2ObjectSortedMap<ByteBuf>, private val packed: Int2ObjectSortedMap<ByteBuf>
) : Archive(alloc, index, 0, UnpackedCache(unpackedCacheSize)), Closeable { ) : Archive(alloc, index, 0, UnpackedCache(unpackedCacheSize)), Closeable {
override fun packedExists(group: Int): Boolean { override fun packedExists(group: Int): Boolean {
return packed.containsKey(group) return packed.containsKey(group)

@ -4,7 +4,7 @@ import org.openrs2.buffer.use
public class VersionList( public class VersionList(
public val files: List<List<File>>, public val files: List<List<File>>,
public val maps: Map<Int, MapSquare>, public val maps: Map<Int, MapSquare>
) { ) {
public data class File( public data class File(
val version: Int, val version: Int,

@ -28,7 +28,7 @@ class Js5MasterIndexTest {
"0e1a2b93c80a41c7ad2a985dff707a6a8ff82e229cbc468f04191198920955a1" + "0e1a2b93c80a41c7ad2a985dff707a6a8ff82e229cbc468f04191198920955a1" +
"4b3d7eab77a17faf99208dee5b44afb789962ad79f230b3b59106a0af892219c" "4b3d7eab77a17faf99208dee5b44afb789962ad79f230b3b59106a0af892219c"
) )
), )
) )
), index ), index
) )

@ -56,7 +56,7 @@ public interface LibBzip2 {
public fun load(): LibBzip2 { public fun load(): LibBzip2 {
return LibraryLoader.loadLibrary( return LibraryLoader.loadLibrary(
LibBzip2::class.java, mapOf( LibBzip2::class.java, mapOf(
LibraryOption.LoadNow to true, LibraryOption.LoadNow to true
), "bz2" ), "bz2"
) )
} }

@ -245,5 +245,5 @@ public enum class CountryCode {
EH, // Western Sahara EH, // Western Sahara
YE, // Yemen YE, // Yemen
ZM, // Zambia ZM, // Zambia
ZW, // Zimbabwe ZW // Zimbabwe
} }

@ -209,7 +209,7 @@ public class LoginChannelHandler @Inject constructor(
msg.affiliate, msg.affiliate,
dateOfBirth, dateOfBirth,
country, country,
msg.email, msg.email
).bind() ).bind()
}.getErrorOr(CreateResponse.Ok) }.getErrorOr(CreateResponse.Ok)

@ -16,6 +16,6 @@ public interface PlayerStore {
affiliate: Int, affiliate: Int,
dateOfBirth: LocalDate, dateOfBirth: LocalDate,
country: CountryCode, country: CountryCode,
email: String, email: String
): Result<Unit, CreateResponse> ): Result<Unit, CreateResponse>
} }

@ -15,7 +15,7 @@ nettyIoUring = "0.0.15.Final"
[plugins] [plugins]
dependencyLicenseReport = { id = "com.github.jk1.dependency-license-report", version = "2.1" } dependencyLicenseReport = { id = "com.github.jk1.dependency-license-report", version = "2.1" }
dokka = { id = "org.jetbrains.dokka", version = "1.7.10" } dokka = { id = "org.jetbrains.dokka", version = "1.7.10" }
kotlinter = { id = "org.jmailen.kotlinter", version = "3.9.0" } kotlinter = { id = "org.jmailen.kotlinter", version = "3.12.0" }
shadow = { id = "com.github.johnrengelman.shadow", version = "7.1.2" } shadow = { id = "com.github.johnrengelman.shadow", version = "7.1.2" }
versions = { id = "com.github.ben-manes.versions", version = "0.42.0" } versions = { id = "com.github.ben-manes.versions", version = "0.42.0" }

@ -109,7 +109,7 @@ public inline fun <T> Path.useTempFile(
public inline fun <T> Path.atomicWrite( public inline fun <T> Path.atomicWrite(
sync: Boolean = true, sync: Boolean = true,
f: (Path) -> T, f: (Path) -> T
): T { ): T {
parent.useTempFile(".$fileName", ".tmp") { tempFile -> parent.useTempFile(".$fileName", ".tmp") { tempFile ->
val result = f(tempFile) val result = f(tempFile)
@ -134,7 +134,7 @@ public inline fun <T> Path.atomicWrite(
public inline fun <T> Path.useAtomicBufferedWriter( public inline fun <T> Path.useAtomicBufferedWriter(
vararg options: OpenOption, vararg options: OpenOption,
sync: Boolean = true, sync: Boolean = true,
f: (BufferedWriter) -> T, f: (BufferedWriter) -> T
): T { ): T {
return atomicWrite(sync) { path -> return atomicWrite(sync) { path ->
Files.newBufferedWriter(path, *options).use { writer -> Files.newBufferedWriter(path, *options).use { writer ->
@ -147,7 +147,7 @@ public inline fun <T> Path.useAtomicBufferedWriter(
cs: Charset, cs: Charset,
vararg options: OpenOption, vararg options: OpenOption,
sync: Boolean = true, sync: Boolean = true,
f: (BufferedWriter) -> T, f: (BufferedWriter) -> T
): T { ): T {
return atomicWrite(sync) { path -> return atomicWrite(sync) { path ->
Files.newBufferedWriter(path, cs, *options).use { writer -> Files.newBufferedWriter(path, cs, *options).use { writer ->
@ -159,7 +159,7 @@ public inline fun <T> Path.useAtomicBufferedWriter(
public inline fun <T> Path.useAtomicOutputStream( public inline fun <T> Path.useAtomicOutputStream(
vararg options: OpenOption, vararg options: OpenOption,
sync: Boolean = true, sync: Boolean = true,
f: (OutputStream) -> T, f: (OutputStream) -> T
): T { ): T {
return atomicWrite(sync) { path -> return atomicWrite(sync) { path ->
Files.newOutputStream(path, *options).use { output -> Files.newOutputStream(path, *options).use { output ->

Loading…
Cancel
Save