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.

refactoring some buffer methods and removing some gibberish

+120 -128
+114 -126
src/com/jagex/runescape/Game.java
··· 141 141 public int anIntArray920[] = new int[151]; 142 142 public int anInt921 = 8; 143 143 public int anInt922; 144 - public static int world = 10; 144 + public static int world = 1; 145 145 public static int portOffset; 146 146 public static boolean memberServer = true; 147 147 public static boolean lowMemory; ··· 501 501 public ImageRGB minimapHint[] = new ImageRGB[1000]; 502 502 public int anInt1279 = -1; 503 503 public int anInt1280; 504 - public int anInt1281 = -939; 505 504 public LinkedList aClass6_1282 = new LinkedList(); 506 505 public boolean aBoolean1283 = false; 507 506 public int anInt1284; ··· 536 535 public int anIntArray1313[]; 537 536 public volatile boolean aBoolean1314 = false; 538 537 public int anInt1315; 539 - public byte aByte1317 = -58; 540 - public int anInt1318 = 416; 541 538 public int anInt1319; 542 539 public volatile boolean aBoolean1320 = false; 543 540 public int soundType[] = new int[50]; ··· 547 544 public static int pulseCycle; 548 545 public int characterEditIdentityKits[] = new int[7]; 549 546 public int currentSong = -1; 550 - public int anInt1328 = 409; 551 547 public int atInventoryLoopCycle; 552 548 public int anInt1330; 553 549 public int anInt1331; ··· 598 594 public static void main(String args[]) { 599 595 try { 600 596 System.out.println("RS2 user client - release #" + 377); 601 - world = 0; 597 + world = 1; 602 598 portOffset = 0; 603 599 setHighMemory(); 604 600 memberServer = true; ··· 1439 1435 outBuffer.putByte(0); 1440 1436 } 1441 1437 method143((byte) -40); 1442 - method36(16220); 1438 + method36(); 1443 1439 method152(); 1444 1440 timeoutCounter++; 1445 1441 if (timeoutCounter > 750) ··· 2037 2033 return true; 2038 2034 } 2039 2035 if (opcode == 186) { 2040 - int i1 = buffer.method550(); 2036 + int i1 = buffer.getShortA(); 2041 2037 int interfaceId = buffer.getLittleShortA(); 2042 - int l16 = buffer.method550(); 2043 - int i22 = buffer.method549(); 2038 + int l16 = buffer.getShortA(); 2039 + int i22 = buffer.getLEShort(); 2044 2040 Widget.forId(interfaceId).rotationX = i1; 2045 2041 Widget.forId(interfaceId).rotationY = i22; 2046 2042 Widget.forId(interfaceId).zoom = l16; ··· 2075 2071 opcode = -1; 2076 2072 return true; 2077 2073 } 2078 - if (opcode == 182) { 2079 - int l1 = buffer.method550(); 2080 - byte byte0 = buffer.getSignedByteSubtracted(); 2081 - anIntArray1005[l1] = byte0; 2082 - if (widgetSettings[l1] != byte0) { 2083 - widgetSettings[l1] = byte0; 2084 - updateVarp(0, l1); 2074 + if (opcode == 182) { // interface config/setting 2075 + int configId = buffer.getShortA(); 2076 + byte configValue = buffer.getSignedByteSubtracted(); 2077 + anIntArray1005[configId] = configValue; 2078 + if (widgetSettings[configId] != configValue) { 2079 + widgetSettings[configId] = configValue; 2080 + updateVarp(0, configId); 2085 2081 redrawTabArea = true; 2086 2082 if (dialogueId != -1) 2087 2083 redrawChatbox = true; ··· 2107 2103 return true; 2108 2104 } 2109 2105 if (opcode == 162) { 2110 - int j2 = buffer.method550(); 2111 - int interfaceId = buffer.method549(); 2106 + int j2 = buffer.getShortA(); 2107 + int interfaceId = buffer.getLEShort(); 2112 2108 Widget.forId(interfaceId).modelType = 2; 2113 2109 Widget.forId(interfaceId).modelId = j2; 2114 2110 opcode = -1; ··· 2159 2155 return true; 2160 2156 } 2161 2157 if (opcode == 249) { 2162 - int fileId = buffer.method549(); 2158 + int fileId = buffer.getLEShort(); 2163 2159 int j12 = buffer.method554(); 2164 2160 if (musicEnabled && !lowMemory) { 2165 2161 nextSong = fileId; ··· 2182 2178 } 2183 2179 if (opcode == 218) { // set interface colour(?) 2184 2180 int interfaceId = buffer.getUnsignedLEShort(); 2185 - int rgb = buffer.method550(); 2181 + int rgb = buffer.getShortA(); 2186 2182 int j17 = rgb >> 10 & 0x1f; 2187 2183 int j22 = rgb >> 5 & 0x1f; 2188 2184 int l24 = rgb & 0x1f; ··· 2287 2283 } 2288 2284 if (opcode == 115) { 2289 2285 int j4 = buffer.method557(); 2290 - int i13 = buffer.method549(); 2286 + int i13 = buffer.getLEShort(); 2291 2287 anIntArray1005[i13] = j4; 2292 2288 if (widgetSettings[i13] != j4) { 2293 2289 widgetSettings[i13] = j4; ··· 2333 2329 return true; 2334 2330 } 2335 2331 if (opcode == 76) { // open welcome screen 2336 - anInt1083 = buffer.method549(); 2332 + anInt1083 = buffer.getLEShort(); 2337 2333 anInt1075 = buffer.getLittleShortA(); 2338 2334 buffer.getUnsignedLEShort(); 2339 2335 anInt1208 = buffer.getUnsignedLEShort(); 2340 - anInt1170 = buffer.method549(); 2341 - anInt1273 = buffer.method550(); 2342 - anInt1215 = buffer.method550(); 2336 + anInt1170 = buffer.getLEShort(); 2337 + anInt1273 = buffer.getShortA(); 2338 + anInt1215 = buffer.getShortA(); 2343 2339 anInt992 = buffer.getUnsignedLEShort(); 2344 2340 lastAddress = buffer.method555(); 2345 2341 anInt1034 = buffer.getLittleShortA(); ··· 2433 2429 return true; 2434 2430 } 2435 2431 if (opcode == 128) { 2436 - int l4 = buffer.method550(); 2432 + int l4 = buffer.getShortA(); 2437 2433 int k13 = buffer.getLittleShortA(); 2438 2434 if (backDialogueId != -1) { 2439 2435 method44(aBoolean1190, backDialogueId); ··· 2501 2497 if (opcode == 78) { // update friend status 2502 2498 long friend = buffer.getLong(); 2503 2499 int nodeId = buffer.getUnsignedByte(); 2504 - String s7 = TextUtils.formatName(TextUtils.longToName(friend)); 2500 + String friendName = TextUtils.formatName(TextUtils.longToName(friend)); 2505 2501 for (int k25 = 0; k25 < friendsCount; k25++) { 2506 2502 if (friend != friends[k25]) 2507 2503 continue; ··· 2509 2505 friendWorlds[k25] = nodeId; 2510 2506 redrawTabArea = true; 2511 2507 if (nodeId > 0) 2512 - addChatMessage("", s7 + " has logged in.", 5); 2508 + addChatMessage("", friendName + " has logged in.", 5); 2513 2509 if (nodeId == 0) 2514 - addChatMessage("", s7 + " has logged out.", 5); 2510 + addChatMessage("", friendName + " has logged out.", 5); 2515 2511 } 2516 - s7 = null; 2512 + friendName = null; 2517 2513 break; 2518 2514 } 2519 2515 2520 - if (s7 != null && friendsCount < 200) { 2516 + if (friendName != null && friendsCount < 200) { 2521 2517 friends[friendsCount] = friend; 2522 - friendUsernames[friendsCount] = s7; 2518 + friendUsernames[friendsCount] = friendName; 2523 2519 friendWorlds[friendsCount] = nodeId; 2524 2520 friendsCount++; 2525 2521 redrawTabArea = true; ··· 2642 2638 placementX = buffer.getUnsignedByte(); 2643 2639 placementY = buffer.getByteAdded(); 2644 2640 while (buffer.currentPosition < packetSize) { 2645 - int j6 = buffer.getUnsignedByte(); 2646 - parsePlacementPacket(buffer, j6); 2641 + int subPacketId = buffer.getUnsignedByte(); 2642 + parsePlacementPacket(buffer, subPacketId); 2647 2643 } 2648 2644 opcode = -1; 2649 2645 return true; ··· 2763 2759 aBoolean1163 = false; 2764 2760 } 2765 2761 if (opcode == 53) { 2766 - tmpChunkX = buffer.method550(); 2762 + tmpChunkX = buffer.getShortA(); 2767 2763 buffer.initBitAccess(); 2768 2764 for (int z = 0; z < 4; z++) { 2769 2765 for (int x = 0; x < 13; x++) { ··· 2780 2776 } 2781 2777 2782 2778 buffer.finishBitAccess(); 2783 - tmpChunkY = buffer.method550(); 2779 + tmpChunkY = buffer.getShortA(); 2784 2780 aBoolean1163 = true; 2785 2781 } 2786 2782 if (chunkX == tmpChunkX && chunkY == tmpChunkY && loadingStage == 2) { ··· 2959 2955 return true; 2960 2956 } 2961 2957 if (opcode == 190) { 2962 - systemUpdateTime = buffer.method549() * 30; 2958 + systemUpdateTime = buffer.getLEShort() * 30; 2963 2959 opcode = -1; 2964 2960 return true; 2965 2961 } ··· 2978 2974 } 2979 2975 if (opcode == 21) { // show a model on an interface?? 2980 2976 int scale = buffer.getUnsignedLEShort(); 2981 - int itemId = buffer.method549(); 2977 + int itemId = buffer.getLEShort(); 2982 2978 int interfaceId = buffer.getLittleShortA(); 2983 2979 if (itemId == 65535) { 2984 2980 Widget.forId(interfaceId).modelType = 0; ··· 3023 3019 return true; 3024 3020 } 3025 3021 if (opcode == 71) { 3026 - method48(buffer, aBoolean1038, packetSize); 3022 + updateNpcs(buffer, aBoolean1038, packetSize); 3027 3023 opcode = -1; 3028 3024 return true; 3029 3025 } ··· 3037 3033 } 3038 3034 if (opcode == 10) { 3039 3035 int l8 = buffer.getByteSubtracted(); 3040 - int j15 = buffer.method550(); 3036 + int j15 = buffer.getShortA(); 3041 3037 if (j15 == 65535) 3042 3038 j15 = -1; 3043 3039 if (anIntArray1081[l8] != j15) { ··· 3050 3046 return true; 3051 3047 } 3052 3048 if (opcode == 219) { // reset all items on interface? 3053 - int interfaceId = buffer.method549(); 3049 + int interfaceId = buffer.getLEShort(); 3054 3050 Widget class13_2 = Widget.forId(interfaceId); 3055 3051 for (int k21 = 0; k21 < class13_2.items.length; k21++) { 3056 3052 class13_2.items[k21] = -1; ··· 3082 3078 } 3083 3079 if (opcode == 126) { 3084 3080 playerMembers = buffer.getUnsignedByte(); 3085 - thisPlayerServerId = buffer.method549(); 3081 + thisPlayerServerId = buffer.getLEShort(); 3086 3082 opcode = -1; 3087 3083 return true; 3088 3084 } ··· 3093 3089 return true; 3094 3090 } 3095 3091 if (opcode == 253) { // open fullscreen interface 3096 - int k9 = buffer.method549(); 3097 - int k15 = buffer.method550(); 3092 + int k9 = buffer.getLEShort(); 3093 + int k15 = buffer.getShortA(); 3098 3094 method112((byte) 36, k15); 3099 3095 if (k9 != -1) 3100 3096 method112((byte) 36, k9); ··· 3131 3127 } 3132 3128 if (opcode == 18) { 3133 3129 int l9 = buffer.getUnsignedLEShort(); 3134 - int interfaceId = buffer.method550(); 3135 - int l21 = buffer.method549(); 3130 + int interfaceId = buffer.getShortA(); 3131 + int l21 = buffer.getLEShort(); 3136 3132 Widget.forId(interfaceId).anInt218 = (l9 << 16) + l21; 3137 3133 opcode = -1; 3138 3134 return true; ··· 3420 3416 return packetType != 1; 3421 3417 } 3422 3418 3423 - public void method36(int i) { 3424 - if (i != 16220) 3425 - anInt1328 = 458; 3419 + public void method36() { 3426 3420 if (loadingStage == 2) { 3427 3421 for (SpawnObjectNode spawnObjectNode = (SpawnObjectNode) aClass6_1261.first(); spawnObjectNode != null; spawnObjectNode = (SpawnObjectNode) aClass6_1261 3428 3422 .next()) { ··· 3955 3949 } 3956 3950 } 3957 3951 3958 - public void method46(int i, byte byte0, Buffer buffer) { 3952 + public void method46(Buffer buffer) { 3959 3953 buffer.initBitAccess(); 3960 3954 int j = buffer.getBits(8); 3961 - if (byte0 != aByte1317) 3962 - anInt1281 = -460; 3963 3955 if (j < anInt1133) { 3964 3956 for (int k = j; k < anInt1133; k++) 3965 3957 removePlayers[removePlayerCount++] = anIntArray1134[k]; ··· 4008 4000 4009 4001 } 4010 4002 4011 - public void method48(Buffer class50_sub1_sub2, boolean flag, int i) { 4003 + public void updateNpcs(Buffer buffer, boolean flag, int packetSize) { 4012 4004 loggedIn &= flag; 4013 4005 removePlayerCount = 0; 4014 4006 updatedPlayerCount = 0; 4015 - method46(i, (byte) -58, class50_sub1_sub2); 4016 - method132(class50_sub1_sub2, i, false); 4017 - method62(class50_sub1_sub2, i, 838); 4007 + method46(buffer); 4008 + method132(buffer, packetSize, false); 4009 + parseNpcUpdateMasks(buffer, packetSize, 838); 4018 4010 for (int j = 0; j < removePlayerCount; j++) { 4019 4011 int k = removePlayers[j]; 4020 4012 if (npcs[k].pulseCycle != pulseCycle) { ··· 4023 4015 } 4024 4016 } 4025 4017 4026 - if (class50_sub1_sub2.currentPosition != i) { 4027 - SignLink.reportError(username + " size mismatch in getnpcpos - coord:" + class50_sub1_sub2.currentPosition 4028 - + " psize:" + i); 4018 + if (buffer.currentPosition != packetSize) { 4019 + SignLink.reportError(username + " size mismatch in getnpcpos - coord:" + buffer.currentPosition 4020 + + " psize:" + packetSize); 4029 4021 throw new RuntimeException("eek"); 4030 4022 } 4031 4023 for (int l = 0; l < anInt1133; l++) ··· 4047 4039 } 4048 4040 4049 4041 4050 - public void method51(boolean flag) { 4042 + public void method51() { 4051 4043 Projectile class50_sub1_sub4_sub2 = (Projectile) aClass6_1282.first(); 4052 - if (flag) 4053 - anInt1328 = 153; 4054 4044 for (; class50_sub1_sub4_sub2 != null; class50_sub1_sub4_sub2 = (Projectile) aClass6_1282 4055 4045 .next()) 4056 4046 if (class50_sub1_sub4_sub2.sceneId != plane || pulseCycle > class50_sub1_sub4_sub2.endCycle) ··· 4639 4629 aBoolean1046 = true; 4640 4630 } 4641 4631 4642 - public void method62(Buffer class50_sub1_sub2, int i, int j) { 4632 + public void parseNpcUpdateMasks(Buffer class50_sub1_sub2, int i, int j) { 4643 4633 j = 24 / j; 4644 4634 for (int k = 0; k < updatedPlayerCount; k++) { 4645 4635 int l = updatedPlayers[k]; 4646 4636 Npc class50_sub1_sub4_sub3_sub1 = npcs[l]; 4647 4637 int i1 = class50_sub1_sub2.getUnsignedByte(); 4648 4638 if ((i1 & 1) != 0) { 4649 - class50_sub1_sub4_sub3_sub1.npcDefinition = ActorDefinition.getDefinition(class50_sub1_sub2.method550()); 4639 + class50_sub1_sub4_sub3_sub1.npcDefinition = ActorDefinition.getDefinition(class50_sub1_sub2.getShortA()); 4650 4640 class50_sub1_sub4_sub3_sub1.boundaryDimension = class50_sub1_sub4_sub3_sub1.npcDefinition.boundaryDimension; 4651 4641 class50_sub1_sub4_sub3_sub1.anInt1600 = class50_sub1_sub4_sub3_sub1.npcDefinition.degreesToTurn; 4652 4642 class50_sub1_sub4_sub3_sub1.walkAnimationId = class50_sub1_sub4_sub3_sub1.npcDefinition.walkAnimationId; ··· 4656 4646 class50_sub1_sub4_sub3_sub1.idleAnimation = class50_sub1_sub4_sub3_sub1.npcDefinition.standAnimationId; 4657 4647 } 4658 4648 if ((i1 & 0x40) != 0) { 4659 - class50_sub1_sub4_sub3_sub1.anInt1609 = class50_sub1_sub2.method549(); 4649 + class50_sub1_sub4_sub3_sub1.anInt1609 = class50_sub1_sub2.getLEShort(); 4660 4650 if (class50_sub1_sub4_sub3_sub1.anInt1609 == 65535) 4661 4651 class50_sub1_sub4_sub3_sub1.anInt1609 = -1; 4662 4652 } ··· 4686 4676 } 4687 4677 if ((i1 & 8) != 0) { 4688 4678 class50_sub1_sub4_sub3_sub1.anInt1598 = class50_sub1_sub2.getLittleShortA(); 4689 - class50_sub1_sub4_sub3_sub1.anInt1599 = class50_sub1_sub2.method549(); 4679 + class50_sub1_sub4_sub3_sub1.anInt1599 = class50_sub1_sub2.getLEShort(); 4690 4680 } 4691 4681 if ((i1 & 2) != 0) { 4692 4682 int l1 = class50_sub1_sub2.getUnsignedLEShort(); ··· 4779 4769 player.anInt1603 = buffer.getByteSubtracted(); 4780 4770 player.anInt1605 = buffer.getUnsignedByte(); 4781 4771 player.anInt1606 = buffer.getUnsignedLEShort() + pulseCycle; 4782 - player.anInt1607 = buffer.method550() + pulseCycle; 4772 + player.anInt1607 = buffer.getShortA() + pulseCycle; 4783 4773 player.anInt1608 = buffer.getUnsignedByte(); 4784 4774 4785 4775 player.resetPath(); 4786 4776 } 4787 4777 4788 4778 if ((mask & 1) != 0) { 4789 - player.anInt1609 = buffer.method550(); 4779 + player.anInt1609 = buffer.getShortA(); 4790 4780 4791 4781 if (player.anInt1609 == 65535) 4792 4782 player.anInt1609 = -1; ··· 4798 4788 } 4799 4789 4800 4790 if ((mask & 0x200) != 0) { 4801 - player.graphic = buffer.method550(); 4791 + player.graphic = buffer.getShortA(); 4802 4792 int heightAndDelay = buffer.method556(); 4803 4793 player.spotAnimationDelay = heightAndDelay >> 16; 4804 4794 player.anInt1617 = pulseCycle + (heightAndDelay & 0xffff); ··· 5663 5653 else 5664 5654 method71(class50_sub1_sub4_sub3, 0); 5665 5655 method72((byte) 8, class50_sub1_sub4_sub3); 5666 - method73(class50_sub1_sub4_sub3, -136); 5656 + method73(class50_sub1_sub4_sub3); 5667 5657 if (byte0 == -97) 5668 5658 ; 5669 5659 } ··· 5874 5864 } 5875 5865 } 5876 5866 5877 - public void method73(Actor class50_sub1_sub4_sub3, int i) { 5878 - while (i >= 0) 5879 - anInt1328 = incomingRandom.nextInt(); 5880 - class50_sub1_sub4_sub3.aBoolean1592 = false; 5881 - if (class50_sub1_sub4_sub3.movementAnimation != -1) { 5882 - AnimationSequence class14 = AnimationSequence.animations[class50_sub1_sub4_sub3.movementAnimation]; 5883 - class50_sub1_sub4_sub3.anInt1590++; 5884 - if (class50_sub1_sub4_sub3.displayedMovementFrames < class14.frameCount 5885 - && class50_sub1_sub4_sub3.anInt1590 > class14.getFrameLength(class50_sub1_sub4_sub3.displayedMovementFrames)) { 5886 - class50_sub1_sub4_sub3.anInt1590 = 1; 5887 - class50_sub1_sub4_sub3.displayedMovementFrames++; 5867 + public void method73(Actor actor) { 5868 + actor.aBoolean1592 = false; 5869 + if (actor.movementAnimation != -1) { 5870 + AnimationSequence class14 = AnimationSequence.animations[actor.movementAnimation]; 5871 + actor.anInt1590++; 5872 + if (actor.displayedMovementFrames < class14.frameCount 5873 + && actor.anInt1590 > class14.getFrameLength(actor.displayedMovementFrames)) { 5874 + actor.anInt1590 = 1; 5875 + actor.displayedMovementFrames++; 5888 5876 } 5889 - if (class50_sub1_sub4_sub3.displayedMovementFrames >= class14.frameCount) { 5890 - class50_sub1_sub4_sub3.anInt1590 = 1; 5891 - class50_sub1_sub4_sub3.displayedMovementFrames = 0; 5877 + if (actor.displayedMovementFrames >= class14.frameCount) { 5878 + actor.anInt1590 = 1; 5879 + actor.displayedMovementFrames = 0; 5892 5880 } 5893 5881 } 5894 - if (class50_sub1_sub4_sub3.graphic != -1 && pulseCycle >= class50_sub1_sub4_sub3.anInt1617) { 5895 - if (class50_sub1_sub4_sub3.currentAnimation < 0) 5896 - class50_sub1_sub4_sub3.currentAnimation = 0; 5897 - AnimationSequence class14_1 = SpotAnimation.cache[class50_sub1_sub4_sub3.graphic].sequences; 5898 - class50_sub1_sub4_sub3.anInt1616++; 5899 - if (class50_sub1_sub4_sub3.currentAnimation < class14_1.frameCount 5900 - && class50_sub1_sub4_sub3.anInt1616 > class14_1.getFrameLength(class50_sub1_sub4_sub3.currentAnimation)) { 5901 - class50_sub1_sub4_sub3.anInt1616 = 1; 5902 - class50_sub1_sub4_sub3.currentAnimation++; 5882 + if (actor.graphic != -1 && pulseCycle >= actor.anInt1617) { 5883 + if (actor.currentAnimation < 0) 5884 + actor.currentAnimation = 0; 5885 + AnimationSequence class14_1 = SpotAnimation.cache[actor.graphic].sequences; 5886 + actor.anInt1616++; 5887 + if (actor.currentAnimation < class14_1.frameCount 5888 + && actor.anInt1616 > class14_1.getFrameLength(actor.currentAnimation)) { 5889 + actor.anInt1616 = 1; 5890 + actor.currentAnimation++; 5903 5891 } 5904 - if (class50_sub1_sub4_sub3.currentAnimation >= class14_1.frameCount 5905 - && (class50_sub1_sub4_sub3.currentAnimation < 0 || class50_sub1_sub4_sub3.currentAnimation >= class14_1.frameCount)) 5906 - class50_sub1_sub4_sub3.graphic = -1; 5892 + if (actor.currentAnimation >= class14_1.frameCount 5893 + && (actor.currentAnimation < 0 || actor.currentAnimation >= class14_1.frameCount)) 5894 + actor.graphic = -1; 5907 5895 } 5908 - if (class50_sub1_sub4_sub3.emoteAnimation != -1 && class50_sub1_sub4_sub3.animationDelay <= 1) { 5909 - AnimationSequence class14_2 = AnimationSequence.animations[class50_sub1_sub4_sub3.emoteAnimation]; 5910 - if (class14_2.anInt305 == 1 && class50_sub1_sub4_sub3.anInt1613 > 0 5911 - && class50_sub1_sub4_sub3.anInt1606 <= pulseCycle && class50_sub1_sub4_sub3.anInt1607 < pulseCycle) { 5912 - class50_sub1_sub4_sub3.animationDelay = 1; 5896 + if (actor.emoteAnimation != -1 && actor.animationDelay <= 1) { 5897 + AnimationSequence class14_2 = AnimationSequence.animations[actor.emoteAnimation]; 5898 + if (class14_2.anInt305 == 1 && actor.anInt1613 > 0 5899 + && actor.anInt1606 <= pulseCycle && actor.anInt1607 < pulseCycle) { 5900 + actor.animationDelay = 1; 5913 5901 return; 5914 5902 } 5915 5903 } 5916 - if (class50_sub1_sub4_sub3.emoteAnimation != -1 && class50_sub1_sub4_sub3.animationDelay == 0) { 5917 - AnimationSequence class14_3 = AnimationSequence.animations[class50_sub1_sub4_sub3.emoteAnimation]; 5918 - class50_sub1_sub4_sub3.anInt1626++; 5919 - if (class50_sub1_sub4_sub3.displayedEmoteFrames < class14_3.frameCount 5920 - && class50_sub1_sub4_sub3.anInt1626 > class14_3.getFrameLength(class50_sub1_sub4_sub3.displayedEmoteFrames)) { 5921 - class50_sub1_sub4_sub3.anInt1626 = 1; 5922 - class50_sub1_sub4_sub3.displayedEmoteFrames++; 5904 + if (actor.emoteAnimation != -1 && actor.animationDelay == 0) { 5905 + AnimationSequence class14_3 = AnimationSequence.animations[actor.emoteAnimation]; 5906 + actor.anInt1626++; 5907 + if (actor.displayedEmoteFrames < class14_3.frameCount 5908 + && actor.anInt1626 > class14_3.getFrameLength(actor.displayedEmoteFrames)) { 5909 + actor.anInt1626 = 1; 5910 + actor.displayedEmoteFrames++; 5923 5911 } 5924 - if (class50_sub1_sub4_sub3.displayedEmoteFrames >= class14_3.frameCount) { 5925 - class50_sub1_sub4_sub3.displayedEmoteFrames -= class14_3.frameStep; 5926 - class50_sub1_sub4_sub3.anInt1628++; 5927 - if (class50_sub1_sub4_sub3.anInt1628 >= class14_3.anInt304) 5928 - class50_sub1_sub4_sub3.emoteAnimation = -1; 5929 - if (class50_sub1_sub4_sub3.displayedEmoteFrames < 0 || class50_sub1_sub4_sub3.displayedEmoteFrames >= class14_3.frameCount) 5930 - class50_sub1_sub4_sub3.emoteAnimation = -1; 5912 + if (actor.displayedEmoteFrames >= class14_3.frameCount) { 5913 + actor.displayedEmoteFrames -= class14_3.frameStep; 5914 + actor.anInt1628++; 5915 + if (actor.anInt1628 >= class14_3.anInt304) 5916 + actor.emoteAnimation = -1; 5917 + if (actor.displayedEmoteFrames < 0 || actor.displayedEmoteFrames >= class14_3.frameCount) 5918 + actor.emoteAnimation = -1; 5931 5919 } 5932 - class50_sub1_sub4_sub3.aBoolean1592 = class14_3.aBoolean300; 5920 + actor.aBoolean1592 = class14_3.aBoolean300; 5933 5921 } 5934 - if (class50_sub1_sub4_sub3.animationDelay > 0) 5935 - class50_sub1_sub4_sub3.animationDelay--; 5922 + if (actor.animationDelay > 0) 5923 + actor.animationDelay--; 5936 5924 } 5937 5925 5938 5926 public void method74(int i) { ··· 10567 10555 int x = placementX + (offset >> 4 & 7); 10568 10556 int y = placementY + (offset & 7); 10569 10557 byte byte1 = buf.getSignedByteAdded(); 10570 - int l19 = buf.method550(); 10571 - int id = buf.method549(); 10558 + int l19 = buf.getShortA(); 10559 + int id = buf.getLEShort(); 10572 10560 byte byte2 = buf.getSignedByte(); 10573 10561 byte byte3 = buf.getSignedByteAdded(); 10574 10562 int l21 = buf.getUnsignedLEShort(); ··· 10621 10609 int x = placementX + (offset >> 4 & 7); 10622 10610 int y = placementY + (offset & 7); 10623 10611 int amount = buf.getLittleShortA(); 10624 - int id = buf.method550(); 10625 - int playerId = buf.method550(); 10612 + int id = buf.getShortA(); 10613 + int playerId = buf.getShortA(); 10626 10614 if (x >= 0 && y >= 0 && x < 104 && y < 104 && playerId != thisPlayerServerId) { 10627 10615 Item item = new Item(); 10628 10616 item.itemId = id; ··· 10691 10679 int offset = buf.getByteNegated(); 10692 10680 int x = placementX + (offset >> 4 & 7); 10693 10681 int y = placementY + (offset & 7); 10694 - int amount = buf.method550(); 10682 + int amount = buf.getShortA(); 10695 10683 if (x >= 0 && y >= 0 && x < 104 && y < 104) { 10696 10684 Item item = new Item(); 10697 10685 item.itemId = id; ··· 10801 10789 return; 10802 10790 } 10803 10791 if (opcode == 208) { // remove ground item 10804 - int id = buf.method550(); 10792 + int id = buf.getShortA(); 10805 10793 int offset = buf.getByteAdded(); 10806 10794 int x = placementX + (offset >> 4 & 7); 10807 10795 int y = placementY + (offset & 7); ··· 11794 11782 method57(751, true); 11795 11783 processPlayerAdditions(false); 11796 11784 method57(751, false); 11797 - method51(false); 11785 + method51(); 11798 11786 method76(-992); 11799 11787 if (!oriented) { 11800 11788 int j = anInt1251;
+4
src/com/jagex/runescape/GameShell.java
··· 398 398 public void windowClosed(WindowEvent windowevent) { 399 399 } 400 400 401 + public void windowClosing(WindowEvent windowevent) { 402 + destroy(); 403 + } 404 + 401 405 public void windowDeactivated(WindowEvent windowevent) { 402 406 } 403 407
+2 -2
src/com/jagex/runescape/net/Buffer.java
··· 297 297 buffer[currentPosition++] = (byte) (value >> 8); 298 298 } 299 299 300 - public int method549() { 300 + public int getLEShort() { 301 301 currentPosition += 2; 302 302 return ((buffer[currentPosition - 1] & 0xff) << 8) + (buffer[currentPosition - 2] & 0xff); 303 303 } 304 304 305 - public int method550() { 305 + public int getShortA() { 306 306 currentPosition += 2; 307 307 return ((buffer[currentPosition - 2] & 0xff) << 8) + (buffer[currentPosition - 1] - 128 & 0xff); 308 308 }