A RuneTek3 client (377) that is deobfuscated, converted to Kotlin, and includes QoL improvements.
0

Configure Feed

Select the types of activity you want to include in your feed.

Game: Refactored Method updateOtherPlayerMovement

+29 -16
+29 -16
src/com/jagex/runescape/Game.java
··· 7811 7811 updatedPlayerCount = 0; 7812 7812 7813 7813 updateLocalPlayerMovement(buffer); 7814 - updateOtherPlayerMovement(size, buffer); 7814 + updateOtherPlayerMovement(buffer); 7815 7815 addNewPlayers(size, buffer); 7816 7816 parsePlayerBlocks(buffer); 7817 7817 ··· 8685 8685 8686 8686 } 8687 8687 8688 - public void updateOtherPlayerMovement(int packetSize, Buffer buffer) { 8688 + private void updateOtherPlayerMovement(Buffer buffer) { 8689 8689 int playerCount = buffer.getBits(8); 8690 + 8690 8691 if (playerCount < localPlayerCount) { 8691 - for (int l = playerCount; l < localPlayerCount; l++) 8692 - removePlayers[removePlayerCount++] = playerList[l]; 8692 + for (int i = playerCount; i < localPlayerCount; i++) 8693 + removePlayers[removePlayerCount++] = playerList[i]; 8694 + } 8693 8695 8694 - } 8695 8696 if (playerCount > localPlayerCount) { 8696 8697 SignLink.reportError(username + " Too many players"); 8697 8698 throw new RuntimeException("eek"); 8698 8699 } 8700 + 8699 8701 localPlayerCount = 0; 8702 + 8700 8703 for (int i = 0; i < playerCount; i++) { 8701 8704 int id = playerList[i]; 8702 - Player plr = players[id]; 8705 + Player player = players[id]; 8703 8706 int updated = buffer.getBits(1); 8707 + 8704 8708 if (updated == 0) { 8705 8709 playerList[localPlayerCount++] = id; 8706 - plr.pulseCycle = pulseCycle; 8710 + player.pulseCycle = pulseCycle; 8707 8711 } else { 8708 8712 int moveType = buffer.getBits(2); 8713 + 8709 8714 if (moveType == 0) { 8710 8715 playerList[localPlayerCount++] = id; 8711 - plr.pulseCycle = pulseCycle; 8716 + player.pulseCycle = pulseCycle; 8712 8717 updatedPlayers[updatedPlayerCount++] = id; 8713 8718 } else if (moveType == 1) { 8714 8719 playerList[localPlayerCount++] = id; 8715 - plr.pulseCycle = pulseCycle; 8720 + player.pulseCycle = pulseCycle; 8716 8721 int direction = buffer.getBits(3); 8717 - plr.move(direction, false); 8722 + 8723 + player.move(direction, false); 8724 + 8718 8725 int blockUpdateRequired = buffer.getBits(1); 8726 + 8719 8727 if (blockUpdateRequired == 1) 8720 8728 updatedPlayers[updatedPlayerCount++] = id; 8721 8729 } else if (moveType == 2) { 8722 8730 playerList[localPlayerCount++] = id; 8723 - plr.pulseCycle = pulseCycle; 8731 + player.pulseCycle = pulseCycle; 8724 8732 int direction1 = buffer.getBits(3); 8725 - plr.move(direction1, true); 8733 + 8734 + player.move(direction1, true); 8735 + 8726 8736 int direction2 = buffer.getBits(3); 8727 - plr.move(direction2, true); 8737 + 8738 + player.move(direction2, true); 8739 + 8728 8740 int updateRequired = buffer.getBits(1); 8741 + 8729 8742 if (updateRequired == 1) 8730 8743 updatedPlayers[updatedPlayerCount++] = id; 8731 - } else if (moveType == 3) 8732 - removePlayers[removePlayerCount++] = id; 8744 + } else if (moveType == 3) { 8745 + removePlayers[removePlayerCount++] = id; 8746 + } 8733 8747 } 8734 8748 } 8735 - 8736 8749 } 8737 8750 8738 8751 public void renderViewport(int plane) {