From 250062a72fab505552ed08bb24ee4ec678f769b6 Mon Sep 17 00:00:00 2001 From: Graham Date: Sat, 11 Jan 2020 15:45:36 +0000 Subject: [PATCH] Set buffer size to 65,536 bytes Although this is one byte larger than it needs to be to hold the largest possible packet, I think using a power of two is nicer. --- .../dev/openrs2/bundler/transform/BufferSizeTransformer.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bundler/src/main/java/dev/openrs2/bundler/transform/BufferSizeTransformer.kt b/bundler/src/main/java/dev/openrs2/bundler/transform/BufferSizeTransformer.kt index 33fb14a59f..ce19299deb 100644 --- a/bundler/src/main/java/dev/openrs2/bundler/transform/BufferSizeTransformer.kt +++ b/bundler/src/main/java/dev/openrs2/bundler/transform/BufferSizeTransformer.kt @@ -45,7 +45,7 @@ class BufferSizeTransformer : Transformer() { NEW_BUFFER_MATCHER.match(method).forEach { val putstatic = it[4] as FieldInsnNode if (MemberRef(putstatic) == buffer!!) { - method.instructions[it[2]] = createIntConstant(65535) + method.instructions[it[2]] = createIntConstant(65536) buffersResized++ } } @@ -54,7 +54,7 @@ class BufferSizeTransformer : Transformer() { } override fun postTransform(classPath: ClassPath) { - logger.info { "Resized $buffersResized buffers to 65535 bytes" } + logger.info { "Resized $buffersResized buffers to 65536 bytes" } } companion object {