From c0056f9cb171f49376df4c8dbcd91ab5febfa82d Mon Sep 17 00:00:00 2001 From: Graham Date: Fri, 30 Sep 2022 20:35:51 +0100 Subject: [PATCH] Update kotlinter Signed-off-by: Graham --- .editorconfig | 2 +- .../openrs2/archive/cache/CacheDownloader.kt | 2 +- .../openrs2/archive/cache/CacheExporter.kt | 24 +-- .../openrs2/archive/cache/CacheImporter.kt | 84 +++++------ .../archive/cache/OsrsJs5ChannelHandler.kt | 2 +- .../org/openrs2/archive/game/GameDatabase.kt | 2 +- .../org/openrs2/archive/key/KeyBruteForcer.kt | 30 ++-- .../org/openrs2/archive/key/KeyExporter.kt | 4 +- .../org/openrs2/archive/key/KeyImporter.kt | 6 +- .../org/openrs2/archive/map/MapRenderer.kt | 10 +- .../org/openrs2/archive/name/NameImporter.kt | 2 +- .../archive/name/RuneStarNameDownloader.kt | 4 +- .../openrs2/archive/web/CachesController.kt | 12 +- .../org/openrs2/asm/packclass/PackClass.kt | 2 +- .../buffer/GeneratedByteBufExtensions.kt | 140 +++++++++--------- build.gradle.kts | 2 +- .../kotlin/org/openrs2/cache/sprite/Sprite.kt | 2 +- .../main/kotlin/org/openrs2/cache/Js5Index.kt | 2 +- .../main/kotlin/org/openrs2/cache/Js5Pack.kt | 2 +- .../kotlin/org/openrs2/cache/OpenNxtStore.kt | 4 +- .../kotlin/org/openrs2/cache/VersionList.kt | 2 +- .../org/openrs2/cache/Js5MasterIndexTest.kt | 2 +- .../org/openrs2/compress/bzip2/LibBzip2.kt | 2 +- .../kotlin/org/openrs2/conf/CountryCode.kt | 2 +- .../kotlin/org/openrs2/game/net/http/Http.kt | 2 +- .../game/net/login/LoginChannelHandler.kt | 2 +- .../org/openrs2/game/store/PlayerStore.kt | 2 +- gradle/libs.versions.toml | 2 +- .../patcher/transform/HighDpiTransformer.kt | 2 +- .../transform/InvalidKeyTransformer.kt | 2 +- .../org/openrs2/util/io/PathExtensions.kt | 8 +- 31 files changed, 183 insertions(+), 183 deletions(-) diff --git a/.editorconfig b/.editorconfig index dc0badf768..75d1091bb0 100644 --- a/.editorconfig +++ b/.editorconfig @@ -15,7 +15,7 @@ indent_style = space indent_size = 4 # see https://github.com/pinterest/ktlint/issues/764 # noinspection EditorConfigKeyCorrectness -disabled_rules = indent, parameter-list-wrapping +disabled_rules = argument-list-wrapping, parameter-list-wrapping, wrapping [*.md] max_line_length = 80 diff --git a/archive/src/main/kotlin/org/openrs2/archive/cache/CacheDownloader.kt b/archive/src/main/kotlin/org/openrs2/archive/cache/CacheDownloader.kt index 2727732e0a..964a93f41b 100644 --- a/archive/src/main/kotlin/org/openrs2/archive/cache/CacheDownloader.kt +++ b/archive/src/main/kotlin/org/openrs2/archive/cache/CacheDownloader.kt @@ -50,7 +50,7 @@ public class CacheDownloader @Inject constructor( buildMajor, game.lastMasterIndexId, continuation, - importer, + importer ) ) } diff --git a/archive/src/main/kotlin/org/openrs2/archive/cache/CacheExporter.kt b/archive/src/main/kotlin/org/openrs2/archive/cache/CacheExporter.kt index bbc2718b97..2ba30504ae 100644 --- a/archive/src/main/kotlin/org/openrs2/archive/cache/CacheExporter.kt +++ b/archive/src/main/kotlin/org/openrs2/archive/cache/CacheExporter.kt @@ -235,7 +235,7 @@ public class CacheExporter @Inject constructor( cs.groups, cs.valid_keys, cs.keys, cs.size, cs.blocks ) t ORDER BY t.game ASC, t.environment ASC, t.language ASC, t.builds[1] ASC, t.timestamp ASC - """.trimIndent() + """.trimIndent() ).use { stmt -> stmt.executeQuery().use { rows -> val caches = mutableListOf() @@ -313,7 +313,7 @@ public class CacheExporter @Inject constructor( LEFT JOIN blobs b ON b.id = t.blob_id LEFT JOIN cache_stats cs ON cs.scope_id = s.id AND cs.cache_id = c.id WHERE s.name = ? AND c.id = ? - """.trimIndent() + """.trimIndent() ).use { stmt -> stmt.setString(1, scope) stmt.setInt(2, id) @@ -373,7 +373,7 @@ public class CacheExporter @Inject constructor( JOIN languages l ON l.id = v.language_id WHERE sc.name = ? AND s.cache_id = ? ORDER BY s.name ASC - """.trimIndent() + """.trimIndent() ).use { stmt -> stmt.setString(1, scope) stmt.setInt(2, id) @@ -417,7 +417,7 @@ public class CacheExporter @Inject constructor( SELECT url FROM updates WHERE cache_id = ? - """.trimIndent() + """.trimIndent() ).use { stmt -> stmt.setInt(1, id) @@ -443,7 +443,7 @@ public class CacheExporter @Inject constructor( LEFT JOIN resolve_archive(a.archive_id, a.crc32) b ON TRUE WHERE a.crc_table_id = ? ORDER BY archive_id ASC - """.trimIndent() + """.trimIndent() ).use { stmt -> stmt.setString(1, scope) stmt.setInt(2, id) @@ -479,7 +479,7 @@ public class CacheExporter @Inject constructor( JOIN version_list_stats s ON s.blob_id = b.id WHERE a.crc_table_id = ? AND a.archive_id = 5 ORDER BY s.index_id ASC - """.trimIndent() + """.trimIndent() ).use { stmt -> stmt.setInt(1, id) @@ -526,7 +526,7 @@ public class CacheExporter @Inject constructor( WHERE sc.name = ? AND s.cache_id = ? GROUP BY g.name, e.name, l.iso_code LIMIT 1 - """.trimIndent() + """.trimIndent() ).use { stmt -> stmt.setString(1, scope) stmt.setInt(2, id) @@ -579,7 +579,7 @@ public class CacheExporter @Inject constructor( SELECT f.data FROM resolved_files f WHERE f.crc_table_id = ? AND f.index_id = ? AND f.file_id = ? - """.trimIndent() + """.trimIndent() ).use { stmt -> stmt.setString(1, scope) stmt.setInt(2, id) @@ -609,7 +609,7 @@ public class CacheExporter @Inject constructor( SELECT id FROM crc_tables WHERE id = ? - """.trimIndent() + """.trimIndent() ).use { stmt -> stmt.setInt(1, id) @@ -635,7 +635,7 @@ public class CacheExporter @Inject constructor( FROM resolved_groups g JOIN scopes s ON s.id = g.scope_id WHERE s.name = ? AND g.master_index_id = ? - """.trimIndent() + """.trimIndent() ).use { stmt -> stmt.fetchSize = BATCH_SIZE stmt.setString(1, scope) @@ -677,7 +677,7 @@ public class CacheExporter @Inject constructor( SELECT index_id, file_id, data, version FROM resolved_files WHERE crc_table_id = ? - """.trimIndent() + """.trimIndent() ).use { stmt -> stmt.fetchSize = BATCH_SIZE stmt.setInt(1, id) @@ -717,7 +717,7 @@ public class CacheExporter @Inject constructor( JOIN keys k ON k.id = g.key_id LEFT JOIN names n ON n.hash = g.name_hash AND n.name ~ '^l(?:[0-9]|[1-9][0-9])_(?:[0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$' WHERE s.name = ? AND g.master_index_id = ? - """.trimIndent() + """.trimIndent() ).use { stmt -> stmt.setString(1, scope) stmt.setInt(2, id) diff --git a/archive/src/main/kotlin/org/openrs2/archive/cache/CacheImporter.kt b/archive/src/main/kotlin/org/openrs2/archive/cache/CacheImporter.kt index 99c193883e..df52a17e84 100644 --- a/archive/src/main/kotlin/org/openrs2/archive/cache/CacheImporter.kt +++ b/archive/src/main/kotlin/org/openrs2/archive/cache/CacheImporter.kt @@ -297,7 +297,7 @@ public class CacheImporter @Inject constructor( UPDATE game_variants SET build_major = ?, build_minor = ? WHERE id = ? - """.trimIndent() + """.trimIndent() ).use { stmt -> stmt.setInt(1, buildMajor) stmt.setObject(2, buildMinor, Types.INTEGER) @@ -341,7 +341,7 @@ public class CacheImporter @Inject constructor( LEFT JOIN resolve_index(?, a2.archive_id, a2.crc32, a2.version) c ON TRUE WHERE a.master_index_id = ? ORDER BY a.archive_id ASC - """.trimIndent() + """.trimIndent() ).use { stmt -> stmt.setObject(1, lastId, Types.INTEGER) stmt.setInt(2, scopeId) @@ -404,7 +404,7 @@ public class CacheImporter @Inject constructor( LEFT JOIN resolve_group(i.scope_id, i.archive_id, ig2.group_id, ig2.crc32, ig2.version) c ON TRUE WHERE ig.container_id = ? AND c.id IS NULL ORDER BY ig.group_id ASC - """.trimIndent() + """.trimIndent() ).use { stmt -> stmt.setObject(1, lastMasterIndexId, Types.INTEGER) stmt.setInt(2, archive) @@ -458,7 +458,7 @@ public class CacheImporter @Inject constructor( SELECT id FROM master_indexes WHERE container_id = ? AND format = ?::master_index_format - """.trimIndent() + """.trimIndent() ).use { stmt -> stmt.setLong(1, containerId) stmt.setString(2, masterIndex.index.format.name.lowercase()) @@ -477,7 +477,7 @@ public class CacheImporter @Inject constructor( INSERT INTO caches (id) VALUES (DEFAULT) RETURNING id - """.trimIndent() + """.trimIndent() ).use { stmt -> stmt.executeQuery().use { rows -> check(rows.next()) @@ -489,7 +489,7 @@ public class CacheImporter @Inject constructor( """ INSERT INTO master_indexes (id, container_id, format) VALUES (?, ?, ?::master_index_format) - """.trimIndent() + """.trimIndent() ).use { stmt -> stmt.setInt(1, masterIndexId) stmt.setLong(2, containerId) @@ -504,7 +504,7 @@ public class CacheImporter @Inject constructor( master_index_id, archive_id, crc32, version, whirlpool, groups, total_uncompressed_length ) VALUES (?, ?, ?, ?, ?, ?, ?) - """.trimIndent() + """.trimIndent() ).use { stmt -> for ((i, entry) in masterIndex.index.entries.withIndex()) { stmt.setInt(1, masterIndexId) @@ -558,7 +558,7 @@ public class CacheImporter @Inject constructor( SELECT id FROM sources WHERE type = 'js5remote' AND cache_id = ? AND game_id = ? AND build_major = ? AND build_minor IS NOT DISTINCT FROM ? - """.trimIndent() + """.trimIndent() ).use { stmt -> stmt.setInt(1, cacheId) stmt.setInt(2, gameId) @@ -578,7 +578,7 @@ public class CacheImporter @Inject constructor( INSERT INTO sources (type, cache_id, game_id, build_major, build_minor, timestamp, name, description, url) VALUES (?::source_type, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING id - """.trimIndent() + """.trimIndent() ).use { stmt -> stmt.setString(1, type.toString().lowercase()) stmt.setInt(2, cacheId) @@ -644,7 +644,7 @@ public class CacheImporter @Inject constructor( INSERT INTO groups (scope_id, archive_id, group_id, version, version_truncated, container_id) VALUES (?, ?, ?, ?, ?, ?) ON CONFLICT DO NOTHING - """.trimIndent() + """.trimIndent() ).use { stmt -> for ((i, group) in groups.withIndex()) { stmt.setInt(1, scopeId) @@ -664,7 +664,7 @@ public class CacheImporter @Inject constructor( INSERT INTO source_groups (source_id, archive_id, group_id, version, version_truncated, container_id) VALUES (?, ?, ?, ?, ?, ?) ON CONFLICT DO NOTHING - """.trimIndent() + """.trimIndent() ).use { stmt -> for ((i, group) in groups.withIndex()) { stmt.setInt(1, sourceId) @@ -704,7 +704,7 @@ public class CacheImporter @Inject constructor( container_id, protocol, version, has_names, has_digests, has_lengths, has_uncompressed_checksums ) VALUES (?, ?, ?, ?, ?, ?, ?) - """.trimIndent() + """.trimIndent() ).use { stmt -> stmt.setLong(1, containerId) stmt.setInt(2, index.index.protocol.id) @@ -732,7 +732,7 @@ public class CacheImporter @Inject constructor( uncompressed_crc32 ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) - """.trimIndent() + """.trimIndent() ).use { stmt -> for (group in index.index) { stmt.setLong(1, containerId) @@ -771,7 +771,7 @@ public class CacheImporter @Inject constructor( """ INSERT INTO index_files (container_id, group_id, file_id, name_hash) VALUES (?, ?, ?, ?) - """.trimIndent() + """.trimIndent() ).use { stmt -> for (group in index.index) { for (file in group) { @@ -799,7 +799,7 @@ public class CacheImporter @Inject constructor( connection.prepareStatement( """ LOCK TABLE containers IN EXCLUSIVE MODE - """.trimIndent() + """.trimIndent() ).use { stmt -> stmt.execute() } @@ -816,7 +816,7 @@ public class CacheImporter @Inject constructor( encrypted BOOLEAN NOT NULL, empty_loc BOOLEAN NULL ) ON COMMIT DROP - """.trimIndent() + """.trimIndent() ).use { stmt -> stmt.execute() } @@ -829,7 +829,7 @@ public class CacheImporter @Inject constructor( whirlpool BYTEA NOT NULL, data BYTEA NOT NULL ) ON COMMIT DROP - """.trimIndent() + """.trimIndent() ).use { stmt -> stmt.execute() } @@ -843,7 +843,7 @@ public class CacheImporter @Inject constructor( connection.prepareStatement( """ TRUNCATE TABLE tmp_containers - """.trimIndent() + """.trimIndent() ).use { stmt -> stmt.execute() } @@ -852,7 +852,7 @@ public class CacheImporter @Inject constructor( """ INSERT INTO tmp_containers (index, crc32, whirlpool, data, uncompressed_length, uncompressed_crc32, encrypted, empty_loc) VALUES (?, ?, ?, ?, ?, ?, ?, ?) - """.trimIndent() + """.trimIndent() ).use { stmt -> for ((i, container) in containers.withIndex()) { stmt.setInt(1, i) @@ -883,7 +883,7 @@ public class CacheImporter @Inject constructor( LEFT JOIN containers c ON c.whirlpool = t.whirlpool WHERE c.whirlpool IS NULL ON CONFLICT DO NOTHING - """.trimIndent() + """.trimIndent() ).use { stmt -> stmt.execute() } @@ -896,7 +896,7 @@ public class CacheImporter @Inject constructor( FROM tmp_containers t JOIN containers c ON c.whirlpool = t.whirlpool ORDER BY t.index ASC - """.trimIndent() + """.trimIndent() ).use { stmt -> stmt.executeQuery().use { rows -> while (rows.next()) { @@ -917,7 +917,7 @@ public class CacheImporter @Inject constructor( connection.prepareStatement( """ TRUNCATE TABLE tmp_blobs - """.trimIndent() + """.trimIndent() ).use { stmt -> stmt.execute() } @@ -926,7 +926,7 @@ public class CacheImporter @Inject constructor( """ INSERT INTO tmp_blobs (index, crc32, whirlpool, data) VALUES (?, ?, ?, ?) - """.trimIndent() + """.trimIndent() ).use { stmt -> for ((i, blob) in blobs.withIndex()) { stmt.setInt(1, i) @@ -948,7 +948,7 @@ public class CacheImporter @Inject constructor( LEFT JOIN blobs b ON b.whirlpool = t.whirlpool WHERE b.whirlpool IS NULL ON CONFLICT DO NOTHING - """.trimIndent() + """.trimIndent() ).use { stmt -> stmt.execute() } @@ -961,7 +961,7 @@ public class CacheImporter @Inject constructor( FROM tmp_blobs t JOIN blobs b ON b.whirlpool = t.whirlpool ORDER BY t.index ASC - """.trimIndent() + """.trimIndent() ).use { stmt -> stmt.executeQuery().use { rows -> while (rows.next()) { @@ -1007,7 +1007,7 @@ public class CacheImporter @Inject constructor( connection.prepareStatement( """ UPDATE game_variants SET last_master_index_id = ? WHERE id = ? - """.trimIndent() + """.trimIndent() ).use { stmt -> stmt.setInt(1, masterIndexId) stmt.setInt(2, gameId) @@ -1114,7 +1114,7 @@ public class CacheImporter @Inject constructor( SELECT id FROM crc_tables WHERE blob_id = ? - """.trimIndent() + """.trimIndent() ).use { stmt -> stmt.setLong(1, blobId) @@ -1132,7 +1132,7 @@ public class CacheImporter @Inject constructor( INSERT INTO caches (id) VALUES (DEFAULT) RETURNING id - """.trimIndent() + """.trimIndent() ).use { stmt -> stmt.executeQuery().use { rows -> check(rows.next()) @@ -1144,7 +1144,7 @@ public class CacheImporter @Inject constructor( """ INSERT INTO crc_tables (id, blob_id) VALUES (?, ?) - """.trimIndent() + """.trimIndent() ).use { stmt -> stmt.setInt(1, checksumTableId) stmt.setLong(2, blobId) @@ -1156,7 +1156,7 @@ public class CacheImporter @Inject constructor( """ INSERT INTO crc_table_archives (crc_table_id, archive_id, crc32) VALUES (?, ?, ?) - """.trimIndent() + """.trimIndent() ).use { stmt -> for ((i, entry) in checksumTable.table.entries.withIndex()) { stmt.setInt(1, checksumTableId) @@ -1194,7 +1194,7 @@ public class CacheImporter @Inject constructor( INSERT INTO archives (archive_id, blob_id) VALUES (?, ?) ON CONFLICT DO NOTHING - """.trimIndent() + """.trimIndent() ).use { stmt -> stmt.setInt(1, archive.id) stmt.setLong(2, blobId) @@ -1207,7 +1207,7 @@ public class CacheImporter @Inject constructor( INSERT INTO source_archives (source_id, archive_id, blob_id) VALUES (?, ?, ?) ON CONFLICT DO NOTHING - """.trimIndent() + """.trimIndent() ).use { stmt -> stmt.setInt(1, sourceId) stmt.setInt(2, archive.id) @@ -1223,7 +1223,7 @@ public class CacheImporter @Inject constructor( """ INSERT INTO version_lists (blob_id) VALUES (?) - """.trimIndent() + """.trimIndent() ).use { stmt -> try { stmt.setLong(1, blobId) @@ -1242,7 +1242,7 @@ public class CacheImporter @Inject constructor( """ INSERT INTO version_list_files (blob_id, index_id, file_id, version, crc32) VALUES (?, ?, ?, ?, ?) - """.trimIndent() + """.trimIndent() ).use { stmt -> for ((indexId, files) in versionList.files.withIndex()) { for ((fileId, file) in files.withIndex()) { @@ -1267,7 +1267,7 @@ public class CacheImporter @Inject constructor( """ INSERT INTO version_list_maps (blob_id, map_square, map_file_id, loc_file_id, free_to_play) VALUES (?, ?, ?, ?, ?) - """.trimIndent() + """.trimIndent() ).use { stmt -> for ((mapSquare, map) in versionList.maps) { stmt.setLong(1, blobId) @@ -1306,7 +1306,7 @@ public class CacheImporter @Inject constructor( INSERT INTO files (index_id, file_id, version, blob_id) VALUES (?, ?, ?, ?) ON CONFLICT DO NOTHING - """.trimIndent() + """.trimIndent() ).use { stmt -> for ((i, file) in files.withIndex()) { stmt.setInt(1, file.index) @@ -1325,7 +1325,7 @@ public class CacheImporter @Inject constructor( INSERT INTO source_files (source_id, index_id, file_id, version, blob_id) VALUES (?, ?, ?, ?, ?) ON CONFLICT DO NOTHING - """.trimIndent() + """.trimIndent() ).use { stmt -> for ((i, file) in files.withIndex()) { stmt.setInt(1, sourceId) @@ -1346,7 +1346,7 @@ public class CacheImporter @Inject constructor( connection.prepareStatement( """ SELECT pg_try_advisory_lock(0) - """.trimIndent() + """.trimIndent() ).use { stmt -> stmt.executeQuery().use { rows -> if (!rows.next()) { @@ -1363,7 +1363,7 @@ public class CacheImporter @Inject constructor( connection.prepareStatement( """ REFRESH MATERIALIZED VIEW CONCURRENTLY index_stats - """.trimIndent() + """.trimIndent() ).use { stmt -> stmt.execute() } @@ -1371,7 +1371,7 @@ public class CacheImporter @Inject constructor( connection.prepareStatement( """ REFRESH MATERIALIZED VIEW CONCURRENTLY master_index_stats - """.trimIndent() + """.trimIndent() ).use { stmt -> stmt.execute() } @@ -1379,7 +1379,7 @@ public class CacheImporter @Inject constructor( connection.prepareStatement( """ REFRESH MATERIALIZED VIEW CONCURRENTLY version_list_stats - """.trimIndent() + """.trimIndent() ).use { stmt -> stmt.execute() } @@ -1387,7 +1387,7 @@ public class CacheImporter @Inject constructor( connection.prepareStatement( """ REFRESH MATERIALIZED VIEW CONCURRENTLY crc_table_stats - """.trimIndent() + """.trimIndent() ).use { stmt -> stmt.execute() } diff --git a/archive/src/main/kotlin/org/openrs2/archive/cache/OsrsJs5ChannelHandler.kt b/archive/src/main/kotlin/org/openrs2/archive/cache/OsrsJs5ChannelHandler.kt index 6e1c082b56..7104bd29a8 100644 --- a/archive/src/main/kotlin/org/openrs2/archive/cache/OsrsJs5ChannelHandler.kt +++ b/archive/src/main/kotlin/org/openrs2/archive/cache/OsrsJs5ChannelHandler.kt @@ -24,7 +24,7 @@ public class OsrsJs5ChannelHandler( build: Int, lastMasterIndexId: Int?, continuation: Continuation, - importer: CacheImporter, + importer: CacheImporter ) : Js5ChannelHandler( bootstrap, scopeId, diff --git a/archive/src/main/kotlin/org/openrs2/archive/game/GameDatabase.kt b/archive/src/main/kotlin/org/openrs2/archive/game/GameDatabase.kt index e733e029fc..ad1b77aa18 100644 --- a/archive/src/main/kotlin/org/openrs2/archive/game/GameDatabase.kt +++ b/archive/src/main/kotlin/org/openrs2/archive/game/GameDatabase.kt @@ -18,7 +18,7 @@ public class GameDatabase @Inject constructor( JOIN environments e ON e.id = v.environment_id JOIN languages l ON l.id = v.language_id WHERE g.name = ? AND e.name = ? AND l.iso_code = ? - """.trimIndent() + """.trimIndent() ).use { stmt -> stmt.setString(1, name) stmt.setString(2, environment) diff --git a/archive/src/main/kotlin/org/openrs2/archive/key/KeyBruteForcer.kt b/archive/src/main/kotlin/org/openrs2/archive/key/KeyBruteForcer.kt index 8578f5b5ae..269e5689cf 100644 --- a/archive/src/main/kotlin/org/openrs2/archive/key/KeyBruteForcer.kt +++ b/archive/src/main/kotlin/org/openrs2/archive/key/KeyBruteForcer.kt @@ -36,7 +36,7 @@ public class KeyBruteForcer @Inject constructor( connection.prepareStatement( """ LOCK TABLE keys IN EXCLUSIVE MODE - """.trimIndent() + """.trimIndent() ).use { stmt -> stmt.execute() } @@ -49,7 +49,7 @@ public class KeyBruteForcer @Inject constructor( first_seen TIMESTAMPTZ NOT NULL, last_seen TIMESTAMPTZ NOT NULL ) ON COMMIT DROP - """.trimIndent() + """.trimIndent() ).use { stmt -> stmt.execute() } @@ -60,7 +60,7 @@ public class KeyBruteForcer @Inject constructor( SELECT key, source, first_seen, last_seen FROM key_queue FOR UPDATE SKIP LOCKED - """.trimIndent() + """.trimIndent() ).use { stmt -> stmt.execute() } @@ -73,7 +73,7 @@ public class KeyBruteForcer @Inject constructor( LEFT JOIN keys k ON k.key = t.key WHERE k.key IS NULL ON CONFLICT DO NOTHING - """.trimIndent() + """.trimIndent() ).use { stmt -> stmt.execute() } @@ -87,7 +87,7 @@ public class KeyBruteForcer @Inject constructor( ON CONFLICT (key_id, source) DO UPDATE SET first_seen = LEAST(s.first_seen, EXCLUDED.first_seen), last_seen = GREATEST(s.last_seen, EXCLUDED.last_seen) - """.trimIndent() + """.trimIndent() ).use { stmt -> stmt.execute() } @@ -97,7 +97,7 @@ public class KeyBruteForcer @Inject constructor( DELETE FROM key_queue k USING tmp_keys t WHERE k.key = t.key AND k.source = t.source - """.trimIndent() + """.trimIndent() ).use { stmt -> stmt.execute() } @@ -152,7 +152,7 @@ public class KeyBruteForcer @Inject constructor( connection.prepareStatement( """ LOCK TABLE containers, keys IN SHARE MODE - """.trimIndent() + """.trimIndent() ).use { stmt -> stmt.execute() } @@ -170,7 +170,7 @@ public class KeyBruteForcer @Inject constructor( SELECT last_container_id FROM brute_force_iterator FOR UPDATE - """.trimIndent() + """.trimIndent() ).use { stmt -> stmt.executeQuery().use { rows -> check(rows.next()) @@ -191,7 +191,7 @@ public class KeyBruteForcer @Inject constructor( """ SELECT id, (key).k0, (key).k1, (key).k2, (key).k3 FROM keys - """.trimIndent() + """.trimIndent() ).use { stmt -> stmt.fetchSize = BATCH_SIZE @@ -224,7 +224,7 @@ public class KeyBruteForcer @Inject constructor( """ UPDATE brute_force_iterator SET last_container_id = ? - """.trimIndent() + """.trimIndent() ).use { stmt -> stmt.setObject(1, lastContainerId, Types.BIGINT) stmt.execute() @@ -239,7 +239,7 @@ public class KeyBruteForcer @Inject constructor( WHERE (? IS NULL OR id > ?) AND encrypted AND key_id IS NULL ORDER BY id ASC LIMIT 1 - """.trimIndent() + """.trimIndent() ).use { stmt -> stmt.setObject(1, lastContainerId, Types.BIGINT) stmt.setObject(2, lastContainerId, Types.BIGINT) @@ -265,7 +265,7 @@ public class KeyBruteForcer @Inject constructor( SELECT last_key_id, last_container_id FROM brute_force_iterator FOR UPDATE - """.trimIndent() + """.trimIndent() ).use { stmt -> stmt.executeQuery().use { rows -> check(rows.next()) @@ -292,7 +292,7 @@ public class KeyBruteForcer @Inject constructor( SELECT id, data FROM containers WHERE encrypted AND key_id IS NULL AND id <= ? - """.trimIndent() + """.trimIndent() ).use { stmt -> stmt.fetchSize = BATCH_SIZE stmt.setLong(1, lastContainerId) @@ -319,7 +319,7 @@ public class KeyBruteForcer @Inject constructor( """ UPDATE brute_force_iterator SET last_key_id = ? - """.trimIndent() + """.trimIndent() ).use { stmt -> stmt.setObject(1, lastKeyId, Types.BIGINT) stmt.execute() @@ -334,7 +334,7 @@ public class KeyBruteForcer @Inject constructor( WHERE ? IS NULL OR id > ? ORDER BY id ASC LIMIT 1 - """.trimIndent() + """.trimIndent() ).use { stmt -> stmt.setObject(1, lastKeyId, Types.BIGINT) stmt.setObject(2, lastKeyId, Types.BIGINT) 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 563dd777dd..2f82ec8923 100644 --- a/archive/src/main/kotlin/org/openrs2/archive/key/KeyExporter.kt +++ b/archive/src/main/kotlin/org/openrs2/archive/key/KeyExporter.kt @@ -51,7 +51,7 @@ public class KeyExporter @Inject constructor( COUNT(*) FILTER (WHERE c.key_id IS NULL AND c.empty_loc) FROM containers c WHERE c.encrypted - """.trimIndent() + """.trimIndent() ).use { stmt -> stmt.executeQuery().use { rows -> check(rows.next()) @@ -69,7 +69,7 @@ public class KeyExporter @Inject constructor( COUNT(DISTINCT k.id) FILTER (WHERE c.key_id IS NOT NULL) FROM keys k LEFT JOIN containers c ON c.key_id = k.id - """.trimIndent() + """.trimIndent() ).use { stmt -> stmt.executeQuery().use { rows -> check(rows.next()) diff --git a/archive/src/main/kotlin/org/openrs2/archive/key/KeyImporter.kt b/archive/src/main/kotlin/org/openrs2/archive/key/KeyImporter.kt index 204eeb75d0..a82a6cb098 100644 --- a/archive/src/main/kotlin/org/openrs2/archive/key/KeyImporter.kt +++ b/archive/src/main/kotlin/org/openrs2/archive/key/KeyImporter.kt @@ -59,7 +59,7 @@ public class KeyImporter @Inject constructor( connection.prepareStatement( """ SELECT url FROM keysets - """.trimIndent() + """.trimIndent() ).use { stmt -> stmt.executeQuery().use { rows -> val urls = mutableSetOf() @@ -94,7 +94,7 @@ public class KeyImporter @Inject constructor( INSERT INTO keysets (url) VALUES (?) ON CONFLICT DO NOTHING - """.trimIndent() + """.trimIndent() ).use { stmt -> for (url in urls) { stmt.setString(1, url) @@ -128,7 +128,7 @@ public class KeyImporter @Inject constructor( ON CONFLICT (key, source) DO UPDATE SET first_seen = LEAST(k.first_seen, EXCLUDED.first_seen), last_seen = GREATEST(k.last_seen, EXCLUDED.last_seen) - """.trimIndent() + """.trimIndent() ).use { stmt -> for (key in keys) { if (key.key.isZero) { diff --git a/archive/src/main/kotlin/org/openrs2/archive/map/MapRenderer.kt b/archive/src/main/kotlin/org/openrs2/archive/map/MapRenderer.kt index 2fefa000d9..165310e927 100644 --- a/archive/src/main/kotlin/org/openrs2/archive/map/MapRenderer.kt +++ b/archive/src/main/kotlin/org/openrs2/archive/map/MapRenderer.kt @@ -38,7 +38,7 @@ public class MapRenderer @Inject constructor( SELECT id FROM scopes WHERE name = ? - """.trimIndent() + """.trimIndent() ).use { stmt -> stmt.setString(1, scope) @@ -175,7 +175,7 @@ public class MapRenderer @Inject constructor( JOIN names n ON n.hash = g.name_hash WHERE g.scope_id = ? AND g.master_index_id = ? AND g.archive_id = ${Js5Archive.MAPS} AND n.name ~ '^[lm](?:[0-9]|[1-9][0-9])_(?:[0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$' - """.trimIndent() + """.trimIndent() ).use { stmt -> stmt.setInt(1, scopeId) stmt.setInt(2, masterIndexId) @@ -228,7 +228,7 @@ public class MapRenderer @Inject constructor( JOIN names n ON n.hash = g.name_hash WHERE g.scope_id = ? AND g.master_index_id = ? AND g.archive_id = ${Js5Archive.MAPS} AND n.name ~ '^m(?:[0-9]|[1-9][0-9])_(?:[0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$' - """.trimIndent() + """.trimIndent() ).use { stmt -> stmt.setInt(1, scopeId) stmt.setInt(2, masterIndexId) @@ -272,7 +272,7 @@ public class MapRenderer @Inject constructor( SELECT data FROM resolved_indexes WHERE scope_id = ? AND master_index_id = ? AND archive_id = ? - """.trimIndent() + """.trimIndent() ).use { stmt -> stmt.setInt(1, scopeId) stmt.setInt(2, masterIndexId) @@ -306,7 +306,7 @@ public class MapRenderer @Inject constructor( SELECT data FROM resolved_groups WHERE scope_id = ? AND master_index_id = ? AND archive_id = ? AND group_id = ? - """.trimIndent() + """.trimIndent() ).use { stmt -> stmt.setInt(1, scopeId) stmt.setInt(2, masterIndexId) diff --git a/archive/src/main/kotlin/org/openrs2/archive/name/NameImporter.kt b/archive/src/main/kotlin/org/openrs2/archive/name/NameImporter.kt index 1e65cba33f..6a48e87893 100644 --- a/archive/src/main/kotlin/org/openrs2/archive/name/NameImporter.kt +++ b/archive/src/main/kotlin/org/openrs2/archive/name/NameImporter.kt @@ -25,7 +25,7 @@ public class NameImporter @Inject constructor( INSERT INTO names (hash, name) VALUES (?, ?) ON CONFLICT DO NOTHING - """.trimIndent() + """.trimIndent() ).use { stmt -> for (name in names) { stmt.setInt(1, name.krHashCode()) diff --git a/archive/src/main/kotlin/org/openrs2/archive/name/RuneStarNameDownloader.kt b/archive/src/main/kotlin/org/openrs2/archive/name/RuneStarNameDownloader.kt index 23b4f36eb8..ceca288162 100644 --- a/archive/src/main/kotlin/org/openrs2/archive/name/RuneStarNameDownloader.kt +++ b/archive/src/main/kotlin/org/openrs2/archive/name/RuneStarNameDownloader.kt @@ -51,11 +51,11 @@ public class RuneStarNameDownloader @Inject constructor( private companion object { private val NAMES_ENDPOINTS = listOf( 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( 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") ) } } diff --git a/archive/src/main/kotlin/org/openrs2/archive/web/CachesController.kt b/archive/src/main/kotlin/org/openrs2/archive/web/CachesController.kt index c2866e3ac9..20f5478b89 100644 --- a/archive/src/main/kotlin/org/openrs2/archive/web/CachesController.kt +++ b/archive/src/main/kotlin/org/openrs2/archive/web/CachesController.kt @@ -58,9 +58,9 @@ public class CachesController @Inject constructor( call.caching = CachingOptions( cacheControl = CacheControl.MaxAge( 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) } @@ -83,7 +83,7 @@ public class CachesController @Inject constructor( ThymeleafContent( "caches/show.html", mapOf( "cache" to cache, - "scope" to scope, + "scope" to scope ) ) ) @@ -113,12 +113,12 @@ public class CachesController @Inject constructor( caching = CachingOptions( cacheControl = CacheControl.MaxAge( 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( - EntityTagVersion(etag, weak = false), + EntityTagVersion(etag, weak = false) ) } } diff --git a/asm/src/main/kotlin/org/openrs2/asm/packclass/PackClass.kt b/asm/src/main/kotlin/org/openrs2/asm/packclass/PackClass.kt index 81bafc6a78..756158a3db 100644 --- a/asm/src/main/kotlin/org/openrs2/asm/packclass/PackClass.kt +++ b/asm/src/main/kotlin/org/openrs2/asm/packclass/PackClass.kt @@ -42,7 +42,7 @@ public object PackClass { Opcodes.V1_3, Opcodes.V1_4, Opcodes.V1_5, - Opcodes.V1_6, + Opcodes.V1_6 ) private const val INT_DESCRIPTOR = "I" diff --git a/buffer/src/main/kotlin/org/openrs2/buffer/GeneratedByteBufExtensions.kt b/buffer/src/main/kotlin/org/openrs2/buffer/GeneratedByteBufExtensions.kt index 4f26864035..09682d17e7 100644 --- a/buffer/src/main/kotlin/org/openrs2/buffer/GeneratedByteBufExtensions.kt +++ b/buffer/src/main/kotlin/org/openrs2/buffer/GeneratedByteBufExtensions.kt @@ -446,7 +446,7 @@ public fun ByteBuf.getBytesA( index: Int, dst: ByteArray, dstIndex: Int, - len: Int, + len: Int ): ByteBuf { getBytes(index, dst, dstIndex, len) for (i in 0 until len) { @@ -467,7 +467,7 @@ public fun ByteBuf.getBytesA(index: Int, dst: ByteBuf): ByteBuf { public fun ByteBuf.getBytesA( index: Int, dst: ByteBuf, - len: Int, + len: Int ): ByteBuf { val dstIndex = dst.writerIndex() dst.ensureWritable(len) @@ -480,7 +480,7 @@ public fun ByteBuf.getBytesA( index: Int, dst: ByteBuf, dstIndex: Int, - len: Int, + len: Int ): ByteBuf { for (i in 0 until len) { dst.setByte(dstIndex + i, getByteA(index + i).toInt()) @@ -496,7 +496,7 @@ public fun ByteBuf.readBytesA(dst: ByteArray): ByteBuf { public fun ByteBuf.readBytesA( dst: ByteArray, dstIndex: Int, - len: Int, + len: Int ): ByteBuf { val index = readerIndex() getBytesA(index, dst, dstIndex, len) @@ -524,7 +524,7 @@ public fun ByteBuf.readBytesA(dst: ByteBuf, len: Int): ByteBuf { public fun ByteBuf.readBytesA( dst: ByteBuf, dstIndex: Int, - len: Int, + len: Int ): ByteBuf { val index = readerIndex() getBytesA(index, dst, dstIndex, len) @@ -551,7 +551,7 @@ public fun ByteBuf.setBytesA( index: Int, src: ByteArray, srcIndex: Int, - len: Int, + len: Int ): ByteBuf { Unpooled.wrappedBuffer(src).use { buf -> setBytesA(index, buf, srcIndex, len) @@ -570,7 +570,7 @@ public fun ByteBuf.setBytesA(index: Int, src: ByteBuf): ByteBuf { public fun ByteBuf.setBytesA( index: Int, src: ByteBuf, - len: Int, + len: Int ): ByteBuf { val srcIndex = src.readerIndex() setBytesA(index, src, srcIndex, len) @@ -582,7 +582,7 @@ public fun ByteBuf.setBytesA( index: Int, src: ByteBuf, srcIndex: Int, - len: Int, + len: Int ): ByteBuf { for (i in 0 until len) { setByteA(index + i, src.getByte(srcIndex + i).toInt()) @@ -598,7 +598,7 @@ public fun ByteBuf.writeBytesA(src: ByteArray): ByteBuf { public fun ByteBuf.writeBytesA( src: ByteArray, srcIndex: Int, - len: Int, + len: Int ): ByteBuf { val index = writerIndex() ensureWritable(len) @@ -625,7 +625,7 @@ public fun ByteBuf.writeBytesA(src: ByteBuf, len: Int): ByteBuf { public fun ByteBuf.writeBytesA( src: ByteBuf, srcIndex: Int, - len: Int, + len: Int ): ByteBuf { val index = writerIndex() ensureWritable(len) @@ -643,7 +643,7 @@ public fun ByteBuf.getBytesC( index: Int, dst: ByteArray, dstIndex: Int, - len: Int, + len: Int ): ByteBuf { getBytes(index, dst, dstIndex, len) for (i in 0 until len) { @@ -664,7 +664,7 @@ public fun ByteBuf.getBytesC(index: Int, dst: ByteBuf): ByteBuf { public fun ByteBuf.getBytesC( index: Int, dst: ByteBuf, - len: Int, + len: Int ): ByteBuf { val dstIndex = dst.writerIndex() dst.ensureWritable(len) @@ -677,7 +677,7 @@ public fun ByteBuf.getBytesC( index: Int, dst: ByteBuf, dstIndex: Int, - len: Int, + len: Int ): ByteBuf { for (i in 0 until len) { dst.setByte(dstIndex + i, getByteC(index + i).toInt()) @@ -693,7 +693,7 @@ public fun ByteBuf.readBytesC(dst: ByteArray): ByteBuf { public fun ByteBuf.readBytesC( dst: ByteArray, dstIndex: Int, - len: Int, + len: Int ): ByteBuf { val index = readerIndex() getBytesC(index, dst, dstIndex, len) @@ -721,7 +721,7 @@ public fun ByteBuf.readBytesC(dst: ByteBuf, len: Int): ByteBuf { public fun ByteBuf.readBytesC( dst: ByteBuf, dstIndex: Int, - len: Int, + len: Int ): ByteBuf { val index = readerIndex() getBytesC(index, dst, dstIndex, len) @@ -748,7 +748,7 @@ public fun ByteBuf.setBytesC( index: Int, src: ByteArray, srcIndex: Int, - len: Int, + len: Int ): ByteBuf { Unpooled.wrappedBuffer(src).use { buf -> setBytesC(index, buf, srcIndex, len) @@ -767,7 +767,7 @@ public fun ByteBuf.setBytesC(index: Int, src: ByteBuf): ByteBuf { public fun ByteBuf.setBytesC( index: Int, src: ByteBuf, - len: Int, + len: Int ): ByteBuf { val srcIndex = src.readerIndex() setBytesC(index, src, srcIndex, len) @@ -779,7 +779,7 @@ public fun ByteBuf.setBytesC( index: Int, src: ByteBuf, srcIndex: Int, - len: Int, + len: Int ): ByteBuf { for (i in 0 until len) { setByteC(index + i, src.getByte(srcIndex + i).toInt()) @@ -795,7 +795,7 @@ public fun ByteBuf.writeBytesC(src: ByteArray): ByteBuf { public fun ByteBuf.writeBytesC( src: ByteArray, srcIndex: Int, - len: Int, + len: Int ): ByteBuf { val index = writerIndex() ensureWritable(len) @@ -822,7 +822,7 @@ public fun ByteBuf.writeBytesC(src: ByteBuf, len: Int): ByteBuf { public fun ByteBuf.writeBytesC( src: ByteBuf, srcIndex: Int, - len: Int, + len: Int ): ByteBuf { val index = writerIndex() ensureWritable(len) @@ -840,7 +840,7 @@ public fun ByteBuf.getBytesS( index: Int, dst: ByteArray, dstIndex: Int, - len: Int, + len: Int ): ByteBuf { getBytes(index, dst, dstIndex, len) for (i in 0 until len) { @@ -861,7 +861,7 @@ public fun ByteBuf.getBytesS(index: Int, dst: ByteBuf): ByteBuf { public fun ByteBuf.getBytesS( index: Int, dst: ByteBuf, - len: Int, + len: Int ): ByteBuf { val dstIndex = dst.writerIndex() dst.ensureWritable(len) @@ -874,7 +874,7 @@ public fun ByteBuf.getBytesS( index: Int, dst: ByteBuf, dstIndex: Int, - len: Int, + len: Int ): ByteBuf { for (i in 0 until len) { dst.setByte(dstIndex + i, getByteS(index + i).toInt()) @@ -890,7 +890,7 @@ public fun ByteBuf.readBytesS(dst: ByteArray): ByteBuf { public fun ByteBuf.readBytesS( dst: ByteArray, dstIndex: Int, - len: Int, + len: Int ): ByteBuf { val index = readerIndex() getBytesS(index, dst, dstIndex, len) @@ -918,7 +918,7 @@ public fun ByteBuf.readBytesS(dst: ByteBuf, len: Int): ByteBuf { public fun ByteBuf.readBytesS( dst: ByteBuf, dstIndex: Int, - len: Int, + len: Int ): ByteBuf { val index = readerIndex() getBytesS(index, dst, dstIndex, len) @@ -945,7 +945,7 @@ public fun ByteBuf.setBytesS( index: Int, src: ByteArray, srcIndex: Int, - len: Int, + len: Int ): ByteBuf { Unpooled.wrappedBuffer(src).use { buf -> setBytesS(index, buf, srcIndex, len) @@ -964,7 +964,7 @@ public fun ByteBuf.setBytesS(index: Int, src: ByteBuf): ByteBuf { public fun ByteBuf.setBytesS( index: Int, src: ByteBuf, - len: Int, + len: Int ): ByteBuf { val srcIndex = src.readerIndex() setBytesS(index, src, srcIndex, len) @@ -976,7 +976,7 @@ public fun ByteBuf.setBytesS( index: Int, src: ByteBuf, srcIndex: Int, - len: Int, + len: Int ): ByteBuf { for (i in 0 until len) { setByteS(index + i, src.getByte(srcIndex + i).toInt()) @@ -992,7 +992,7 @@ public fun ByteBuf.writeBytesS(src: ByteArray): ByteBuf { public fun ByteBuf.writeBytesS( src: ByteArray, srcIndex: Int, - len: Int, + len: Int ): ByteBuf { val index = writerIndex() ensureWritable(len) @@ -1019,7 +1019,7 @@ public fun ByteBuf.writeBytesS(src: ByteBuf, len: Int): ByteBuf { public fun ByteBuf.writeBytesS( src: ByteBuf, srcIndex: Int, - len: Int, + len: Int ): ByteBuf { val index = writerIndex() ensureWritable(len) @@ -1037,7 +1037,7 @@ public fun ByteBuf.getBytesReverse( index: Int, dst: ByteArray, dstIndex: Int, - len: Int, + len: Int ): ByteBuf { getBytes(index, dst, dstIndex, len) for (i in 0 until len) { @@ -1059,7 +1059,7 @@ public fun ByteBuf.getBytesReverse(index: Int, dst: ByteBuf): ByteBuf { public fun ByteBuf.getBytesReverse( index: Int, dst: ByteBuf, - len: Int, + len: Int ): ByteBuf { val dstIndex = dst.writerIndex() dst.ensureWritable(len) @@ -1072,7 +1072,7 @@ public fun ByteBuf.getBytesReverse( index: Int, dst: ByteBuf, dstIndex: Int, - len: Int, + len: Int ): ByteBuf { for (i in 0 until len) { 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( dst: ByteArray, dstIndex: Int, - len: Int, + len: Int ): ByteBuf { val index = readerIndex() getBytesReverse(index, dst, dstIndex, len) @@ -1116,7 +1116,7 @@ public fun ByteBuf.readBytesReverse(dst: ByteBuf, len: Int): ByteBuf { public fun ByteBuf.readBytesReverse( dst: ByteBuf, dstIndex: Int, - len: Int, + len: Int ): ByteBuf { val index = readerIndex() getBytesReverse(index, dst, dstIndex, len) @@ -1143,7 +1143,7 @@ public fun ByteBuf.setBytesReverse( index: Int, src: ByteArray, srcIndex: Int, - len: Int, + len: Int ): ByteBuf { Unpooled.wrappedBuffer(src).use { buf -> setBytesReverse(index, buf, srcIndex, len) @@ -1162,7 +1162,7 @@ public fun ByteBuf.setBytesReverse(index: Int, src: ByteBuf): ByteBuf { public fun ByteBuf.setBytesReverse( index: Int, src: ByteBuf, - len: Int, + len: Int ): ByteBuf { val srcIndex = src.readerIndex() setBytesReverse(index, src, srcIndex, len) @@ -1174,7 +1174,7 @@ public fun ByteBuf.setBytesReverse( index: Int, src: ByteBuf, srcIndex: Int, - len: Int, + len: Int ): ByteBuf { for (i in 0 until len) { 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( src: ByteArray, srcIndex: Int, - len: Int, + len: Int ): ByteBuf { val index = writerIndex() ensureWritable(len) @@ -1217,7 +1217,7 @@ public fun ByteBuf.writeBytesReverse(src: ByteBuf, len: Int): ByteBuf { public fun ByteBuf.writeBytesReverse( src: ByteBuf, srcIndex: Int, - len: Int, + len: Int ): ByteBuf { val index = writerIndex() ensureWritable(len) @@ -1235,7 +1235,7 @@ public fun ByteBuf.getBytesReverseA( index: Int, dst: ByteArray, dstIndex: Int, - len: Int, + len: Int ): ByteBuf { getBytes(index, dst, dstIndex, len) for (i in 0 until len) { @@ -1257,7 +1257,7 @@ public fun ByteBuf.getBytesReverseA(index: Int, dst: ByteBuf): ByteBuf { public fun ByteBuf.getBytesReverseA( index: Int, dst: ByteBuf, - len: Int, + len: Int ): ByteBuf { val dstIndex = dst.writerIndex() dst.ensureWritable(len) @@ -1270,7 +1270,7 @@ public fun ByteBuf.getBytesReverseA( index: Int, dst: ByteBuf, dstIndex: Int, - len: Int, + len: Int ): ByteBuf { for (i in 0 until len) { 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( dst: ByteArray, dstIndex: Int, - len: Int, + len: Int ): ByteBuf { val index = readerIndex() getBytesReverseA(index, dst, dstIndex, len) @@ -1314,7 +1314,7 @@ public fun ByteBuf.readBytesReverseA(dst: ByteBuf, len: Int): ByteBuf { public fun ByteBuf.readBytesReverseA( dst: ByteBuf, dstIndex: Int, - len: Int, + len: Int ): ByteBuf { val index = readerIndex() getBytesReverseA(index, dst, dstIndex, len) @@ -1341,7 +1341,7 @@ public fun ByteBuf.setBytesReverseA( index: Int, src: ByteArray, srcIndex: Int, - len: Int, + len: Int ): ByteBuf { Unpooled.wrappedBuffer(src).use { buf -> setBytesReverseA(index, buf, srcIndex, len) @@ -1360,7 +1360,7 @@ public fun ByteBuf.setBytesReverseA(index: Int, src: ByteBuf): ByteBuf { public fun ByteBuf.setBytesReverseA( index: Int, src: ByteBuf, - len: Int, + len: Int ): ByteBuf { val srcIndex = src.readerIndex() setBytesReverseA(index, src, srcIndex, len) @@ -1372,7 +1372,7 @@ public fun ByteBuf.setBytesReverseA( index: Int, src: ByteBuf, srcIndex: Int, - len: Int, + len: Int ): ByteBuf { for (i in 0 until len) { 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( src: ByteArray, srcIndex: Int, - len: Int, + len: Int ): ByteBuf { val index = writerIndex() ensureWritable(len) @@ -1415,7 +1415,7 @@ public fun ByteBuf.writeBytesReverseA(src: ByteBuf, len: Int): ByteBuf { public fun ByteBuf.writeBytesReverseA( src: ByteBuf, srcIndex: Int, - len: Int, + len: Int ): ByteBuf { val index = writerIndex() ensureWritable(len) @@ -1433,7 +1433,7 @@ public fun ByteBuf.getBytesReverseC( index: Int, dst: ByteArray, dstIndex: Int, - len: Int, + len: Int ): ByteBuf { getBytes(index, dst, dstIndex, len) for (i in 0 until len) { @@ -1455,7 +1455,7 @@ public fun ByteBuf.getBytesReverseC(index: Int, dst: ByteBuf): ByteBuf { public fun ByteBuf.getBytesReverseC( index: Int, dst: ByteBuf, - len: Int, + len: Int ): ByteBuf { val dstIndex = dst.writerIndex() dst.ensureWritable(len) @@ -1468,7 +1468,7 @@ public fun ByteBuf.getBytesReverseC( index: Int, dst: ByteBuf, dstIndex: Int, - len: Int, + len: Int ): ByteBuf { for (i in 0 until len) { 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( dst: ByteArray, dstIndex: Int, - len: Int, + len: Int ): ByteBuf { val index = readerIndex() getBytesReverseC(index, dst, dstIndex, len) @@ -1512,7 +1512,7 @@ public fun ByteBuf.readBytesReverseC(dst: ByteBuf, len: Int): ByteBuf { public fun ByteBuf.readBytesReverseC( dst: ByteBuf, dstIndex: Int, - len: Int, + len: Int ): ByteBuf { val index = readerIndex() getBytesReverseC(index, dst, dstIndex, len) @@ -1539,7 +1539,7 @@ public fun ByteBuf.setBytesReverseC( index: Int, src: ByteArray, srcIndex: Int, - len: Int, + len: Int ): ByteBuf { Unpooled.wrappedBuffer(src).use { buf -> setBytesReverseC(index, buf, srcIndex, len) @@ -1558,7 +1558,7 @@ public fun ByteBuf.setBytesReverseC(index: Int, src: ByteBuf): ByteBuf { public fun ByteBuf.setBytesReverseC( index: Int, src: ByteBuf, - len: Int, + len: Int ): ByteBuf { val srcIndex = src.readerIndex() setBytesReverseC(index, src, srcIndex, len) @@ -1570,7 +1570,7 @@ public fun ByteBuf.setBytesReverseC( index: Int, src: ByteBuf, srcIndex: Int, - len: Int, + len: Int ): ByteBuf { for (i in 0 until len) { 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( src: ByteArray, srcIndex: Int, - len: Int, + len: Int ): ByteBuf { val index = writerIndex() ensureWritable(len) @@ -1613,7 +1613,7 @@ public fun ByteBuf.writeBytesReverseC(src: ByteBuf, len: Int): ByteBuf { public fun ByteBuf.writeBytesReverseC( src: ByteBuf, srcIndex: Int, - len: Int, + len: Int ): ByteBuf { val index = writerIndex() ensureWritable(len) @@ -1631,7 +1631,7 @@ public fun ByteBuf.getBytesReverseS( index: Int, dst: ByteArray, dstIndex: Int, - len: Int, + len: Int ): ByteBuf { getBytes(index, dst, dstIndex, len) for (i in 0 until len) { @@ -1653,7 +1653,7 @@ public fun ByteBuf.getBytesReverseS(index: Int, dst: ByteBuf): ByteBuf { public fun ByteBuf.getBytesReverseS( index: Int, dst: ByteBuf, - len: Int, + len: Int ): ByteBuf { val dstIndex = dst.writerIndex() dst.ensureWritable(len) @@ -1666,7 +1666,7 @@ public fun ByteBuf.getBytesReverseS( index: Int, dst: ByteBuf, dstIndex: Int, - len: Int, + len: Int ): ByteBuf { for (i in 0 until len) { 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( dst: ByteArray, dstIndex: Int, - len: Int, + len: Int ): ByteBuf { val index = readerIndex() getBytesReverseS(index, dst, dstIndex, len) @@ -1710,7 +1710,7 @@ public fun ByteBuf.readBytesReverseS(dst: ByteBuf, len: Int): ByteBuf { public fun ByteBuf.readBytesReverseS( dst: ByteBuf, dstIndex: Int, - len: Int, + len: Int ): ByteBuf { val index = readerIndex() getBytesReverseS(index, dst, dstIndex, len) @@ -1737,7 +1737,7 @@ public fun ByteBuf.setBytesReverseS( index: Int, src: ByteArray, srcIndex: Int, - len: Int, + len: Int ): ByteBuf { Unpooled.wrappedBuffer(src).use { buf -> setBytesReverseS(index, buf, srcIndex, len) @@ -1756,7 +1756,7 @@ public fun ByteBuf.setBytesReverseS(index: Int, src: ByteBuf): ByteBuf { public fun ByteBuf.setBytesReverseS( index: Int, src: ByteBuf, - len: Int, + len: Int ): ByteBuf { val srcIndex = src.readerIndex() setBytesReverseS(index, src, srcIndex, len) @@ -1768,7 +1768,7 @@ public fun ByteBuf.setBytesReverseS( index: Int, src: ByteBuf, srcIndex: Int, - len: Int, + len: Int ): ByteBuf { for (i in 0 until len) { 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( src: ByteArray, srcIndex: Int, - len: Int, + len: Int ): ByteBuf { val index = writerIndex() ensureWritable(len) @@ -1811,7 +1811,7 @@ public fun ByteBuf.writeBytesReverseS(src: ByteBuf, len: Int): ByteBuf { public fun ByteBuf.writeBytesReverseS( src: ByteBuf, srcIndex: Int, - len: Int, + len: Int ): ByteBuf { val index = writerIndex() ensureWritable(len) diff --git a/build.gradle.kts b/build.gradle.kts index 40cd4d6357..5867340514 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -53,7 +53,7 @@ allprojects { plugins.withType { configure { // see https://github.com/pinterest/ktlint/issues/764 - disabledRules = arrayOf("indent", "parameter-list-wrapping") + disabledRules = arrayOf("argument-list-wrapping", "parameter-list-wrapping", "wrapping") } } diff --git a/cache-550/src/main/kotlin/org/openrs2/cache/sprite/Sprite.kt b/cache-550/src/main/kotlin/org/openrs2/cache/sprite/Sprite.kt index 3dc0b55449..8737f6e840 100644 --- a/cache-550/src/main/kotlin/org/openrs2/cache/sprite/Sprite.kt +++ b/cache-550/src/main/kotlin/org/openrs2/cache/sprite/Sprite.kt @@ -14,7 +14,7 @@ public class Sprite private constructor( val xOffset: Int, val yOffset: Int, val innerWidth: Int, - val innerHeight: Int, + val innerHeight: Int ) { val pixels = ByteArray(innerWidth * innerHeight) var alpha: ByteArray? = null diff --git a/cache/src/main/kotlin/org/openrs2/cache/Js5Index.kt b/cache/src/main/kotlin/org/openrs2/cache/Js5Index.kt index 3f4d621741..742e99c300 100644 --- a/cache/src/main/kotlin/org/openrs2/cache/Js5Index.kt +++ b/cache/src/main/kotlin/org/openrs2/cache/Js5Index.kt @@ -102,7 +102,7 @@ public class Js5Index( public class MutableFile internal constructor( parent: MutableNamedEntryCollection, - override val id: Int, + override val id: Int ) : MutableNamedEntry, File { private var parent: MutableNamedEntryCollection? = parent diff --git a/cache/src/main/kotlin/org/openrs2/cache/Js5Pack.kt b/cache/src/main/kotlin/org/openrs2/cache/Js5Pack.kt index 2015a003de..640a70480d 100644 --- a/cache/src/main/kotlin/org/openrs2/cache/Js5Pack.kt +++ b/cache/src/main/kotlin/org/openrs2/cache/Js5Pack.kt @@ -23,7 +23,7 @@ public class Js5Pack private constructor( index: Js5Index, unpackedCacheSize: Int, private var packedIndex: ByteBuf, - private val packed: Int2ObjectSortedMap, + private val packed: Int2ObjectSortedMap ) : Archive(alloc, index, 0, UnpackedCache(unpackedCacheSize)), Closeable { override fun packedExists(group: Int): Boolean { return packed.containsKey(group) diff --git a/cache/src/main/kotlin/org/openrs2/cache/OpenNxtStore.kt b/cache/src/main/kotlin/org/openrs2/cache/OpenNxtStore.kt index ccf7955165..154de72663 100644 --- a/cache/src/main/kotlin/org/openrs2/cache/OpenNxtStore.kt +++ b/cache/src/main/kotlin/org/openrs2/cache/OpenNxtStore.kt @@ -33,7 +33,7 @@ public object OpenNxtStore { SELECT data, crc FROM cache_index WHERE key = 1 - """.trimIndent() + """.trimIndent() ).use { stmt -> stmt.executeQuery().use { rows -> if (rows.next()) { @@ -57,7 +57,7 @@ public object OpenNxtStore { """ SELECT key, data, crc, version FROM cache - """.trimIndent() + """.trimIndent() ).use { stmt -> stmt.executeQuery().use { rows -> while (rows.next()) { diff --git a/cache/src/main/kotlin/org/openrs2/cache/VersionList.kt b/cache/src/main/kotlin/org/openrs2/cache/VersionList.kt index 773b65d83e..821897b5f0 100644 --- a/cache/src/main/kotlin/org/openrs2/cache/VersionList.kt +++ b/cache/src/main/kotlin/org/openrs2/cache/VersionList.kt @@ -4,7 +4,7 @@ import org.openrs2.buffer.use public class VersionList( public val files: List>, - public val maps: Map, + public val maps: Map ) { public data class File( val version: Int, diff --git a/cache/src/test/kotlin/org/openrs2/cache/Js5MasterIndexTest.kt b/cache/src/test/kotlin/org/openrs2/cache/Js5MasterIndexTest.kt index 08a1c8c10e..81b892782a 100644 --- a/cache/src/test/kotlin/org/openrs2/cache/Js5MasterIndexTest.kt +++ b/cache/src/test/kotlin/org/openrs2/cache/Js5MasterIndexTest.kt @@ -28,7 +28,7 @@ class Js5MasterIndexTest { "0e1a2b93c80a41c7ad2a985dff707a6a8ff82e229cbc468f04191198920955a1" + "4b3d7eab77a17faf99208dee5b44afb789962ad79f230b3b59106a0af892219c" ) - ), + ) ) ), index ) diff --git a/compress/src/main/kotlin/org/openrs2/compress/bzip2/LibBzip2.kt b/compress/src/main/kotlin/org/openrs2/compress/bzip2/LibBzip2.kt index 2a137703c7..e2753ad2ff 100644 --- a/compress/src/main/kotlin/org/openrs2/compress/bzip2/LibBzip2.kt +++ b/compress/src/main/kotlin/org/openrs2/compress/bzip2/LibBzip2.kt @@ -56,7 +56,7 @@ public interface LibBzip2 { public fun load(): LibBzip2 { return LibraryLoader.loadLibrary( LibBzip2::class.java, mapOf( - LibraryOption.LoadNow to true, + LibraryOption.LoadNow to true ), "bz2" ) } diff --git a/conf/src/main/kotlin/org/openrs2/conf/CountryCode.kt b/conf/src/main/kotlin/org/openrs2/conf/CountryCode.kt index c166d09ec7..160ba1b6cd 100644 --- a/conf/src/main/kotlin/org/openrs2/conf/CountryCode.kt +++ b/conf/src/main/kotlin/org/openrs2/conf/CountryCode.kt @@ -245,5 +245,5 @@ public enum class CountryCode { EH, // Western Sahara YE, // Yemen ZM, // Zambia - ZW, // Zimbabwe + ZW // Zimbabwe } diff --git a/game/src/main/kotlin/org/openrs2/game/net/http/Http.kt b/game/src/main/kotlin/org/openrs2/game/net/http/Http.kt index b4fb664968..a96fb3753c 100644 --- a/game/src/main/kotlin/org/openrs2/game/net/http/Http.kt +++ b/game/src/main/kotlin/org/openrs2/game/net/http/Http.kt @@ -109,7 +109,7 @@ public object Http {
$BANNER
- """.trimIndent().plus("\n"), Charsets.UTF_8 + """.trimIndent().plus("\n"), Charsets.UTF_8 ).use { buf -> writeResponse(ctx, request, status, buf, HttpHeaderValues.TEXT_HTML, buf.readableBytes().toLong()) } diff --git a/game/src/main/kotlin/org/openrs2/game/net/login/LoginChannelHandler.kt b/game/src/main/kotlin/org/openrs2/game/net/login/LoginChannelHandler.kt index 97f481c0cd..9355809194 100644 --- a/game/src/main/kotlin/org/openrs2/game/net/login/LoginChannelHandler.kt +++ b/game/src/main/kotlin/org/openrs2/game/net/login/LoginChannelHandler.kt @@ -209,7 +209,7 @@ public class LoginChannelHandler @Inject constructor( msg.affiliate, dateOfBirth, country, - msg.email, + msg.email ).bind() }.getErrorOr(CreateResponse.Ok) diff --git a/game/src/main/kotlin/org/openrs2/game/store/PlayerStore.kt b/game/src/main/kotlin/org/openrs2/game/store/PlayerStore.kt index 8c0d64798b..1cd3b610e4 100644 --- a/game/src/main/kotlin/org/openrs2/game/store/PlayerStore.kt +++ b/game/src/main/kotlin/org/openrs2/game/store/PlayerStore.kt @@ -16,6 +16,6 @@ public interface PlayerStore { affiliate: Int, dateOfBirth: LocalDate, country: CountryCode, - email: String, + email: String ): Result } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 297c2aa23e..3a9151e366 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -15,7 +15,7 @@ nettyIoUring = "0.0.15.Final" [plugins] dependencyLicenseReport = { id = "com.github.jk1.dependency-license-report", version = "2.1" } 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" } versions = { id = "com.github.ben-manes.versions", version = "0.42.0" } diff --git a/patcher/src/main/kotlin/org/openrs2/patcher/transform/HighDpiTransformer.kt b/patcher/src/main/kotlin/org/openrs2/patcher/transform/HighDpiTransformer.kt index 4bd9b364e3..6763dfddfb 100644 --- a/patcher/src/main/kotlin/org/openrs2/patcher/transform/HighDpiTransformer.kt +++ b/patcher/src/main/kotlin/org/openrs2/patcher/transform/HighDpiTransformer.kt @@ -358,7 +358,7 @@ public class HighDpiTransformer : Transformer() { private val DRAW_PIXELS_MATCHER = InsnMatcher.compile( """ ALOAD ILOAD ILOAD LDC GETSTATIC IFEQ LDC GOTO SIPUSH ALOAD INVOKESTATIC INVOKEINTERFACE - """.trimIndent() + """.trimIndent() ) private val GET_GL_MATCHER = InsnMatcher.compile("GETSTATIC INVOKEVIRTUAL PUTSTATIC") private val SET_CANVAS_VISIBLE_MATCHER = InsnMatcher.compile("GETSTATIC ICONST_1 INVOKEVIRTUAL") diff --git a/patcher/src/main/kotlin/org/openrs2/patcher/transform/InvalidKeyTransformer.kt b/patcher/src/main/kotlin/org/openrs2/patcher/transform/InvalidKeyTransformer.kt index 37dd508098..efddb9da52 100644 --- a/patcher/src/main/kotlin/org/openrs2/patcher/transform/InvalidKeyTransformer.kt +++ b/patcher/src/main/kotlin/org/openrs2/patcher/transform/InvalidKeyTransformer.kt @@ -96,7 +96,7 @@ public class InvalidKeyTransformer : Transformer() { private val MATCHER = InsnMatcher.compile( """ ALOAD INVOKESTATIC ASTORE GOTO ASTORE ALOAD NEW DUP INVOKESPECIAL? LDC .*? INVOKESTATIC ATHROW - """.trimIndent() + """.trimIndent() ) } } diff --git a/util/src/main/kotlin/org/openrs2/util/io/PathExtensions.kt b/util/src/main/kotlin/org/openrs2/util/io/PathExtensions.kt index b157583d3c..abfba5f6ff 100644 --- a/util/src/main/kotlin/org/openrs2/util/io/PathExtensions.kt +++ b/util/src/main/kotlin/org/openrs2/util/io/PathExtensions.kt @@ -109,7 +109,7 @@ public inline fun Path.useTempFile( public inline fun Path.atomicWrite( sync: Boolean = true, - f: (Path) -> T, + f: (Path) -> T ): T { parent.useTempFile(".$fileName", ".tmp") { tempFile -> val result = f(tempFile) @@ -134,7 +134,7 @@ public inline fun Path.atomicWrite( public inline fun Path.useAtomicBufferedWriter( vararg options: OpenOption, sync: Boolean = true, - f: (BufferedWriter) -> T, + f: (BufferedWriter) -> T ): T { return atomicWrite(sync) { path -> Files.newBufferedWriter(path, *options).use { writer -> @@ -147,7 +147,7 @@ public inline fun Path.useAtomicBufferedWriter( cs: Charset, vararg options: OpenOption, sync: Boolean = true, - f: (BufferedWriter) -> T, + f: (BufferedWriter) -> T ): T { return atomicWrite(sync) { path -> Files.newBufferedWriter(path, cs, *options).use { writer -> @@ -159,7 +159,7 @@ public inline fun Path.useAtomicBufferedWriter( public inline fun Path.useAtomicOutputStream( vararg options: OpenOption, sync: Boolean = true, - f: (OutputStream) -> T, + f: (OutputStream) -> T ): T { return atomicWrite(sync) { path -> Files.newOutputStream(path, *options).use { output ->