From e3c66c7f3ee521c1f958ecd1476b92c781f456e2 Mon Sep 17 00:00:00 2001 From: Woah Date: Wed, 24 Mar 2021 03:01:59 -0400 Subject: [PATCH] Minor fixes to the dev console --- .../java/org/runite/client/KeyboardListener.java | 8 ++++---- .../src/main/java/org/runite/client/Unsorted.java | 1 - .../org/rs09/client/console/DeveloperConsole.kt | 14 ++++++++------ 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/Client/src/main/java/org/runite/client/KeyboardListener.java b/Client/src/main/java/org/runite/client/KeyboardListener.java index 89e2e070e..e62c54b09 100644 --- a/Client/src/main/java/org/runite/client/KeyboardListener.java +++ b/Client/src/main/java/org/runite/client/KeyboardListener.java @@ -73,10 +73,10 @@ final class KeyboardListener implements KeyListener, FocusListener { DeveloperConsole.INSTANCE.toggle(); return; } -// if (DeveloperConsole.INSTANCE.getOpen()) { -// DeveloperConsole.INSTANCE.handleKeyDown(var1); -// return; -// } + if (DeveloperConsole.INSTANCE.getOpen()) { + DeveloperConsole.INSTANCE.handleKeyDown(var1); + return; + } if(null != Class3_Sub13_Sub3.aClass148_3049) { Class3_Sub13_Sub33.anInt3398 = 0; diff --git a/Client/src/main/java/org/runite/client/Unsorted.java b/Client/src/main/java/org/runite/client/Unsorted.java index 5ad017160..7021e702c 100644 --- a/Client/src/main/java/org/runite/client/Unsorted.java +++ b/Client/src/main/java/org/runite/client/Unsorted.java @@ -4111,7 +4111,6 @@ public class Unsorted { if (var11.anInt189 == 1405) { if (DeveloperConsole.INSTANCE.getOpen()) { gameWindowWidth = var11.width + var13; - //Toolkit.getActiveToolkit().fillRect(0, 0, var11.width + var13, 300, 0x332277, 128); } if (ClientCommands.fpsOverlayEnabled) { diff --git a/Client/src/main/kotlin/org/rs09/client/console/DeveloperConsole.kt b/Client/src/main/kotlin/org/rs09/client/console/DeveloperConsole.kt index 9d411094d..1b37fecfe 100644 --- a/Client/src/main/kotlin/org/rs09/client/console/DeveloperConsole.kt +++ b/Client/src/main/kotlin/org/rs09/client/console/DeveloperConsole.kt @@ -192,12 +192,13 @@ object DeveloperConsole { Class3_Sub13_Sub1.outgoingBuffer.finishVarshortPacket(Class3_Sub13_Sub1.outgoingBuffer.index - index) } + println(str) val clientCommand: MutableList val args: Any val command: String = str clientCommand = command.split(' ') as MutableList val argSize = clientCommand.size - println(str) + when (clientCommand[0]) { "enableconsolepackets" -> { ENABLE_PACKETS = true @@ -340,7 +341,8 @@ object DeveloperConsole { } else -> { - + System.out.println("Console command: $str") + sendCommand(str) } } } @@ -406,10 +408,10 @@ object DeveloperConsole { } } - private fun sendCommand(command: String) { + @JvmStatic + fun sendCommand(command: String) { Class3_Sub13_Sub1.outgoingBuffer.putOpcode(44) - Class3_Sub13_Sub1.outgoingBuffer.writeByte(command.length + -1) -// Class3_Sub13_Sub1.outgoingBuffer.writeString(command.substring(2)) + Class3_Sub13_Sub1.outgoingBuffer.writeByte(command.length + 2) + Class3_Sub13_Sub1.outgoingBuffer.writeString(command) } - } \ No newline at end of file