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.

Renaming byte buffer methods

+609 -610
+334 -334
src/com/jagex/runescape/Game.java
··· 670 670 friendsCount++; 671 671 redrawTabArea = true; 672 672 outBuffer.putOpcode(120); 673 - outBuffer.putLong(name); 673 + outBuffer.putLongBE(name); 674 674 return; 675 675 } catch (RuntimeException runtimeexception) { 676 676 SignLink.reportError("94629, " + name + ", " + ", " + runtimeexception.toString()); ··· 702 702 ignores[ignoresCount++] = name; 703 703 redrawTabArea = true; 704 704 outBuffer.putOpcode(217); 705 - outBuffer.putLong(name); 705 + outBuffer.putLongBE(name); 706 706 return; 707 707 } catch (RuntimeException runtimeexception) { 708 708 SignLink.reportError("27939, " + -916 + ", " + name + ", " + runtimeexception.toString()); ··· 1335 1335 if (duplicateClickCount < 8 && i6 >= -32 && i6 <= 31 && j6 >= -32 && j6 <= 31) { 1336 1336 i6 += 32; 1337 1337 j6 += 32; 1338 - outBuffer.putShort((duplicateClickCount << 12) + (i6 << 6) + j6); 1338 + outBuffer.putShortBE((duplicateClickCount << 12) + (i6 << 6) + j6); 1339 1339 duplicateClickCount = 0; 1340 1340 } else if (duplicateClickCount < 8) { 1341 - outBuffer.putTriByte(0x800000 + (duplicateClickCount << 19) + l5); 1341 + outBuffer.putMediumBE(0x800000 + (duplicateClickCount << 19) + l5); 1342 1342 duplicateClickCount = 0; 1343 1343 } else { 1344 - outBuffer.putInt(0xc0000000 + (duplicateClickCount << 19) + l5); 1344 + outBuffer.putIntBE(0xc0000000 + (duplicateClickCount << 19) + l5); 1345 1345 duplicateClickCount = 0; 1346 1346 } 1347 1347 } ··· 1384 1384 i5 = 1; 1385 1385 int k5 = (int) l; 1386 1386 outBuffer.putOpcode(19); 1387 - outBuffer.putInt((k5 << 20) + (i5 << 19) + j4); 1387 + outBuffer.putIntBE((k5 << 20) + (i5 << 19) + j4); 1388 1388 } 1389 1389 if (anInt1264 > 0) 1390 1390 anInt1264--; ··· 1395 1395 anInt1264 = 20; 1396 1396 aBoolean1265 = false; 1397 1397 outBuffer.putOpcode(140); 1398 - outBuffer.putLEShortDup(cameraVertical); 1399 - outBuffer.putLEShortDup(cameraHorizontal); 1398 + outBuffer.putShortLE(cameraVertical); 1399 + outBuffer.putShortLE(cameraHorizontal); 1400 1400 } 1401 1401 if (super.awtFocus && !aBoolean1275) { 1402 1402 aBoolean1275 = true; ··· 1476 1476 childInterface.swapItems(selectedInventorySlot, mouseInvInterfaceIndex); 1477 1477 } 1478 1478 outBuffer.putOpcode(123); 1479 - outBuffer.putLEShortAdded(mouseInvInterfaceIndex); 1480 - outBuffer.putByteAdded(i1); 1481 - outBuffer.putShortAdded(modifiedWidgetId); 1482 - outBuffer.putLEShortDup(selectedInventorySlot); 1479 + outBuffer.putOffsetShortLE(mouseInvInterfaceIndex); 1480 + outBuffer.putOffsetByte(i1); 1481 + outBuffer.putOffsetShortBE(modifiedWidgetId); 1482 + outBuffer.putShortLE(selectedInventorySlot); 1483 1483 } 1484 1484 } else if ((anInt1300 == 1 || menuHasAddFriend(menuActionRow - 1, aByte1161)) && menuActionRow > 2) 1485 1485 determineMenuSize(); ··· 1711 1711 outBuffer.putOpcode(227); 1712 1712 outBuffer.putByte(0); 1713 1713 int j = outBuffer.currentPosition; 1714 - outBuffer.putLong(aLong1141); 1714 + outBuffer.putLongBE(aLong1141); 1715 1715 ChatEncoder.put(chatMessage, outBuffer); 1716 1716 outBuffer.putLength(outBuffer.currentPosition - j); 1717 1717 chatMessage = ChatEncoder.formatChatMessage(chatMessage); ··· 1754 1754 /* empty */ 1755 1755 } 1756 1756 outBuffer.putOpcode(75); 1757 - outBuffer.putInt(inputValue); 1757 + outBuffer.putIntBE(inputValue); 1758 1758 } 1759 1759 inputType = 0; 1760 1760 redrawChatbox = true; ··· 1771 1771 if (key == 13 || key == 10) { 1772 1772 if (inputInputMessage.length() > 0) { 1773 1773 outBuffer.putOpcode(206); 1774 - outBuffer.putLong(TextUtils.nameToLong(inputInputMessage)); 1774 + outBuffer.putLongBE(TextUtils.nameToLong(inputInputMessage)); 1775 1775 } 1776 1776 inputType = 0; 1777 1777 redrawChatbox = true; ··· 1886 1886 outBuffer.putOpcode(49); 1887 1887 outBuffer.putByte(0); 1888 1888 int bufferPos = outBuffer.currentPosition; 1889 - outBuffer.putByteNegated(colourCode); 1890 - outBuffer.putByteAdded(effectCode); 1889 + outBuffer.putInvertedByte(colourCode); 1890 + outBuffer.putOffsetByte(effectCode); 1891 1891 chatBuffer.currentPosition = 0; 1892 1892 ChatEncoder.put(chatboxInput, chatBuffer); 1893 1893 outBuffer.putBytes(chatBuffer.buffer, 0, ··· 1983 1983 if (available > 1) { 1984 1984 gameConnection.read(buffer.buffer, 0, 2); 1985 1985 buffer.currentPosition = 0; 1986 - packetSize = buffer.getUnsignedShort(); 1986 + packetSize = buffer.getUnsignedShortBE(); 1987 1987 available -= 2; 1988 1988 } else { 1989 1989 return false; ··· 1997 1997 secondLastOpcode = lastOpcode; 1998 1998 lastOpcode = opcode; 1999 1999 if (opcode == 166) { 2000 - int yOffset = buffer.getLEShort(); 2001 - int xOffset = buffer.getLEShort(); 2002 - int interfaceId = buffer.getUnsignedShort(); 2000 + int yOffset = buffer.getShortLE(); 2001 + int xOffset = buffer.getShortLE(); 2002 + int interfaceId = buffer.getUnsignedShortBE(); 2003 2003 Widget widget = Widget.forId(interfaceId); 2004 2004 widget.xOffset = xOffset; 2005 2005 widget.yOffset = yOffset; ··· 2007 2007 return true; 2008 2008 } 2009 2009 if (opcode == 186) { 2010 - int rotationX = buffer.getShortUnsingedAdded(); 2011 - int interfaceId = buffer.getLittleShortA(); 2012 - int zoom = buffer.getShortUnsingedAdded(); 2013 - int rotationY = buffer.getUnsignedLEShort(); 2010 + int rotationX = buffer.getUnsignedNegativeOffsetShortBE(); 2011 + int interfaceId = buffer.getUnsignedNegativeOffsetShortLE(); 2012 + int zoom = buffer.getUnsignedNegativeOffsetShortBE(); 2013 + int rotationY = buffer.getUnsignedShortLE(); 2014 2014 Widget.forId(interfaceId).rotationX = rotationX; 2015 2015 Widget.forId(interfaceId).rotationY = rotationY; 2016 2016 Widget.forId(interfaceId).zoom = zoom; ··· 2018 2018 return true; 2019 2019 } 2020 2020 if (opcode == 216) { 2021 - int j1 = buffer.getLittleShortA(); 2022 - int interfaceId = buffer.getLittleShortA(); 2021 + int j1 = buffer.getUnsignedNegativeOffsetShortLE(); 2022 + int interfaceId = buffer.getUnsignedNegativeOffsetShortLE(); 2023 2023 Widget.forId(interfaceId).modelType = 1; 2024 2024 Widget.forId(interfaceId).modelId = j1; 2025 2025 opcode = -1; 2026 2026 return true; 2027 2027 } 2028 2028 if (opcode == 26) { 2029 - int k1 = buffer.getUnsignedShort(); 2029 + int k1 = buffer.getUnsignedShortBE(); 2030 2030 int k11 = buffer.getUnsignedByte(); 2031 - int i17 = buffer.getUnsignedShort(); 2031 + int i17 = buffer.getUnsignedShortBE(); 2032 2032 if (i17 == 65535) { 2033 2033 if (currentSound < 50) { 2034 2034 sound[currentSound] = (short) k1; ··· 2046 2046 return true; 2047 2047 } 2048 2048 if (opcode == 182) { // interface config/setting 2049 - int configId = buffer.getShortUnsingedAdded(); 2050 - byte configValue = buffer.getSignedByteSubtracted(); 2049 + int configId = buffer.getUnsignedNegativeOffsetShortBE(); 2050 + byte configValue = buffer.getPreNegativeOffsetByte(); 2051 2051 anIntArray1005[configId] = configValue; 2052 2052 if (widgetSettings[configId] != configValue) { 2053 2053 widgetSettings[configId] = configValue; ··· 2077 2077 return true; 2078 2078 } 2079 2079 if (opcode == 162) { 2080 - int j2 = buffer.getShortUnsingedAdded(); 2081 - int interfaceId = buffer.getUnsignedLEShort(); 2080 + int j2 = buffer.getUnsignedNegativeOffsetShortBE(); 2081 + int interfaceId = buffer.getUnsignedShortLE(); 2082 2082 Widget.forId(interfaceId).modelType = 2; 2083 2083 Widget.forId(interfaceId).modelId = j2; 2084 2084 opcode = -1; 2085 2085 return true; 2086 2086 } 2087 2087 if (opcode == 109) { 2088 - int k2 = buffer.getUnsignedShort(); 2088 + int k2 = buffer.getUnsignedShortBE(); 2089 2089 method112((byte) 36, k2); 2090 2090 if (openInvOverLayId != -1) { 2091 2091 method44(openInvOverLayId); ··· 2116 2116 return true; 2117 2117 } 2118 2118 if (opcode == 220) { 2119 - int songID = buffer.getLittleShortA(); 2119 + int songID = buffer.getUnsignedNegativeOffsetShortLE(); 2120 2120 if (songID == 65535) 2121 2121 songID = -1; 2122 2122 if (songID != currentSong && musicEnabled && !lowMemory && previousSong == 0) { ··· 2129 2129 return true; 2130 2130 } 2131 2131 if (opcode == 249) { 2132 - int fileId = buffer.getUnsignedLEShort(); 2133 - int j12 = buffer.method554(); 2132 + int fileId = buffer.getUnsignedShortLE(); 2133 + int j12 = buffer.getMediumME(); 2134 2134 if (musicEnabled && !lowMemory) { 2135 2135 nextSong = fileId; 2136 2136 songChanging = false; ··· 2141 2141 return true; 2142 2142 } 2143 2143 if (opcode == 158) { 2144 - int j3 = buffer.getLEShort(); 2144 + int j3 = buffer.getShortLE(); 2145 2145 if (j3 != dialogueId) { 2146 2146 method44(dialogueId); 2147 2147 dialogueId = j3; ··· 2151 2151 return true; 2152 2152 } 2153 2153 if (opcode == 218) { // set interface colour(?) 2154 - int interfaceId = buffer.getUnsignedShort(); 2155 - int rgb = buffer.getShortUnsingedAdded(); 2154 + int interfaceId = buffer.getUnsignedShortBE(); 2155 + int rgb = buffer.getUnsignedNegativeOffsetShortBE(); 2156 2156 int j17 = rgb >> 10 & 0x1f; 2157 2157 int j22 = rgb >> 5 & 0x1f; 2158 2158 int l24 = rgb & 0x1f; ··· 2161 2161 return true; 2162 2162 } 2163 2163 if (opcode == 157) { // update player option 2164 - int slot = buffer.getByteNegated(); 2164 + int slot = buffer.getUnsignedInvertedByte(); 2165 2165 String option = buffer.getString(); 2166 2166 int alwaysOnTop = buffer.getUnsignedByte(); 2167 2167 if (slot >= 1 && slot <= 5) { ··· 2193 2193 if (opcode == 199) { 2194 2194 headIconDrawType = buffer.getUnsignedByte(); 2195 2195 if (headIconDrawType == 1) 2196 - anInt1226 = buffer.getUnsignedShort(); 2196 + anInt1226 = buffer.getUnsignedShortBE(); 2197 2197 if (headIconDrawType >= 2 && headIconDrawType <= 6) { 2198 2198 if (headIconDrawType == 2) { 2199 2199 anInt847 = 64; ··· 2216 2216 anInt848 = 128; 2217 2217 } 2218 2218 headIconDrawType = 2; 2219 - anInt844 = buffer.getUnsignedShort(); 2220 - anInt845 = buffer.getUnsignedShort(); 2219 + anInt844 = buffer.getUnsignedShortBE(); 2220 + anInt845 = buffer.getUnsignedShortBE(); 2221 2221 anInt846 = buffer.getUnsignedByte(); 2222 2222 } 2223 2223 if (headIconDrawType == 10) 2224 - otherPlayerId = buffer.getUnsignedShort(); 2224 + otherPlayerId = buffer.getUnsignedShortBE(); 2225 2225 opcode = -1; 2226 2226 return true; 2227 2227 } ··· 2229 2229 cutsceneActive = true; 2230 2230 anInt993 = buffer.getUnsignedByte(); 2231 2231 anInt994 = buffer.getUnsignedByte(); 2232 - anInt995 = buffer.getUnsignedShort(); 2232 + anInt995 = buffer.getUnsignedShortBE(); 2233 2233 anInt996 = buffer.getUnsignedByte(); 2234 2234 anInt997 = buffer.getUnsignedByte(); 2235 2235 if (anInt997 >= 100) { ··· 2256 2256 return false; 2257 2257 } 2258 2258 if (opcode == 115) { 2259 - int j4 = buffer.method557(); 2260 - int i13 = buffer.getUnsignedLEShort(); 2259 + int j4 = buffer.getIntME2(); 2260 + int i13 = buffer.getUnsignedShortLE(); 2261 2261 anIntArray1005[i13] = j4; 2262 2262 if (widgetSettings[i13] != j4) { 2263 2263 widgetSettings[i13] = j4; ··· 2303 2303 return true; 2304 2304 } 2305 2305 if (opcode == 76) { // open welcome screen 2306 - anInt1083 = buffer.getUnsignedLEShort(); 2307 - anInt1075 = buffer.getLittleShortA(); 2308 - buffer.getUnsignedShort(); 2309 - anInt1208 = buffer.getUnsignedShort(); 2310 - anInt1170 = buffer.getUnsignedLEShort(); 2311 - anInt1273 = buffer.getShortUnsingedAdded(); 2312 - anInt1215 = buffer.getShortUnsingedAdded(); 2313 - anInt992 = buffer.getUnsignedShort(); 2314 - lastAddress = buffer.method555(); 2315 - anInt1034 = buffer.getLittleShortA(); 2316 - buffer.getByteAdded(); 2306 + anInt1083 = buffer.getUnsignedShortLE(); 2307 + anInt1075 = buffer.getUnsignedNegativeOffsetShortLE(); 2308 + buffer.getUnsignedShortBE(); 2309 + anInt1208 = buffer.getUnsignedShortBE(); 2310 + anInt1170 = buffer.getUnsignedShortLE(); 2311 + anInt1273 = buffer.getUnsignedNegativeOffsetShortBE(); 2312 + anInt1215 = buffer.getUnsignedNegativeOffsetShortBE(); 2313 + anInt992 = buffer.getUnsignedShortBE(); 2314 + lastAddress = buffer.getIntLE(); 2315 + anInt1034 = buffer.getUnsignedNegativeOffsetShortLE(); 2316 + buffer.getUnsignedPostNegativeOffsetByte(); 2317 2317 SignLink.dnsLookup(TextUtils.decodeAddress(lastAddress)); 2318 2318 opcode = -1; 2319 2319 return true; ··· 2368 2368 return true; 2369 2369 } 2370 2370 if (opcode == 50) { 2371 - int k4 = buffer.getSignedShort(); 2371 + int k4 = buffer.getShortBE(); 2372 2372 if (k4 >= 0) 2373 2373 method112((byte) 36, k4); 2374 2374 if (k4 != walkableWidgetId) { ··· 2380 2380 } 2381 2381 if (opcode == 82) { // make interface (in)visible maybe? 2382 2382 boolean flag = buffer.getUnsignedByte() == 1; 2383 - int interfaceId = buffer.getUnsignedShort(); 2383 + int interfaceId = buffer.getUnsignedShortBE(); 2384 2384 Widget.forId(interfaceId).hiddenUntilHovered = flag; 2385 2385 opcode = -1; 2386 2386 return true; ··· 2388 2388 if (opcode == 174) { 2389 2389 if (currentTabId == 12) 2390 2390 redrawTabArea = true; 2391 - userWeight = buffer.getSignedShort(); 2391 + userWeight = buffer.getShortBE(); 2392 2392 opcode = -1; 2393 2393 return true; 2394 2394 } ··· 2403 2403 return true; 2404 2404 } 2405 2405 if (opcode == 128) { 2406 - int interfaceId = buffer.getShortUnsingedAdded(); 2407 - int invOverlayId = buffer.getLittleShortA(); 2406 + int interfaceId = buffer.getUnsignedNegativeOffsetShortBE(); 2407 + int invOverlayId = buffer.getUnsignedNegativeOffsetShortLE(); 2408 2408 if (backDialogueId != -1) { 2409 2409 method44(backDialogueId); 2410 2410 backDialogueId = -1; ··· 2452 2452 } 2453 2453 if (opcode == 134) { // set items in interface 2454 2454 redrawTabArea = true; 2455 - int interfaceId = buffer.getUnsignedShort(); 2455 + int interfaceId = buffer.getUnsignedShortBE(); 2456 2456 Widget inter = Widget.forId(interfaceId); 2457 2457 while (buffer.currentPosition < packetSize) { 2458 2458 int slot = buffer.getSmart(); 2459 - int id = buffer.getUnsignedShort(); 2459 + int id = buffer.getUnsignedShortBE(); 2460 2460 int amount = buffer.getUnsignedByte(); 2461 2461 if (amount == 255) 2462 - amount = buffer.getInt(); 2462 + amount = buffer.getIntBE(); 2463 2463 if (slot >= 0 && slot < inter.items.length) { 2464 2464 inter.items[slot] = id; 2465 2465 inter.itemAmounts[slot] = amount; ··· 2469 2469 return true; 2470 2470 } 2471 2471 if (opcode == 78) { // update friend status 2472 - long friend = buffer.getLong(); 2472 + long friend = buffer.getLongBE(); 2473 2473 int nodeId = buffer.getUnsignedByte(); 2474 2474 String friendName = TextUtils.formatName(TextUtils.longToName(friend)); 2475 2475 for (int k25 = 0; k25 < friendsCount; k25++) { ··· 2526 2526 return true; 2527 2527 } 2528 2528 if (opcode == 252) { 2529 - currentTabId = buffer.getByteNegated(); 2529 + currentTabId = buffer.getUnsignedInvertedByte(); 2530 2530 redrawTabArea = true; 2531 2531 drawTabIcons = true; 2532 2532 opcode = -1; 2533 2533 return true; 2534 2534 } 2535 2535 if (opcode == 40) { 2536 - placementY = buffer.getByteSubtracted(); 2537 - placementX = buffer.getByteNegated(); 2536 + placementY = buffer.getUnsignedPreNegativeOffsetByte(); 2537 + placementX = buffer.getUnsignedInvertedByte(); 2538 2538 for (int k5 = placementX; k5 < placementX + 8; k5++) { 2539 2539 for (int i14 = placementY; i14 < placementY + 8; i14++) 2540 2540 if (groundItems[plane][k5][i14] != null) { ··· 2555 2555 return true; 2556 2556 } 2557 2557 if (opcode == 255) { // show player in an interface *maybe*? 2558 - int interfaceId = buffer.getLittleShortA(); 2558 + int interfaceId = buffer.getUnsignedNegativeOffsetShortLE(); 2559 2559 Widget.forId(interfaceId).modelType = 3; 2560 2560 if (localPlayer.npcDefinition == null) // maybe that is the appear as npc thing? 2561 2561 Widget.forId(interfaceId).modelId = (localPlayer.appearanceColors[0] << 25) + (localPlayer.appearanceColors[4] << 20) ··· 2567 2567 return true; 2568 2568 } 2569 2569 if (opcode == 135) { // private message (?) 2570 - long l6 = buffer.getLong(); 2571 - int i19 = buffer.getInt(); 2570 + long l6 = buffer.getLongBE(); 2571 + int i19 = buffer.getIntBE(); 2572 2572 int j23 = buffer.getUnsignedByte(); 2573 2573 boolean flag4 = false; 2574 2574 for (int k28 = 0; k28 < 100; k28++) { ··· 2610 2610 } 2611 2611 if (opcode == 183) { 2612 2612 placementX = buffer.getUnsignedByte(); 2613 - placementY = buffer.getByteAdded(); 2613 + placementY = buffer.getUnsignedPostNegativeOffsetByte(); 2614 2614 while (buffer.currentPosition < packetSize) { 2615 2615 int subPacketId = buffer.getUnsignedByte(); 2616 2616 parsePlacementPacket(buffer, subPacketId); ··· 2619 2619 return true; 2620 2620 } 2621 2621 if (opcode == 159) { // open interface 2622 - int interfaceId = buffer.getLittleShortA(); 2622 + int interfaceId = buffer.getUnsignedNegativeOffsetShortLE(); 2623 2623 method112((byte) 36, interfaceId); 2624 2624 if (openInvOverLayId != -1) { 2625 2625 method44(openInvOverLayId); ··· 2654 2654 return true; 2655 2655 } 2656 2656 if (opcode == 246) { 2657 - int i7 = buffer.getLittleShortA(); 2657 + int i7 = buffer.getUnsignedNegativeOffsetShortLE(); 2658 2658 method112((byte) 36, i7); 2659 2659 if (backDialogueId != -1) { 2660 2660 method44(backDialogueId); ··· 2690 2690 } 2691 2691 if (opcode == 49) { 2692 2692 redrawTabArea = true; 2693 - int _skillId = buffer.getByteNegated(); 2693 + int _skillId = buffer.getUnsignedInvertedByte(); 2694 2694 int _skillLevel = buffer.getUnsignedByte(); 2695 - int _skillExp = buffer.getInt(); 2695 + int _skillExp = buffer.getIntBE(); 2696 2696 skillExperience[_skillId] = _skillExp; 2697 2697 skillLevel[_skillId] = _skillLevel; 2698 2698 skillMaxLevel[_skillId] = 1; ··· 2705 2705 } 2706 2706 if (opcode == 206) { // update all items in interface 2707 2707 redrawTabArea = true; 2708 - int interfaceId = buffer.getUnsignedShort(); 2708 + int interfaceId = buffer.getUnsignedShortBE(); 2709 2709 Widget inter = Widget.forId(interfaceId); 2710 - int items = buffer.getUnsignedShort(); 2710 + int items = buffer.getUnsignedShortBE(); 2711 2711 for (int item = 0; item < items; item++) { 2712 - inter.items[item] = buffer.getLittleShortA(); 2713 - int amount = buffer.getByteNegated(); 2712 + inter.items[item] = buffer.getUnsignedNegativeOffsetShortLE(); 2713 + int amount = buffer.getUnsignedInvertedByte(); 2714 2714 if (amount == 255) 2715 - amount = buffer.method555(); 2715 + amount = buffer.getIntLE(); 2716 2716 inter.itemAmounts[item] = amount; 2717 2717 } 2718 2718 ··· 2728 2728 int tmpChunkX = chunkX; 2729 2729 int tmpChunkY = chunkY; 2730 2730 if (opcode == 222) { 2731 - tmpChunkY = buffer.getUnsignedShort(); 2732 - tmpChunkX = buffer.getLittleShortA(); 2731 + tmpChunkY = buffer.getUnsignedShortBE(); 2732 + tmpChunkX = buffer.getUnsignedNegativeOffsetShortLE(); 2733 2733 aBoolean1163 = false; 2734 2734 } 2735 2735 if (opcode == 53) { 2736 - tmpChunkX = buffer.getShortUnsingedAdded(); 2736 + tmpChunkX = buffer.getUnsignedNegativeOffsetShortBE(); 2737 2737 buffer.initBitAccess(); 2738 2738 for (int z = 0; z < 4; z++) { 2739 2739 for (int x = 0; x < 13; x++) { ··· 2750 2750 } 2751 2751 2752 2752 buffer.finishBitAccess(); 2753 - tmpChunkY = buffer.getShortUnsingedAdded(); 2753 + tmpChunkY = buffer.getUnsignedNegativeOffsetShortBE(); 2754 2754 aBoolean1163 = true; 2755 2755 } 2756 2756 if (chunkX == tmpChunkX && chunkY == tmpChunkY && loadingStage == 2) { ··· 2929 2929 return true; 2930 2930 } 2931 2931 if (opcode == 190) { 2932 - systemUpdateTime = buffer.getUnsignedLEShort() * 30; 2932 + systemUpdateTime = buffer.getUnsignedShortLE() * 30; 2933 2933 opcode = -1; 2934 2934 return true; 2935 2935 } ··· 2947 2947 return true; 2948 2948 } 2949 2949 if (opcode == 21) { // show a model on an interface?? 2950 - int scale = buffer.getUnsignedShort(); 2951 - int itemId = buffer.getUnsignedLEShort(); 2952 - int interfaceId = buffer.getLittleShortA(); 2950 + int scale = buffer.getUnsignedShortBE(); 2951 + int itemId = buffer.getUnsignedShortLE(); 2952 + int interfaceId = buffer.getUnsignedNegativeOffsetShortLE(); 2953 2953 if (itemId == 65535) { 2954 2954 Widget.forId(interfaceId).modelType = 0; 2955 2955 opcode = -1; ··· 2969 2969 cutsceneActive = true; 2970 2970 anInt874 = buffer.getUnsignedByte(); 2971 2971 anInt875 = buffer.getUnsignedByte(); 2972 - anInt876 = buffer.getUnsignedShort(); 2972 + anInt876 = buffer.getUnsignedShortBE(); 2973 2973 anInt877 = buffer.getUnsignedByte(); 2974 2974 anInt878 = buffer.getUnsignedByte(); 2975 2975 if (anInt878 >= 100) { ··· 2981 2981 return true; 2982 2982 } 2983 2983 if (opcode == 2) { 2984 - int interfaceId = buffer.getLittleShortA(); 2985 - int animationId = buffer.getShortA(); 2984 + int interfaceId = buffer.getUnsignedNegativeOffsetShortLE(); 2985 + int animationId = buffer.getNegativeOffsetShortBE(); 2986 2986 Widget class13_3 = Widget.forId(interfaceId); 2987 2987 if (class13_3.disabledAnimation != animationId || animationId == -1) { 2988 2988 class13_3.disabledAnimation = animationId; ··· 3000 3000 if (opcode == 226) { // ignore list 3001 3001 ignoresCount = packetSize / 8; 3002 3002 for (int k8 = 0; k8 < ignoresCount; k8++) 3003 - ignores[k8] = buffer.getLong(); 3003 + ignores[k8] = buffer.getLongBE(); 3004 3004 3005 3005 opcode = -1; 3006 3006 return true; 3007 3007 } 3008 3008 if (opcode == 10) { 3009 - int sidebarIcon = buffer.getByteSubtracted(); 3010 - int interfaceId = buffer.getShortUnsingedAdded(); 3009 + int sidebarIcon = buffer.getUnsignedPreNegativeOffsetByte(); 3010 + int interfaceId = buffer.getUnsignedNegativeOffsetShortBE(); 3011 3011 if (interfaceId == 65535) 3012 3012 interfaceId = -1; 3013 3013 if (tabInterfaceIDs[sidebarIcon] != interfaceId) { ··· 3020 3020 return true; 3021 3021 } 3022 3022 if (opcode == 219) { // reset all items on interface? 3023 - int interfaceId = buffer.getUnsignedLEShort(); 3023 + int interfaceId = buffer.getUnsignedShortLE(); 3024 3024 Widget class13_2 = Widget.forId(interfaceId); 3025 3025 for (int k21 = 0; k21 < class13_2.items.length; k21++) { 3026 3026 class13_2.items[k21] = -1; ··· 3052 3052 } 3053 3053 if (opcode == 126) { 3054 3054 playerMembers = buffer.getUnsignedByte(); 3055 - thisPlayerServerId = buffer.getUnsignedLEShort(); 3055 + thisPlayerServerId = buffer.getUnsignedShortLE(); 3056 3056 opcode = -1; 3057 3057 return true; 3058 3058 } 3059 3059 if (opcode == 75) { 3060 - placementX = buffer.getByteNegated(); 3061 - placementY = buffer.getByteAdded(); 3060 + placementX = buffer.getUnsignedInvertedByte(); 3061 + placementY = buffer.getUnsignedPostNegativeOffsetByte(); 3062 3062 opcode = -1; 3063 3063 return true; 3064 3064 } 3065 3065 if (opcode == 253) { // open fullscreen interface 3066 - int k9 = buffer.getUnsignedLEShort(); 3067 - int k15 = buffer.getShortUnsingedAdded(); 3066 + int k9 = buffer.getUnsignedShortLE(); 3067 + int k15 = buffer.getUnsignedNegativeOffsetShortBE(); 3068 3068 method112((byte) 36, k15); 3069 3069 if (k9 != -1) 3070 3070 method112((byte) 36, k9); ··· 3100 3100 return true; 3101 3101 } 3102 3102 if (opcode == 18) { 3103 - int l9 = buffer.getUnsignedShort(); 3104 - int interfaceId = buffer.getShortUnsingedAdded(); 3105 - int l21 = buffer.getUnsignedLEShort(); 3103 + int l9 = buffer.getUnsignedShortBE(); 3104 + int interfaceId = buffer.getUnsignedNegativeOffsetShortBE(); 3105 + int l21 = buffer.getUnsignedShortLE(); 3106 3106 Widget.forId(interfaceId).anInt218 = (l9 << 16) + l21; 3107 3107 opcode = -1; 3108 3108 return true; ··· 3125 3125 return true; 3126 3126 } 3127 3127 if (opcode == 232) { // update interface string? 3128 - int j10 = buffer.getLittleShortA(); 3128 + int j10 = buffer.getUnsignedNegativeOffsetShortLE(); 3129 3129 String s6 = buffer.getString(); 3130 3130 Widget.forId(j10).disabledText = s6; 3131 3131 if (Widget.forId(j10).parentId == tabInterfaceIDs[currentTabId]) ··· 3134 3134 return true; 3135 3135 } 3136 3136 if (opcode == 200) { 3137 - int interfaceId = buffer.getUnsignedShort(); 3138 - int scrollPosition = buffer.getLittleShortA(); 3137 + int interfaceId = buffer.getUnsignedShortBE(); 3138 + int scrollPosition = buffer.getUnsignedNegativeOffsetShortLE(); 3139 3139 Widget widget = Widget.forId(interfaceId); 3140 3140 if (widget != null && widget.type == 0) { 3141 3141 if (scrollPosition < 0) ··· 3374 3374 outBuffer.putOpcode(247); 3375 3375 outBuffer.putByte(j4 + j4 + 3); 3376 3376 } 3377 - outBuffer.putLEShortAdded(l5 + nextTopLeftTileX); 3377 + outBuffer.putOffsetShortLE(l5 + nextTopLeftTileX); 3378 3378 outBuffer.putByte(super.keyStatus[5] != 1 ? 0 : 1); 3379 - outBuffer.putLEShortAdded(j6 + nextTopRightTileY); 3379 + outBuffer.putOffsetShortLE(j6 + nextTopRightTileY); 3380 3380 destinationX = anIntArray1123[0]; 3381 3381 destinationY = anIntArray1124[0]; 3382 3382 for (int l6 = 1; l6 < j4; l6++) { 3383 3383 l3--; 3384 3384 outBuffer.putByte(anIntArray1123[l3] - l5); 3385 - outBuffer.putByteSubtracted(anIntArray1124[l3] - j6); 3385 + outBuffer.putNegativeOffsetByte(anIntArray1124[l3] - j6); 3386 3386 } 3387 3387 3388 3388 return true; ··· 3553 3553 if (anInt1160 > 161) { 3554 3554 anInt1160 = 0; 3555 3555 outBuffer.putOpcode(22); 3556 - outBuffer.putShort(38304); 3556 + outBuffer.putShortBE(38304); 3557 3557 } 3558 3558 } 3559 3559 } ··· 4136 4136 } 4137 4137 4138 4138 outBuffer.putOpcode(141); 4139 - outBuffer.putLong(l); 4139 + outBuffer.putLongBE(l); 4140 4140 break; 4141 4141 } 4142 4142 ··· 4433 4433 closeWidgets(); 4434 4434 if (reportedName.length() > 0) { 4435 4435 outBuffer.putOpcode(184); 4436 - outBuffer.putLong(TextUtils.nameToLong(reportedName)); 4436 + outBuffer.putLongBE(TextUtils.nameToLong(reportedName)); 4437 4437 outBuffer.putByte(type - 601); 4438 4438 outBuffer.putByte(reportMutePlayer ? 1 : 0); 4439 4439 } ··· 4480 4480 4481 4481 Buffer buffer = new Buffer(bytes); 4482 4482 buffer.currentPosition = 3; 4483 - int archiveLength = buffer.get24BitInt() + 6; 4483 + int archiveLength = buffer.getMediumBE() + 6; 4484 4484 int archiveRead = 6; 4485 4485 archiveBuffer = new byte[archiveLength]; 4486 4486 ··· 4592 4592 Npc class50_sub1_sub4_sub3_sub1 = npcs[l]; 4593 4593 int i1 = class50_sub1_sub2.getUnsignedByte(); 4594 4594 if ((i1 & 1) != 0) { 4595 - class50_sub1_sub4_sub3_sub1.npcDefinition = ActorDefinition.getDefinition(class50_sub1_sub2.getShortUnsingedAdded()); 4595 + class50_sub1_sub4_sub3_sub1.npcDefinition = ActorDefinition.getDefinition(class50_sub1_sub2.getUnsignedNegativeOffsetShortBE()); 4596 4596 class50_sub1_sub4_sub3_sub1.boundaryDimension = class50_sub1_sub4_sub3_sub1.npcDefinition.boundaryDimension; 4597 4597 class50_sub1_sub4_sub3_sub1.anInt1600 = class50_sub1_sub4_sub3_sub1.npcDefinition.degreesToTurn; 4598 4598 class50_sub1_sub4_sub3_sub1.walkAnimationId = class50_sub1_sub4_sub3_sub1.npcDefinition.walkAnimationId; ··· 4602 4602 class50_sub1_sub4_sub3_sub1.idleAnimation = class50_sub1_sub4_sub3_sub1.npcDefinition.standAnimationId; 4603 4603 } 4604 4604 if ((i1 & 0x40) != 0) { 4605 - class50_sub1_sub4_sub3_sub1.anInt1609 = class50_sub1_sub2.getUnsignedLEShort(); 4605 + class50_sub1_sub4_sub3_sub1.anInt1609 = class50_sub1_sub2.getUnsignedShortLE(); 4606 4606 if (class50_sub1_sub4_sub3_sub1.anInt1609 == 65535) 4607 4607 class50_sub1_sub4_sub3_sub1.anInt1609 = -1; 4608 4608 } 4609 4609 if ((i1 & 0x80) != 0) { 4610 - int j1 = class50_sub1_sub2.getByteAdded(); 4611 - int j2 = class50_sub1_sub2.getByteAdded(); 4610 + int j1 = class50_sub1_sub2.getUnsignedPostNegativeOffsetByte(); 4611 + int j2 = class50_sub1_sub2.getUnsignedPostNegativeOffsetByte(); 4612 4612 class50_sub1_sub4_sub3_sub1.updateHits(j2, j1, pulseCycle); 4613 4613 class50_sub1_sub4_sub3_sub1.endCycle = pulseCycle + 300; 4614 4614 class50_sub1_sub4_sub3_sub1.anInt1596 = class50_sub1_sub2.getUnsignedByte(); 4615 - class50_sub1_sub4_sub3_sub1.anInt1597 = class50_sub1_sub2.getByteSubtracted(); 4615 + class50_sub1_sub4_sub3_sub1.anInt1597 = class50_sub1_sub2.getUnsignedPreNegativeOffsetByte(); 4616 4616 } 4617 4617 if ((i1 & 4) != 0) { 4618 - class50_sub1_sub4_sub3_sub1.graphic = class50_sub1_sub2.getUnsignedShort(); 4619 - int k1 = class50_sub1_sub2.method556(); 4618 + class50_sub1_sub4_sub3_sub1.graphic = class50_sub1_sub2.getUnsignedShortBE(); 4619 + int k1 = class50_sub1_sub2.getIntME1(); 4620 4620 class50_sub1_sub4_sub3_sub1.spotAnimationDelay = k1 >> 16; 4621 4621 class50_sub1_sub4_sub3_sub1.anInt1617 = pulseCycle + (k1 & 0xffff); 4622 4622 class50_sub1_sub4_sub3_sub1.currentAnimation = 0; ··· 4631 4631 class50_sub1_sub4_sub3_sub1.textCycle = 100; 4632 4632 } 4633 4633 if ((i1 & 8) != 0) { 4634 - class50_sub1_sub4_sub3_sub1.anInt1598 = class50_sub1_sub2.getLittleShortA(); 4635 - class50_sub1_sub4_sub3_sub1.anInt1599 = class50_sub1_sub2.getUnsignedLEShort(); 4634 + class50_sub1_sub4_sub3_sub1.anInt1598 = class50_sub1_sub2.getUnsignedNegativeOffsetShortLE(); 4635 + class50_sub1_sub4_sub3_sub1.anInt1599 = class50_sub1_sub2.getUnsignedShortLE(); 4636 4636 } 4637 4637 if ((i1 & 2) != 0) { 4638 - int l1 = class50_sub1_sub2.getUnsignedShort(); 4638 + int l1 = class50_sub1_sub2.getUnsignedShortBE(); 4639 4639 if (l1 == 65535) 4640 4640 l1 = -1; 4641 - int k2 = class50_sub1_sub2.getByteSubtracted(); 4641 + int k2 = class50_sub1_sub2.getUnsignedPreNegativeOffsetByte(); 4642 4642 if (l1 == class50_sub1_sub4_sub3_sub1.emoteAnimation && l1 != -1) { 4643 4643 int i3 = AnimationSequence.animations[l1].anInt307; 4644 4644 if (i3 == 1) { ··· 4661 4661 } 4662 4662 } 4663 4663 if ((i1 & 0x10) != 0) { 4664 - int i2 = class50_sub1_sub2.getByteSubtracted(); 4665 - int l2 = class50_sub1_sub2.getByteSubtracted(); 4664 + int i2 = class50_sub1_sub2.getUnsignedPreNegativeOffsetByte(); 4665 + int l2 = class50_sub1_sub2.getUnsignedPreNegativeOffsetByte(); 4666 4666 class50_sub1_sub4_sub3_sub1.updateHits(l2, i2, pulseCycle); 4667 4667 class50_sub1_sub4_sub3_sub1.endCycle = pulseCycle + 300; 4668 4668 class50_sub1_sub4_sub3_sub1.anInt1596 = class50_sub1_sub2.getUnsignedByte(); 4669 - class50_sub1_sub4_sub3_sub1.anInt1597 = class50_sub1_sub2.getByteNegated(); 4669 + class50_sub1_sub4_sub3_sub1.anInt1597 = class50_sub1_sub2.getUnsignedInvertedByte(); 4670 4670 } 4671 4671 } 4672 4672 ··· 4674 4674 4675 4675 private void parsePlayerBlock(int id, Player player, int mask, Buffer buffer) { 4676 4676 if ((mask & 8) != 0) { 4677 - int animation = buffer.getUnsignedShort(); 4677 + int animation = buffer.getUnsignedShortBE(); 4678 4678 4679 4679 if (animation == 65535) 4680 4680 animation = -1; 4681 4681 4682 - int delay = buffer.getByteSubtracted(); 4682 + int delay = buffer.getUnsignedPreNegativeOffsetByte(); 4683 4683 4684 4684 if (animation == player.emoteAnimation && animation != -1) { 4685 4685 int mode = AnimationSequence.animations[animation].anInt307; ··· 4720 4720 } 4721 4721 4722 4722 if ((mask & 0x100) != 0) { 4723 - player.anInt1602 = buffer.getByteAdded(); 4724 - player.anInt1604 = buffer.getByteNegated(); 4725 - player.anInt1603 = buffer.getByteSubtracted(); 4723 + player.anInt1602 = buffer.getUnsignedPostNegativeOffsetByte(); 4724 + player.anInt1604 = buffer.getUnsignedInvertedByte(); 4725 + player.anInt1603 = buffer.getUnsignedPreNegativeOffsetByte(); 4726 4726 player.anInt1605 = buffer.getUnsignedByte(); 4727 - player.anInt1606 = buffer.getUnsignedShort() + pulseCycle; 4728 - player.anInt1607 = buffer.getShortUnsingedAdded() + pulseCycle; 4727 + player.anInt1606 = buffer.getUnsignedShortBE() + pulseCycle; 4728 + player.anInt1607 = buffer.getUnsignedNegativeOffsetShortBE() + pulseCycle; 4729 4729 player.anInt1608 = buffer.getUnsignedByte(); 4730 4730 4731 4731 player.resetPath(); 4732 4732 } 4733 4733 4734 4734 if ((mask & 1) != 0) { 4735 - player.anInt1609 = buffer.getShortUnsingedAdded(); 4735 + player.anInt1609 = buffer.getUnsignedNegativeOffsetShortBE(); 4736 4736 4737 4737 if (player.anInt1609 == 65535) 4738 4738 player.anInt1609 = -1; 4739 4739 } 4740 4740 4741 4741 if ((mask & 2) != 0) { 4742 - player.anInt1598 = buffer.getUnsignedShort(); 4743 - player.anInt1599 = buffer.getUnsignedShort(); 4742 + player.anInt1598 = buffer.getUnsignedShortBE(); 4743 + player.anInt1599 = buffer.getUnsignedShortBE(); 4744 4744 } 4745 4745 4746 4746 if ((mask & 0x200) != 0) { 4747 - player.graphic = buffer.getShortUnsingedAdded(); 4748 - int heightAndDelay = buffer.method556(); 4747 + player.graphic = buffer.getUnsignedNegativeOffsetShortBE(); 4748 + int heightAndDelay = buffer.getIntME1(); 4749 4749 player.spotAnimationDelay = heightAndDelay >> 16; 4750 4750 player.anInt1617 = pulseCycle + (heightAndDelay & 0xffff); 4751 4751 player.currentAnimation = 0; ··· 4771 4771 } 4772 4772 4773 4773 if ((mask & 0x400) != 0) { 4774 - int damage = buffer.getByteAdded(); 4775 - int type = buffer.getByteSubtracted(); 4774 + int damage = buffer.getUnsignedPostNegativeOffsetByte(); 4775 + int type = buffer.getUnsignedPreNegativeOffsetByte(); 4776 4776 4777 4777 player.updateHits(type, damage, pulseCycle); 4778 4778 4779 4779 player.endCycle = pulseCycle + 300; 4780 - player.anInt1596 = buffer.getByteNegated(); 4780 + player.anInt1596 = buffer.getUnsignedInvertedByte(); 4781 4781 player.anInt1597 = buffer.getUnsignedByte(); 4782 4782 } 4783 4783 4784 4784 if ((mask & 0x40) != 0) { 4785 - int effectsAndColour = buffer.getUnsignedShort(); 4786 - int rights = buffer.getByteNegated(); 4787 - int length = buffer.getByteAdded(); 4785 + int effectsAndColour = buffer.getUnsignedShortBE(); 4786 + int rights = buffer.getUnsignedInvertedByte(); 4787 + int length = buffer.getUnsignedPostNegativeOffsetByte(); 4788 4788 int currentPosition = buffer.currentPosition; 4789 4789 4790 4790 if (player.playerName != null && player.visible) { ··· 4831 4831 } 4832 4832 4833 4833 if ((mask & 0x80) != 0) { 4834 - int damage = buffer.getByteSubtracted(); 4835 - int type = buffer.getByteNegated(); 4834 + int damage = buffer.getUnsignedPreNegativeOffsetByte(); 4835 + int type = buffer.getUnsignedInvertedByte(); 4836 4836 4837 4837 player.updateHits(type, damage, pulseCycle); 4838 4838 4839 4839 player.endCycle = pulseCycle + 300; 4840 - player.anInt1596 = buffer.getByteSubtracted(); 4840 + player.anInt1596 = buffer.getUnsignedPreNegativeOffsetByte(); 4841 4841 player.anInt1597 = buffer.getUnsignedByte(); 4842 4842 } 4843 4843 } ··· 6323 6323 gameConnection.read(buffer.buffer, 0, 8); 6324 6324 6325 6325 buffer.currentPosition = 0; 6326 - serverSeed = buffer.getLong(); 6326 + serverSeed = buffer.getLongBE(); 6327 6327 int seed[] = new int[4]; 6328 6328 6329 6329 seed[0] = (int) (Math.random() * 99999999D); ··· 6334 6334 outBuffer.currentPosition = 0; 6335 6335 6336 6336 outBuffer.putByte(10); 6337 - outBuffer.putInt(seed[0]); 6338 - outBuffer.putInt(seed[1]); 6339 - outBuffer.putInt(seed[2]); 6340 - outBuffer.putInt(seed[3]); 6341 - outBuffer.putInt(SignLink.uid); 6337 + outBuffer.putIntBE(seed[0]); 6338 + outBuffer.putIntBE(seed[1]); 6339 + outBuffer.putIntBE(seed[2]); 6340 + outBuffer.putIntBE(seed[3]); 6341 + outBuffer.putIntBE(SignLink.uid); 6342 6342 outBuffer.putString(username); 6343 6343 outBuffer.putString(password); 6344 6344 ··· 6354 6354 6355 6355 tempBuffer.putByte(outBuffer.currentPosition + 36 + 1 + 1 + 2); 6356 6356 tempBuffer.putByte(255); 6357 - tempBuffer.putShort(SignLink.CLIENT_REVISION); 6357 + tempBuffer.putShortBE(SignLink.CLIENT_REVISION); 6358 6358 tempBuffer.putByte(lowMemory ? 1 : 0); 6359 6359 6360 6360 for (int i = 0; i < 9; i++) 6361 - tempBuffer.putInt(archiveHashes[i]); 6361 + tempBuffer.putIntBE(archiveHashes[i]); 6362 6362 6363 6363 tempBuffer.putBytes(outBuffer.buffer, 0, outBuffer.currentPosition); 6364 6364 ··· 7162 7162 stream.close(); 7163 7163 7164 7164 for (int i = 0; i < 9; i++) 7165 - archiveHashes[i] = jaggrab.getInt(); 7165 + archiveHashes[i] = jaggrab.getIntBE(); 7166 7166 7167 - int expectedCrc = jaggrab.getInt(); 7167 + int expectedCrc = jaggrab.getIntBE(); 7168 7168 int calculatedCrc = 1234; 7169 7169 7170 7170 for (int i = 0; i < 9; i++) ··· 7674 7674 GameObjectDefinition.modelCache.removeAll(); 7675 7675 if (super.gameFrame != null) { 7676 7676 outBuffer.putOpcode(78); 7677 - outBuffer.putInt(0x3f008edd); 7677 + outBuffer.putIntBE(0x3f008edd); 7678 7678 } 7679 7679 if (lowMemory && SignLink.cacheData != null) { 7680 7680 int k = onDemandRequester.fileCount(0); ··· 7809 7809 ignores[j] = ignores[j + 1]; 7810 7810 7811 7811 outBuffer.putOpcode(160); 7812 - outBuffer.putLong(l); 7812 + outBuffer.putLongBE(l); 7813 7813 break; 7814 7814 } 7815 7815 ··· 8472 8472 if (anInt895 > 112) { 8473 8473 anInt895 = 0; 8474 8474 outBuffer.putOpcode(197); 8475 - outBuffer.putInt(0); 8475 + outBuffer.putIntBE(0); 8476 8476 } 8477 8477 } 8478 8478 } ··· 8746 8746 if (anInt1082 > 177) { 8747 8747 anInt1082 = 0; 8748 8748 outBuffer.putOpcode(173); 8749 - outBuffer.putTriByte(0x288b80); 8749 + outBuffer.putMediumBE(0x288b80); 8750 8750 } 8751 8751 minimapHintCount = 0; 8752 8752 for (int viewportX = 0; viewportX < 104; viewportX++) { ··· 8807 8807 outBuffer.putByte(0); 8808 8808 int j = outBuffer.currentPosition; 8809 8809 outBuffer.putByte(219); 8810 - outBuffer.putShort(37745); 8810 + outBuffer.putShortBE(37745); 8811 8811 outBuffer.putByte(61); 8812 - outBuffer.putShort(43756); 8813 - outBuffer.putShort((int) (Math.random() * 65536D)); 8812 + outBuffer.putShortBE(43756); 8813 + outBuffer.putShortBE((int) (Math.random() * 65536D)); 8814 8814 outBuffer.putByte((int) (Math.random() * 256D)); 8815 - outBuffer.putShort(51171); 8815 + outBuffer.putShortBE(51171); 8816 8816 if ((int) (Math.random() * 2D) == 0) 8817 - outBuffer.putShort(15808); 8817 + outBuffer.putShortBE(15808); 8818 8818 outBuffer.putByte(97); 8819 8819 outBuffer.putByte((int) (Math.random() * 256D)); 8820 8820 outBuffer.putLength(outBuffer.currentPosition - j); ··· 8982 8982 crossType = 2; 8983 8983 crossIndex = 0; 8984 8984 outBuffer.putOpcode(245); 8985 - outBuffer.putLEShortAdded(clicked); 8985 + outBuffer.putOffsetShortLE(clicked); 8986 8986 } 8987 8987 } 8988 8988 if (action == 227) { ··· 8993 8993 anInt1165 = 0; 8994 8994 } 8995 8995 outBuffer.putOpcode(228); 8996 - outBuffer.putLEShortDup(first); 8997 - outBuffer.putShortAdded(clicked); 8998 - outBuffer.putShort(second); 8996 + outBuffer.putShortLE(first); 8997 + outBuffer.putOffsetShortBE(clicked); 8998 + outBuffer.putShortBE(second); 8999 8999 atInventoryLoopCycle = 0; 9000 9000 anInt1330 = second; 9001 9001 anInt1331 = first; ··· 9017 9017 crossType = 2; 9018 9018 crossIndex = 0; 9019 9019 outBuffer.putOpcode(45); 9020 - outBuffer.putShortAdded(clicked); 9020 + outBuffer.putOffsetShortBE(clicked); 9021 9021 } 9022 9022 } 9023 9023 if (action == 921) { ··· 9032 9032 crossType = 2; 9033 9033 crossIndex = 0; 9034 9034 outBuffer.putOpcode(67); 9035 - outBuffer.putShortAdded(clicked); 9035 + outBuffer.putOffsetShortBE(clicked); 9036 9036 } 9037 9037 } 9038 9038 if (action == 961) { ··· 9043 9043 anInt1139 = 0; 9044 9044 } 9045 9045 outBuffer.putOpcode(203); 9046 - outBuffer.putShortAdded(second); 9047 - outBuffer.putLEShortDup(first); 9048 - outBuffer.putLEShortDup(clicked); 9046 + outBuffer.putOffsetShortBE(second); 9047 + outBuffer.putShortLE(first); 9048 + outBuffer.putShortLE(clicked); 9049 9049 atInventoryLoopCycle = 0; 9050 9050 anInt1330 = second; 9051 9051 anInt1331 = first; ··· 9057 9057 } 9058 9058 if (action == 467 && method80(second, 0, first, clicked)) { 9059 9059 outBuffer.putOpcode(152); 9060 - outBuffer.putLEShortDup(clicked >> 14 & 0x7fff); 9061 - outBuffer.putLEShortDup(anInt1148); 9062 - outBuffer.putLEShortDup(anInt1149); 9063 - outBuffer.putLEShortDup(second + nextTopRightTileY); 9064 - outBuffer.putShort(anInt1147); 9065 - outBuffer.putLEShortAdded(first + nextTopLeftTileX); 9060 + outBuffer.putShortLE(clicked >> 14 & 0x7fff); 9061 + outBuffer.putShortLE(anInt1148); 9062 + outBuffer.putShortLE(anInt1149); 9063 + outBuffer.putShortLE(second + nextTopRightTileY); 9064 + outBuffer.putShortBE(anInt1147); 9065 + outBuffer.putOffsetShortLE(first + nextTopLeftTileX); 9066 9066 } 9067 9067 if (action == 9) { 9068 9068 outBuffer.putOpcode(3); 9069 - outBuffer.putShortAdded(clicked); 9070 - outBuffer.putShort(second); 9071 - outBuffer.putShort(first); 9069 + outBuffer.putOffsetShortBE(clicked); 9070 + outBuffer.putShortBE(second); 9071 + outBuffer.putShortBE(first); 9072 9072 atInventoryLoopCycle = 0; 9073 9073 anInt1330 = second; 9074 9074 anInt1331 = first; ··· 9090 9090 crossType = 2; 9091 9091 crossIndex = 0; 9092 9092 outBuffer.putOpcode(42); 9093 - outBuffer.putLEShortDup(clicked); 9093 + outBuffer.putShortLE(clicked); 9094 9094 } 9095 9095 } 9096 9096 if (action == 677) { ··· 9105 9105 crossType = 2; 9106 9106 crossIndex = 0; 9107 9107 outBuffer.putOpcode(116); 9108 - outBuffer.putLEShortDup(clicked); 9108 + outBuffer.putShortLE(clicked); 9109 9109 } 9110 9110 } 9111 9111 if (action == Actions.ADD_FRIEND || ··· 9137 9137 crossType = 2; 9138 9138 crossIndex = 0; 9139 9139 outBuffer.putOpcode(54); 9140 - outBuffer.putShortAdded(clicked); 9141 - outBuffer.putLEShortDup(second + nextTopRightTileY); 9142 - outBuffer.putShort(first + nextTopLeftTileX); 9140 + outBuffer.putOffsetShortBE(clicked); 9141 + outBuffer.putShortLE(second + nextTopRightTileY); 9142 + outBuffer.putShortBE(first + nextTopLeftTileX); 9143 9143 } 9144 9144 if (action == 399) { 9145 9145 outBuffer.putOpcode(24); 9146 - outBuffer.putLEShortDup(second); 9147 - outBuffer.putLEShortDup(clicked); 9148 - outBuffer.putShortAdded(first); 9146 + outBuffer.putShortLE(second); 9147 + outBuffer.putShortLE(clicked); 9148 + outBuffer.putOffsetShortBE(first); 9149 9149 atInventoryLoopCycle = 0; 9150 9150 anInt1330 = second; 9151 9151 anInt1331 = first; ··· 9167 9167 crossType = 2; 9168 9168 crossIndex = 0; 9169 9169 outBuffer.putOpcode(57); 9170 - outBuffer.putShort(clicked); 9171 - outBuffer.putLEShortDup(anInt1149); 9172 - outBuffer.putLEShortAdded(anInt1148); 9173 - outBuffer.putShort(anInt1147); 9170 + outBuffer.putShortBE(clicked); 9171 + outBuffer.putShortLE(anInt1149); 9172 + outBuffer.putOffsetShortLE(anInt1148); 9173 + outBuffer.putShortBE(anInt1147); 9174 9174 } 9175 9175 } 9176 9176 if (action == Actions.TOGGLE_SETTING_WIDGET) { 9177 9177 outBuffer.putOpcode(79); 9178 - outBuffer.putShort(second); 9178 + outBuffer.putShortBE(second); 9179 9179 Widget widget = Widget.forId(second); 9180 9180 if (widget.cs1opcodes != null && widget.cs1opcodes[0][0] == 5) { 9181 9181 int setting = widget.cs1opcodes[0][1]; ··· 9196 9196 crossType = 2; 9197 9197 crossIndex = 0; 9198 9198 outBuffer.putOpcode(233); 9199 - outBuffer.putShortAdded(clicked); 9199 + outBuffer.putOffsetShortBE(clicked); 9200 9200 } 9201 9201 } 9202 9202 if (action == 14) ··· 9206 9206 currentScene.method279(0, first - 4, second - 4); 9207 9207 if (action == 903) { 9208 9208 outBuffer.putOpcode(1); 9209 - outBuffer.putShort(clicked); 9210 - outBuffer.putLEShortDup(anInt1147); 9211 - outBuffer.putLEShortDup(anInt1149); 9212 - outBuffer.putLEShortAdded(anInt1148); 9213 - outBuffer.putShortAdded(first); 9214 - outBuffer.putShortAdded(second); 9209 + outBuffer.putShortBE(clicked); 9210 + outBuffer.putShortLE(anInt1147); 9211 + outBuffer.putShortLE(anInt1149); 9212 + outBuffer.putOffsetShortLE(anInt1148); 9213 + outBuffer.putOffsetShortBE(first); 9214 + outBuffer.putOffsetShortBE(second); 9215 9215 atInventoryLoopCycle = 0; 9216 9216 anInt1330 = second; 9217 9217 anInt1331 = first; ··· 9223 9223 } 9224 9224 if (action == 361) { 9225 9225 outBuffer.putOpcode(36); 9226 - outBuffer.putShort(anInt1172); 9227 - outBuffer.putShortAdded(second); 9228 - outBuffer.putShortAdded(first); 9229 - outBuffer.putShortAdded(clicked); 9226 + outBuffer.putShortBE(anInt1172); 9227 + outBuffer.putOffsetShortBE(second); 9228 + outBuffer.putOffsetShortBE(first); 9229 + outBuffer.putOffsetShortBE(clicked); 9230 9230 atInventoryLoopCycle = 0; 9231 9231 anInt1330 = second; 9232 9232 anInt1331 = first; ··· 9250 9250 anInt1235 += clicked; 9251 9251 if (anInt1235 >= 143) { 9252 9252 outBuffer.putOpcode(157); 9253 - outBuffer.putInt(0); 9253 + outBuffer.putIntBE(0); 9254 9254 anInt1235 = 0; 9255 9255 } 9256 9256 outBuffer.putOpcode(13); 9257 - outBuffer.putLEShortAdded(clicked); 9257 + outBuffer.putOffsetShortLE(clicked); 9258 9258 } 9259 9259 } 9260 9260 if (action == 376 && method80(second, 0, first, clicked)) { 9261 9261 outBuffer.putOpcode(210); 9262 - outBuffer.putShort(anInt1172); 9263 - outBuffer.putLEShortDup(clicked >> 14 & 0x7fff); 9264 - outBuffer.putShortAdded(first + nextTopLeftTileX); 9265 - outBuffer.putLEShortDup(second + nextTopRightTileY); 9262 + outBuffer.putShortBE(anInt1172); 9263 + outBuffer.putShortLE(clicked >> 14 & 0x7fff); 9264 + outBuffer.putOffsetShortBE(first + nextTopLeftTileX); 9265 + outBuffer.putShortLE(second + nextTopRightTileY); 9266 9266 } 9267 9267 if (action == 432) { 9268 9268 Npc class50_sub1_sub4_sub3_sub1_4 = npcs[clicked]; ··· 9276 9276 crossType = 2; 9277 9277 crossIndex = 0; 9278 9278 outBuffer.putOpcode(8); 9279 - outBuffer.putLEShortDup(clicked); 9279 + outBuffer.putShortLE(clicked); 9280 9280 } 9281 9281 } 9282 9282 if (action == Actions.CLOSE_WIDGETS) ··· 9293 9293 crossType = 2; 9294 9294 crossIndex = 0; 9295 9295 outBuffer.putOpcode(31); 9296 - outBuffer.putShort(clicked); 9297 - outBuffer.putLEShortDup(anInt1172); 9296 + outBuffer.putShortBE(clicked); 9297 + outBuffer.putShortLE(anInt1172); 9298 9298 } 9299 9299 } 9300 9300 if (action == 67) { ··· 9309 9309 crossType = 2; 9310 9310 crossIndex = 0; 9311 9311 outBuffer.putOpcode(104); 9312 - outBuffer.putShortAdded(anInt1172); 9313 - outBuffer.putLEShortDup(clicked); 9312 + outBuffer.putOffsetShortBE(anInt1172); 9313 + outBuffer.putShortLE(clicked); 9314 9314 } 9315 9315 } 9316 9316 if (action == 68) { ··· 9324 9324 crossType = 2; 9325 9325 crossIndex = 0; 9326 9326 outBuffer.putOpcode(77); 9327 - outBuffer.putShortAdded(first + nextTopLeftTileX); 9328 - outBuffer.putShort(second + nextTopRightTileY); 9329 - outBuffer.putLEShortAdded(clicked); 9327 + outBuffer.putOffsetShortBE(first + nextTopLeftTileX); 9328 + outBuffer.putShortBE(second + nextTopRightTileY); 9329 + outBuffer.putOffsetShortLE(clicked); 9330 9330 } 9331 9331 if (action == 684) { 9332 9332 boolean flag2 = walk(false, false, second, localPlayer.pathY[0], 0, 0, 2, 0, first, 0, 0, ··· 9342 9342 anInt1052++; 9343 9343 if (anInt1052 >= 84) { 9344 9344 outBuffer.putOpcode(222); 9345 - outBuffer.putTriByte(0xabc842); 9345 + outBuffer.putMediumBE(0xabc842); 9346 9346 anInt1052 = 0; 9347 9347 } 9348 9348 outBuffer.putOpcode(71); 9349 - outBuffer.putLEShortAdded(clicked); 9350 - outBuffer.putLEShortAdded(first + nextTopLeftTileX); 9351 - outBuffer.putShortAdded(second + nextTopRightTileY); 9349 + outBuffer.putOffsetShortLE(clicked); 9350 + outBuffer.putOffsetShortLE(first + nextTopLeftTileX); 9351 + outBuffer.putOffsetShortBE(second + nextTopRightTileY); 9352 9352 } 9353 9353 if (action == Actions.ACCEPT_TRADE || action == Actions.ACCEPT_CHALLENGE) { 9354 9354 String name = menuActionTexts[id]; ··· 9368 9368 localPlayer.pathX[0]); 9369 9369 if (action == Actions.ACCEPT_TRADE) { 9370 9370 outBuffer.putOpcode(116); 9371 - outBuffer.putLEShortDup(playerList[index]); 9371 + outBuffer.putShortLE(playerList[index]); 9372 9372 } 9373 9373 if (action == Actions.ACCEPT_CHALLENGE) { 9374 9374 outBuffer.putOpcode(245); 9375 - outBuffer.putLEShortAdded(playerList[index]); 9375 + outBuffer.putOffsetShortLE(playerList[index]); 9376 9376 } 9377 9377 found = true; 9378 9378 break; ··· 9384 9384 } 9385 9385 if (action == 225) { 9386 9386 outBuffer.putOpcode(177); // second item action 9387 - outBuffer.putShortAdded(first); 9388 - outBuffer.putLEShortDup(clicked); 9389 - outBuffer.putLEShortDup(second); 9387 + outBuffer.putOffsetShortBE(first); 9388 + outBuffer.putShortLE(clicked); 9389 + outBuffer.putShortLE(second); 9390 9390 atInventoryLoopCycle = 0; 9391 9391 anInt1330 = second; 9392 9392 anInt1331 = first; ··· 9419 9419 } 9420 9420 if (action == 891) { 9421 9421 outBuffer.putOpcode(4); 9422 - outBuffer.putLEShortDup(first); 9423 - outBuffer.putLEShortAdded(clicked); 9424 - outBuffer.putLEShortAdded(second); 9422 + outBuffer.putShortLE(first); 9423 + outBuffer.putOffsetShortLE(clicked); 9424 + outBuffer.putOffsetShortLE(second); 9425 9425 atInventoryLoopCycle = 0; 9426 9426 anInt1330 = second; 9427 9427 anInt1331 = first; ··· 9433 9433 } 9434 9434 if (action == 894) { 9435 9435 outBuffer.putOpcode(158); // fifth item action event 9436 - outBuffer.putLEShortAdded(first); 9437 - outBuffer.putLEShortAdded(clicked); 9438 - outBuffer.putLEShortDup(second); 9436 + outBuffer.putOffsetShortLE(first); 9437 + outBuffer.putOffsetShortLE(clicked); 9438 + outBuffer.putShortLE(second); 9439 9439 atInventoryLoopCycle = 0; 9440 9440 anInt1330 = second; 9441 9441 anInt1331 = first; ··· 9448 9448 if (action == 1280) { 9449 9449 method80(second, 0, first, clicked); 9450 9450 outBuffer.putOpcode(55); 9451 - outBuffer.putLEShortDup(clicked >> 14 & 0x7fff); 9452 - outBuffer.putLEShortDup(second + nextTopRightTileY); 9453 - outBuffer.putShort(first + nextTopLeftTileX); 9451 + outBuffer.putShortLE(clicked >> 14 & 0x7fff); 9452 + outBuffer.putShortLE(second + nextTopRightTileY); 9453 + outBuffer.putShortBE(first + nextTopLeftTileX); 9454 9454 } 9455 9455 if (action == 35) { 9456 9456 method80(second, 0, first, clicked); 9457 9457 outBuffer.putOpcode(181); 9458 - outBuffer.putShortAdded(first + nextTopLeftTileX); 9459 - outBuffer.putLEShortDup(second + nextTopRightTileY); 9460 - outBuffer.putLEShortDup(clicked >> 14 & 0x7fff); 9458 + outBuffer.putOffsetShortBE(first + nextTopLeftTileX); 9459 + outBuffer.putShortLE(second + nextTopRightTileY); 9460 + outBuffer.putShortLE(clicked >> 14 & 0x7fff); 9461 9461 } 9462 9462 if (action == 888) { 9463 9463 method80(second, 0, first, clicked); 9464 9464 outBuffer.putOpcode(50); 9465 - outBuffer.putShortAdded(second + nextTopRightTileY); 9466 - outBuffer.putLEShortDup(clicked >> 14 & 0x7fff); 9467 - outBuffer.putLEShortAdded(first + nextTopLeftTileX); 9465 + outBuffer.putOffsetShortBE(second + nextTopRightTileY); 9466 + outBuffer.putShortLE(clicked >> 14 & 0x7fff); 9467 + outBuffer.putOffsetShortLE(first + nextTopLeftTileX); 9468 9468 } 9469 9469 if (action == 324) { 9470 9470 outBuffer.putOpcode(161); 9471 - outBuffer.putLEShortAdded(first); 9472 - outBuffer.putLEShortAdded(clicked); 9473 - outBuffer.putLEShortDup(second); 9471 + outBuffer.putOffsetShortLE(first); 9472 + outBuffer.putOffsetShortLE(clicked); 9473 + outBuffer.putShortLE(second); 9474 9474 atInventoryLoopCycle = 0; 9475 9475 anInt1330 = second; 9476 9476 anInt1331 = first; ··· 9499 9499 flag7 = handleWidgetDynamicAction(class13_2); 9500 9500 if (flag7) { 9501 9501 outBuffer.putOpcode(79); 9502 - outBuffer.putShort(second); 9502 + outBuffer.putShortBE(second); 9503 9503 } 9504 9504 } 9505 9505 if (action == 1412) { ··· 9514 9514 } 9515 9515 if (action == 575 && !aBoolean1239) { 9516 9516 outBuffer.putOpcode(226); 9517 - outBuffer.putShort(second); 9517 + outBuffer.putShortBE(second); 9518 9518 aBoolean1239 = true; 9519 9519 } 9520 9520 if (action == 892) { 9521 9521 method80(second, 0, first, clicked); 9522 9522 outBuffer.putOpcode(136); 9523 - outBuffer.putShort(first + nextTopLeftTileX); 9524 - outBuffer.putLEShortDup(second + nextTopRightTileY); 9525 - outBuffer.putShort(clicked >> 14 & 0x7fff); 9523 + outBuffer.putShortBE(first + nextTopLeftTileX); 9524 + outBuffer.putShortLE(second + nextTopRightTileY); 9525 + outBuffer.putShortBE(clicked >> 14 & 0x7fff); 9526 9526 } 9527 9527 if (action == 270) { 9528 9528 boolean flag3 = walk(false, false, second, localPlayer.pathY[0], 0, 0, 2, 0, first, 0, 0, ··· 9535 9535 crossType = 2; 9536 9536 crossIndex = 0; 9537 9537 outBuffer.putOpcode(230); 9538 - outBuffer.putLEShortDup(clicked); 9539 - outBuffer.putShortAdded(first + nextTopLeftTileX); 9540 - outBuffer.putShort(second + nextTopRightTileY); 9538 + outBuffer.putShortLE(clicked); 9539 + outBuffer.putOffsetShortBE(first + nextTopLeftTileX); 9540 + outBuffer.putShortBE(second + nextTopRightTileY); 9541 9541 } 9542 9542 if (action == 596) { 9543 9543 Player class50_sub1_sub4_sub3_sub2_5 = players[clicked]; ··· 9551 9551 crossType = 2; 9552 9552 crossIndex = 0; 9553 9553 outBuffer.putOpcode(143); 9554 - outBuffer.putLEShortDup(anInt1149); 9555 - outBuffer.putLEShortAdded(anInt1147); 9556 - outBuffer.putShort(anInt1148); 9557 - outBuffer.putShortAdded(clicked); 9554 + outBuffer.putShortLE(anInt1149); 9555 + outBuffer.putOffsetShortLE(anInt1147); 9556 + outBuffer.putShortBE(anInt1148); 9557 + outBuffer.putOffsetShortBE(clicked); 9558 9558 } 9559 9559 } 9560 9560 if (action == 100) { ··· 9568 9568 crossType = 2; 9569 9569 crossIndex = 0; 9570 9570 outBuffer.putOpcode(211); 9571 - outBuffer.putLEShortAdded(anInt1147); 9572 - outBuffer.putShortAdded(anInt1149); 9573 - outBuffer.putLEShortAdded(second + nextTopRightTileY); 9574 - outBuffer.putLEShortAdded(first + nextTopLeftTileX); 9575 - outBuffer.putLEShortDup(anInt1148); 9576 - outBuffer.putLEShortDup(clicked); 9571 + outBuffer.putOffsetShortLE(anInt1147); 9572 + outBuffer.putOffsetShortBE(anInt1149); 9573 + outBuffer.putOffsetShortLE(second + nextTopRightTileY); 9574 + outBuffer.putOffsetShortLE(first + nextTopLeftTileX); 9575 + outBuffer.putShortLE(anInt1148); 9576 + outBuffer.putShortLE(clicked); 9577 9577 } 9578 9578 if (action == 1668) { 9579 9579 Npc class50_sub1_sub4_sub3_sub1_6 = npcs[clicked]; ··· 9604 9604 anInt1100++; 9605 9605 if (anInt1100 >= 120) { 9606 9606 outBuffer.putOpcode(95); 9607 - outBuffer.putInt(0); 9607 + outBuffer.putIntBE(0); 9608 9608 anInt1100 = 0; 9609 9609 } 9610 9610 outBuffer.putOpcode(100); 9611 - outBuffer.putShort(first + nextTopLeftTileX); 9612 - outBuffer.putShortAdded(second + nextTopRightTileY); 9613 - outBuffer.putLEShortAdded(clicked); 9611 + outBuffer.putShortBE(first + nextTopLeftTileX); 9612 + outBuffer.putOffsetShortBE(second + nextTopRightTileY); 9613 + outBuffer.putOffsetShortLE(clicked); 9614 9614 } 9615 9615 if (action == 444) { 9616 9616 outBuffer.putOpcode(91); // third item action 9617 - outBuffer.putLEShortDup(clicked); 9618 - outBuffer.putLEShortAdded(first); 9619 - outBuffer.putShort(second); 9617 + outBuffer.putShortLE(clicked); 9618 + outBuffer.putOffsetShortLE(first); 9619 + outBuffer.putShortBE(second); 9620 9620 atInventoryLoopCycle = 0; 9621 9621 anInt1330 = second; 9622 9622 anInt1331 = first; ··· 9642 9642 if (action == 389) { 9643 9643 method80(second, 0, first, clicked); 9644 9644 outBuffer.putOpcode(241); 9645 - outBuffer.putShort(clicked >> 14 & 0x7fff); 9646 - outBuffer.putShort(first + nextTopLeftTileX); 9647 - outBuffer.putShortAdded(second + nextTopRightTileY); 9645 + outBuffer.putShortBE(clicked >> 14 & 0x7fff); 9646 + outBuffer.putShortBE(first + nextTopLeftTileX); 9647 + outBuffer.putOffsetShortBE(second + nextTopRightTileY); 9648 9648 } 9649 9649 if (action == 564) { 9650 9650 outBuffer.putOpcode(231); // fourth item action event 9651 - outBuffer.putLEShortAdded(second); 9652 - outBuffer.putLEShortDup(first); 9653 - outBuffer.putShort(clicked); 9651 + outBuffer.putOffsetShortLE(second); 9652 + outBuffer.putShortLE(first); 9653 + outBuffer.putShortBE(clicked); 9654 9654 atInventoryLoopCycle = 0; 9655 9655 anInt1330 = second; 9656 9656 anInt1331 = first; ··· 9686 9686 } 9687 9687 if (action == Actions.RESET_SETTING_WIDGET) { 9688 9688 outBuffer.putOpcode(79); 9689 - outBuffer.putShort(second); 9689 + outBuffer.putShortBE(second); 9690 9690 Widget widget = Widget.forId(second); 9691 9691 if (widget.cs1opcodes != null && widget.cs1opcodes[0][0] == 5) { 9692 9692 int operand = widget.cs1opcodes[0][1]; ··· 9709 9709 crossType = 2; 9710 9710 crossIndex = 0; 9711 9711 outBuffer.putOpcode(112); 9712 - outBuffer.putLEShortDup(clicked); 9712 + outBuffer.putShortLE(clicked); 9713 9713 } 9714 9714 } 9715 9715 if (action == 199) { ··· 9723 9723 crossType = 2; 9724 9724 crossIndex = 0; 9725 9725 outBuffer.putOpcode(83); 9726 - outBuffer.putLEShortDup(clicked); 9727 - outBuffer.putShort(second + nextTopRightTileY); 9728 - outBuffer.putLEShortDup(anInt1172); 9729 - outBuffer.putLEShortAdded(first + nextTopLeftTileX); 9726 + outBuffer.putShortLE(clicked); 9727 + outBuffer.putShortBE(second + nextTopRightTileY); 9728 + outBuffer.putShortLE(anInt1172); 9729 + outBuffer.putOffsetShortLE(first + nextTopLeftTileX); 9730 9730 } 9731 9731 if (action == 55) { 9732 9732 method44(dialogueId); ··· 9764 9764 crossType = 2; 9765 9765 crossIndex = 0; 9766 9766 outBuffer.putOpcode(194); 9767 - outBuffer.putLEShortDup(clicked); 9767 + outBuffer.putShortLE(clicked); 9768 9768 } 9769 9769 } 9770 9770 itemSelected = 0; ··· 10493 10493 10494 10494 private void parsePlacementPacket(Buffer buf, int opcode) { 10495 10495 if (opcode == 203) { 10496 - int objectId = buf.getUnsignedShort(); 10496 + int objectId = buf.getUnsignedShortBE(); 10497 10497 int j3 = buf.getUnsignedByte(); 10498 10498 int modelType = j3 >> 2; 10499 10499 int modelOrientation = j3 & 3; 10500 10500 int type = objectTypes[modelType]; 10501 - byte byte0 = buf.getSignedByteNegated(); 10502 - int offset = buf.getByteAdded(); 10501 + byte byte0 = buf.getInvertedByte(); 10502 + int offset = buf.getUnsignedPostNegativeOffsetByte(); 10503 10503 int x = placementX + (offset >> 4 & 7); 10504 10504 int y = placementY + (offset & 7); 10505 - byte byte1 = buf.getSignedByteAdded(); 10506 - int duration = buf.getShortUnsingedAdded(); 10507 - int id = buf.getUnsignedLEShort(); 10508 - byte byte2 = buf.getSignedByte(); 10509 - byte byte3 = buf.getSignedByteAdded(); 10510 - int startDelay = buf.getUnsignedShort(); 10505 + byte byte1 = buf.getPostNegativeOffsetByte(); 10506 + int duration = buf.getUnsignedNegativeOffsetShortBE(); 10507 + int id = buf.getUnsignedShortLE(); 10508 + byte byte2 = buf.getByte(); 10509 + byte byte3 = buf.getPostNegativeOffsetByte(); 10510 + int startDelay = buf.getUnsignedShortBE(); 10511 10511 Player player; 10512 10512 if (id == thisPlayerServerId) 10513 10513 player = localPlayer; ··· 10553 10553 } 10554 10554 } 10555 10555 if (opcode == 106) { // add ground item dropped by player 10556 - int offset = buf.getByteAdded(); 10556 + int offset = buf.getUnsignedPostNegativeOffsetByte(); 10557 10557 int x = placementX + (offset >> 4 & 7); 10558 10558 int y = placementY + (offset & 7); 10559 - int amount = buf.getLittleShortA(); 10560 - int id = buf.getShortUnsingedAdded(); 10561 - int playerId = buf.getShortUnsingedAdded(); 10559 + int amount = buf.getUnsignedNegativeOffsetShortLE(); 10560 + int id = buf.getUnsignedNegativeOffsetShortBE(); 10561 + int playerId = buf.getUnsignedNegativeOffsetShortBE(); 10562 10562 if (x >= 0 && y >= 0 && x < 104 && y < 104 && playerId != thisPlayerServerId) { 10563 10563 Item item = new Item(); 10564 10564 item.itemId = id; ··· 10571 10571 return; 10572 10572 } 10573 10573 if (opcode == 142) { 10574 - int i1 = buf.getUnsignedShort(); 10575 - int l3 = buf.getByteAdded(); 10574 + int i1 = buf.getUnsignedShortBE(); 10575 + int l3 = buf.getUnsignedPostNegativeOffsetByte(); 10576 10576 int k6 = l3 >> 2; 10577 10577 int j9 = l3 & 3; 10578 10578 int i12 = objectTypes[k6]; ··· 10623 10623 return; 10624 10624 } 10625 10625 if (opcode == 107) { // add ground item (dropped by npc or "auto spawn") 10626 - int id = buf.getUnsignedShort(); 10627 - int offset = buf.getByteNegated(); 10626 + int id = buf.getUnsignedShortBE(); 10627 + int offset = buf.getUnsignedInvertedByte(); 10628 10628 int x = placementX + (offset >> 4 & 7); 10629 10629 int y = placementY + (offset & 7); 10630 - int amount = buf.getShortUnsingedAdded(); 10630 + int amount = buf.getUnsignedNegativeOffsetShortBE(); 10631 10631 if (x >= 0 && y >= 0 && x < 104 && y < 104) { 10632 10632 Item item = new Item(); 10633 10633 item.itemId = id; ··· 10643 10643 int offset = buf.getUnsignedByte(); 10644 10644 int x = placementX + (offset >> 4 & 7); 10645 10645 int y = placementY + (offset & 7); 10646 - int id = buf.getUnsignedShort(); 10647 - int amount = buf.getUnsignedShort(); 10648 - int newAmount = buf.getUnsignedShort(); 10646 + int id = buf.getUnsignedShortBE(); 10647 + int amount = buf.getUnsignedShortBE(); 10648 + int newAmount = buf.getUnsignedShortBE(); 10649 10649 if (x >= 0 && y >= 0 && x < 104 && y < 104) { 10650 10650 LinkedList list = groundItems[plane][x][y]; 10651 10651 if (list != null) { ··· 10665 10665 int offset = buf.getUnsignedByte(); 10666 10666 int x = placementX + (offset >> 4 & 7); 10667 10667 int y = placementY + (offset & 7); 10668 - int i10 = x + buf.getSignedByte(); 10669 - int l12 = y + buf.getSignedByte(); 10670 - int l14 = buf.getSignedShort(); 10671 - int k16 = buf.getUnsignedShort(); 10668 + int i10 = x + buf.getByte(); 10669 + int l12 = y + buf.getByte(); 10670 + int l14 = buf.getShortBE(); 10671 + int k16 = buf.getUnsignedShortBE(); 10672 10672 int i18 = buf.getUnsignedByte() * 4; 10673 10673 int i19 = buf.getUnsignedByte() * 4; 10674 - int k19 = buf.getUnsignedShort(); 10675 - int j20 = buf.getUnsignedShort(); 10674 + int k19 = buf.getUnsignedShortBE(); 10675 + int j20 = buf.getUnsignedShortBE(); 10676 10676 int i21 = buf.getUnsignedByte(); 10677 10677 int j21 = buf.getUnsignedByte(); 10678 10678 if (x >= 0 && y >= 0 && x < 104 && y < 104 && i10 >= 0 && l12 >= 0 && i10 < 104 && l12 < 104 ··· 10693 10693 int offset = buf.getUnsignedByte(); 10694 10694 int x = placementX + (offset >> 4 & 7); 10695 10695 int y = placementY + (offset & 7); 10696 - int soundId = buf.getUnsignedShort(); 10696 + int soundId = buf.getUnsignedShortBE(); 10697 10697 int i13 = buf.getUnsignedByte(); 10698 10698 int i15 = i13 >> 4 & 0xf; 10699 10699 int type = i13 & 7; ··· 10712 10712 int j2 = buf.getUnsignedByte(); 10713 10713 int i5 = placementX + (j2 >> 4 & 7); 10714 10714 int l7 = placementY + (j2 & 7); 10715 - int k10 = buf.getUnsignedShort(); 10715 + int k10 = buf.getUnsignedShortBE(); 10716 10716 int j13 = buf.getUnsignedByte(); 10717 - int j15 = buf.getUnsignedShort(); 10717 + int j15 = buf.getUnsignedShortBE(); 10718 10718 if (i5 >= 0 && l7 >= 0 && i5 < 104 && l7 < 104) { 10719 10719 i5 = i5 * 128 + 64; 10720 10720 l7 = l7 * 128 + 64; ··· 10724 10724 return; 10725 10725 } 10726 10726 if (opcode == 152) { 10727 - int k2 = buf.getByteNegated(); 10727 + int k2 = buf.getUnsignedInvertedByte(); 10728 10728 int j5 = k2 >> 2; 10729 10729 int i8 = k2 & 3; 10730 10730 int l10 = objectTypes[j5]; 10731 - int k13 = buf.getLittleShortA(); 10732 - int k15 = buf.getByteAdded(); 10731 + int k13 = buf.getUnsignedNegativeOffsetShortLE(); 10732 + int k15 = buf.getUnsignedPostNegativeOffsetByte(); 10733 10733 int i17 = placementX + (k15 >> 4 & 7); 10734 10734 int j18 = placementY + (k15 & 7); 10735 10735 if (i17 >= 0 && j18 >= 0 && i17 < 104 && j18 < 104) ··· 10737 10737 return; 10738 10738 } 10739 10739 if (opcode == 208) { // remove ground item 10740 - int id = buf.getShortUnsingedAdded(); 10741 - int offset = buf.getByteAdded(); 10740 + int id = buf.getUnsignedNegativeOffsetShortBE(); 10741 + int offset = buf.getUnsignedPostNegativeOffsetByte(); 10742 10742 int x = placementX + (offset >> 4 & 7); 10743 10743 int y = placementY + (offset & 7); 10744 10744 if (x >= 0 && y >= 0 && x < 104 && y < 104) { ··· 10759 10759 return; 10760 10760 } 10761 10761 if (opcode == 88) { 10762 - int positionOffset = buf.getByteSubtracted(); 10762 + int positionOffset = buf.getUnsignedPreNegativeOffsetByte(); 10763 10763 int x = placementX + (positionOffset >> 4 & 7); 10764 10764 int y = placementY + (positionOffset & 7); 10765 - int data = buf.getByteSubtracted(); 10765 + int data = buf.getUnsignedPreNegativeOffsetByte(); 10766 10766 int objectType = data >> 2; 10767 10767 int orientation = data & 3; 10768 10768 int type = objectTypes[objectType]; ··· 11445 11445 if (flag) { 11446 11446 outBuffer.putByte(i); 11447 11447 outBuffer.putByte(j); 11448 - outBuffer.putShort(cameraHorizontal); 11448 + outBuffer.putShortBE(cameraHorizontal); 11449 11449 outBuffer.putByte(57); 11450 11450 outBuffer.putByte(anInt916); 11451 11451 outBuffer.putByte(anInt1233); 11452 11452 outBuffer.putByte(89); 11453 - outBuffer.putShort(localPlayer.worldX); 11454 - outBuffer.putShort(localPlayer.worldY); 11453 + outBuffer.putShortBE(localPlayer.worldX); 11454 + outBuffer.putShortBE(localPlayer.worldY); 11455 11455 outBuffer.putByte(anInt1126); 11456 11456 outBuffer.putByte(63); 11457 11457 } ··· 11814 11814 } catch (Exception exception) { 11815 11815 if (SignLink.reportError) { 11816 11816 outBuffer.putOpcode(80); 11817 - outBuffer.putShort(sound[index] & 0x7fff); 11817 + outBuffer.putShortBE(sound[index] & 0x7fff); 11818 11818 } else { 11819 11819 outBuffer.putOpcode(80); 11820 - outBuffer.putShort(-1); 11820 + outBuffer.putShortBE(-1); 11821 11821 } 11822 11822 } 11823 11823 if (!flag1 || soundDelay[index] == -5) {
+6 -6
src/com/jagex/runescape/cache/Archive.java
··· 21 21 */ 22 22 public Archive(byte[] dataBuffer) { 23 23 Buffer buffer = new Buffer(dataBuffer); 24 - int uncompressed = buffer.get24BitInt(); 25 - int compressed = buffer.get24BitInt(); 24 + int uncompressed = buffer.getMediumBE(); 25 + int compressed = buffer.getMediumBE(); 26 26 if (compressed != uncompressed) { 27 27 byte[] data = new byte[uncompressed]; 28 28 BZip2Decompressor.decompress(data, uncompressed, dataBuffer, compressed, 6); ··· 33 33 archiveBuffer = dataBuffer; 34 34 this.compressed = false; 35 35 } 36 - dataSize = buffer.getUnsignedShort(); 36 + dataSize = buffer.getUnsignedShortBE(); 37 37 nameHashes = new int[dataSize]; 38 38 uncompressedSizes = new int[dataSize]; 39 39 compressedSizes = new int[dataSize]; 40 40 startOffsets = new int[dataSize]; 41 41 int offset = buffer.currentPosition + dataSize * 10; 42 42 for (int index = 0; index < dataSize; index++) { 43 - nameHashes[index] = buffer.getInt(); 44 - uncompressedSizes[index] = buffer.get24BitInt(); 45 - compressedSizes[index] = buffer.get24BitInt(); 43 + nameHashes[index] = buffer.getIntBE(); 44 + uncompressedSizes[index] = buffer.getMediumBE(); 45 + compressedSizes[index] = buffer.getMediumBE(); 46 46 startOffsets[index] = offset; 47 47 offset += compressedSizes[index]; 48 48 }
+5 -5
src/com/jagex/runescape/cache/cfg/ChatCensor.java
··· 41 41 } 42 42 43 43 public static void loadTopLevelDomains(Buffer buffer) { 44 - int length = buffer.getInt(); 44 + int length = buffer.getIntBE(); 45 45 topLevelDomains = new char[length][]; 46 46 topLevelDomainsType = new int[length]; 47 47 for (int index = 0; index < length; index++) { ··· 56 56 } 57 57 58 58 public static void loadBadEnc(Buffer buffer) { 59 - int length = buffer.getInt(); 59 + int length = buffer.getIntBE(); 60 60 badWords = new char[length][]; 61 61 badBytes = new byte[length][][]; 62 62 loadBadWords(buffer, badWords, badBytes); ··· 64 64 } 65 65 66 66 public static void loadDomainEnc(Buffer buffer) { 67 - int length = buffer.getInt(); 67 + int length = buffer.getIntBE(); 68 68 domains = new char[length][]; 69 69 loadDomains(buffer, domains); 70 70 } 71 71 72 72 public static void loadFragmentsEnc(Buffer buffer) { 73 - fragments = new int[buffer.getInt()]; 73 + fragments = new int[buffer.getIntBE()]; 74 74 for (int index = 0; index < fragments.length; index++) 75 - fragments[index] = buffer.getUnsignedShort(); 75 + fragments[index] = buffer.getUnsignedShortBE(); 76 76 77 77 } 78 78
+4 -4
src/com/jagex/runescape/cache/cfg/Varbit.java
··· 14 14 15 15 public static void load(Archive archive) { 16 16 Buffer buffer = new Buffer(archive.getFile("varbit.dat")); 17 - count = buffer.getUnsignedShort(); 17 + count = buffer.getUnsignedShortBE(); 18 18 19 19 if (cache == null) 20 20 cache = new Varbit[count]; ··· 37 37 if (attribute == 0) 38 38 return; 39 39 if (attribute == 1) { 40 - configId = buf.getUnsignedShort(); 40 + configId = buf.getUnsignedShortBE(); 41 41 leastSignificantBit = buf.getUnsignedByte(); 42 42 mostSignificantBit = buf.getUnsignedByte(); 43 43 } else if (attribute == 10) ··· 45 45 else if (attribute == 2) 46 46 aBoolean829 = true; 47 47 else if (attribute == 3) 48 - buf.getInt(); // dummy 48 + buf.getIntBE(); // dummy 49 49 else if (attribute == 4) 50 - buf.getInt(); // dummy 50 + buf.getIntBE(); // dummy 51 51 else if (attribute == 5) 52 52 aBoolean832 = false; 53 53 else
+4 -4
src/com/jagex/runescape/cache/cfg/Varp.java
··· 25 25 public static void load(Archive archive) { 26 26 Buffer buffer = new Buffer(archive.getFile("varp.dat")); 27 27 currentIndex = 0; 28 - count = buffer.getUnsignedShort(); 28 + count = buffer.getUnsignedShortBE(); 29 29 30 30 if (cache == null) 31 31 cache = new Varp[count]; ··· 58 58 } else if (attribute == 4) 59 59 aBoolean711 = false; 60 60 else if (attribute == 5) 61 - anInt712 = buffer.getUnsignedShort(); 61 + anInt712 = buffer.getUnsignedShortBE(); 62 62 else if (attribute == 6) 63 63 aBoolean713 = true; 64 64 else if (attribute == 7) 65 - anInt714 = buffer.getInt(); 65 + anInt714 = buffer.getIntBE(); 66 66 else if (attribute == 8) { 67 67 anInt715 = 1; 68 68 aBoolean716 = true; ··· 71 71 else if (attribute == 11) 72 72 aBoolean716 = true; 73 73 else if (attribute == 12) 74 - anInt717 = buffer.getInt(); 74 + anInt717 = buffer.getIntBE(); 75 75 else if (attribute == 13) { 76 76 anInt715 = 2; 77 77 aBoolean716 = true;
+26 -26
src/com/jagex/runescape/cache/def/ActorDefinition.java
··· 71 71 int modelCount = buffer.getUnsignedByte(); 72 72 modelIds = new int[modelCount]; 73 73 for (int model = 0; model < modelCount; model++) 74 - modelIds[model] = buffer.getUnsignedShort(); 74 + modelIds[model] = buffer.getUnsignedShortBE(); 75 75 76 76 } else if (attributeId == 2) 77 77 name = buffer.getString(); 78 78 else if (attributeId == 3) 79 79 description = buffer.getStringBytes(); 80 80 else if (attributeId == 12) 81 - boundaryDimension = buffer.getSignedByte(); 81 + boundaryDimension = buffer.getByte(); 82 82 else if (attributeId == 13) 83 - standAnimationId = buffer.getUnsignedShort(); 83 + standAnimationId = buffer.getUnsignedShortBE(); 84 84 else if (attributeId == 14) 85 - walkAnimationId = buffer.getUnsignedShort(); 85 + walkAnimationId = buffer.getUnsignedShortBE(); 86 86 else if (attributeId == 17) { 87 - walkAnimationId = buffer.getUnsignedShort(); 88 - turnAroundAnimationId = buffer.getUnsignedShort(); 89 - turnRightAnimationId = buffer.getUnsignedShort(); 90 - turnLeftAnimationId = buffer.getUnsignedShort(); 87 + walkAnimationId = buffer.getUnsignedShortBE(); 88 + turnAroundAnimationId = buffer.getUnsignedShortBE(); 89 + turnRightAnimationId = buffer.getUnsignedShortBE(); 90 + turnLeftAnimationId = buffer.getUnsignedShortBE(); 91 91 } else if (attributeId >= 30 && attributeId < 40) { 92 92 if (actions == null) 93 93 actions = new String[5]; ··· 99 99 modifiedModelColors = new int[modelColorCount]; 100 100 originalModelColors = new int[modelColorCount]; 101 101 for (int colour = 0; colour < modelColorCount; colour++) { 102 - modifiedModelColors[colour] = buffer.getUnsignedShort(); 103 - originalModelColors[colour] = buffer.getUnsignedShort(); 102 + modifiedModelColors[colour] = buffer.getUnsignedShortBE(); 103 + originalModelColors[colour] = buffer.getUnsignedShortBE(); 104 104 } 105 105 106 106 } else if (attributeId == 60) { 107 107 int additionalModelCount = buffer.getUnsignedByte(); 108 108 headModelIndexes = new int[additionalModelCount]; 109 109 for (int model = 0; model < additionalModelCount; model++) 110 - headModelIndexes[model] = buffer.getUnsignedShort(); 110 + headModelIndexes[model] = buffer.getUnsignedShortBE(); 111 111 112 112 } else if (attributeId == 90) 113 - anInt648 = buffer.getUnsignedShort(); 113 + anInt648 = buffer.getUnsignedShortBE(); 114 114 else if (attributeId == 91) 115 - anInt627 = buffer.getUnsignedShort(); 115 + anInt627 = buffer.getUnsignedShortBE(); 116 116 else if (attributeId == 92) 117 - anInt637 = buffer.getUnsignedShort(); 117 + anInt637 = buffer.getUnsignedShortBE(); 118 118 else if (attributeId == 93) 119 119 minimapVisible = false; 120 120 else if (attributeId == 95) 121 - combatLevel = buffer.getUnsignedShort(); 121 + combatLevel = buffer.getUnsignedShortBE(); 122 122 else if (attributeId == 97) 123 - sizeXZ = buffer.getUnsignedShort(); 123 + sizeXZ = buffer.getUnsignedShortBE(); 124 124 else if (attributeId == 98) 125 - sizeY = buffer.getUnsignedShort(); 125 + sizeY = buffer.getUnsignedShortBE(); 126 126 else if (attributeId == 99) 127 127 visible = true; 128 128 else if (attributeId == 100) 129 - brightness = buffer.getSignedByte(); 129 + brightness = buffer.getByte(); 130 130 else if (attributeId == 101) 131 - contrast = buffer.getSignedByte() * 5; 131 + contrast = buffer.getByte() * 5; 132 132 else if (attributeId == 102) 133 - headIcon = buffer.getUnsignedShort(); 133 + headIcon = buffer.getUnsignedShortBE(); 134 134 else if (attributeId == 103) 135 - degreesToTurn = buffer.getUnsignedShort(); 135 + degreesToTurn = buffer.getUnsignedShortBE(); 136 136 else if (attributeId == 106) { 137 - varBitId = buffer.getUnsignedShort(); 137 + varBitId = buffer.getUnsignedShortBE(); 138 138 if (varBitId == 65535) 139 139 varBitId = -1; 140 - settingId = buffer.getUnsignedShort(); 140 + settingId = buffer.getUnsignedShortBE(); 141 141 if (settingId == 65535) 142 142 settingId = -1; 143 143 int childrenCount = buffer.getUnsignedByte(); 144 144 childrenIds = new int[childrenCount + 1]; 145 145 for (int child = 0; child <= childrenCount; child++) { 146 - childrenIds[child] = buffer.getUnsignedShort(); 146 + childrenIds[child] = buffer.getUnsignedShortBE(); 147 147 if (childrenIds[child] == 65535) 148 148 childrenIds[child] = -1; 149 149 } ··· 214 214 public static void load(Archive archive) { 215 215 buffer = new Buffer(archive.getFile("npc.dat")); 216 216 Buffer buffer = new Buffer(archive.getFile("npc.idx")); 217 - size = buffer.getUnsignedShort(); 217 + size = buffer.getUnsignedShortBE(); 218 218 bufferOffsets = new int[size]; 219 219 int offset = 2; 220 220 for (int bufferIndex = 0; bufferIndex < size; bufferIndex++) { 221 221 bufferOffsets[bufferIndex] = offset; 222 - offset += buffer.getUnsignedShort(); 222 + offset += buffer.getUnsignedShortBE(); 223 223 } 224 224 225 225 cache = new ActorDefinition[20];
+3 -3
src/com/jagex/runescape/cache/def/FloorDefinition.java
··· 24 24 25 25 public static void load(Archive archive) { 26 26 Buffer buffer = new Buffer(archive.getFile("flo.dat")); 27 - count = buffer.getUnsignedShort(); 27 + count = buffer.getUnsignedShortBE(); 28 28 if (cache == null) 29 29 cache = new FloorDefinition[count]; 30 30 for (int floor = 0; floor < count; floor++) { ··· 42 42 return; 43 43 switch (attributeId) { 44 44 case 1: 45 - rgbColor = buffer.get24BitInt(); 45 + rgbColor = buffer.getMediumBE(); 46 46 shiftRGBColors(rgbColor); 47 47 break; 48 48 case 2: ··· 62 62 int oldSaturation = saturation; 63 63 int oldLightness = lightness; 64 64 int oldHue = hue; 65 - shiftRGBColors(buffer.get24BitInt()); 65 + shiftRGBColors(buffer.getMediumBE()); 66 66 hue2 = oldHue2; 67 67 saturation = oldSaturation; 68 68 lightness = oldLightness;
+20 -20
src/com/jagex/runescape/cache/def/GameObjectDefinition.java
··· 145 145 public static void load(Archive archive) { 146 146 buffer = new Buffer(archive.getFile("loc.dat")); 147 147 Buffer buffer = new Buffer(archive.getFile("loc.idx")); 148 - definitionCount = buffer.getUnsignedShort(); 148 + definitionCount = buffer.getUnsignedShortBE(); 149 149 bufferOffsets = new int[definitionCount]; 150 150 int offset = 2; 151 151 for (int index = 0; index < definitionCount; index++) { 152 152 bufferOffsets[index] = offset; 153 - offset += buffer.getUnsignedShort(); 153 + offset += buffer.getUnsignedShortBE(); 154 154 } 155 155 156 156 cache = new GameObjectDefinition[20]; ··· 285 285 modelTypes = new int[k]; 286 286 modelIds = new int[k]; 287 287 for (int k1 = 0; k1 < k; k1++) { 288 - modelIds[k1] = buf.getUnsignedShort(); 288 + modelIds[k1] = buf.getUnsignedShortBE(); 289 289 modelTypes[k1] = buf.getUnsignedByte(); 290 290 } 291 291 ··· 306 306 modelTypes = null; 307 307 modelIds = new int[l]; 308 308 for (int l1 = 0; l1 < l; l1++) 309 - modelIds[l1] = buf.getUnsignedShort(); 309 + modelIds[l1] = buf.getUnsignedShortBE(); 310 310 311 311 } else { 312 312 buf.currentPosition += l * 2; ··· 339 339 aBoolean797 = true; 340 340 break; 341 341 case 24: 342 - animationId = buf.getUnsignedShort(); 342 + animationId = buf.getUnsignedShortBE(); 343 343 if (animationId == 65535) 344 344 animationId = -1; 345 345 break; ··· 347 347 unknown4 = buf.getUnsignedByte(); 348 348 break; 349 349 case 29: 350 - modelLightFalloff = buf.getSignedByte(); 350 + modelLightFalloff = buf.getByte(); 351 351 break; 352 352 case 39: 353 - modelLightAmbient = buf.getSignedByte(); 353 + modelLightAmbient = buf.getByte(); 354 354 break; 355 355 } 356 356 if (attribute < 30 || attribute >= 39) { ··· 360 360 modifiedModelColors = new int[i1]; 361 361 anIntArray792 = new int[i1]; 362 362 for (int i2 = 0; i2 < i1; i2++) { 363 - modifiedModelColors[i2] = buf.getUnsignedShort(); 364 - anIntArray792[i2] = buf.getUnsignedShort(); 363 + modifiedModelColors[i2] = buf.getUnsignedShortBE(); 364 + anIntArray792[i2] = buf.getUnsignedShortBE(); 365 365 } 366 366 367 367 break; 368 368 case 60: 369 - icon = buf.getUnsignedShort(); 369 + icon = buf.getUnsignedShortBE(); 370 370 break; 371 371 case 62: 372 372 unknown3 = true; ··· 375 375 unknown2 = false; 376 376 break; 377 377 case 65: 378 - modelSizeX = buf.getUnsignedShort(); 378 + modelSizeX = buf.getUnsignedShortBE(); 379 379 break; 380 380 case 66: 381 - modelSizeY = buf.getUnsignedShort(); 381 + modelSizeY = buf.getUnsignedShortBE(); 382 382 break; 383 383 case 67: 384 - modelSizeZ = buf.getUnsignedShort(); 384 + modelSizeZ = buf.getUnsignedShortBE(); 385 385 break; 386 386 case 68: 387 - anInt795 = buf.getUnsignedShort(); 387 + anInt795 = buf.getUnsignedShortBE(); 388 388 break; 389 389 case 69: 390 390 anInt764 = buf.getUnsignedByte(); 391 391 break; 392 392 case 70: 393 - translateX = buf.getSignedShort(); 393 + translateX = buf.getShortBE(); 394 394 break; 395 395 case 71: 396 - translateY = buf.getSignedShort(); 396 + translateY = buf.getShortBE(); 397 397 break; 398 398 case 72: 399 - translateZ = buf.getSignedShort(); 399 + translateZ = buf.getShortBE(); 400 400 break; 401 401 case 73: 402 402 unknown = true; ··· 419 419 } 420 420 continue label0; 421 421 } while (attribute != 77); 422 - varbitId = buf.getUnsignedShort(); 422 + varbitId = buf.getUnsignedShortBE(); 423 423 if (varbitId == 65535) 424 424 varbitId = -1; 425 - configId = buf.getUnsignedShort(); 425 + configId = buf.getUnsignedShortBE(); 426 426 if (configId == 65535) 427 427 configId = -1; 428 428 int j1 = buf.getUnsignedByte(); 429 429 childrenIds = new int[j1 + 1]; 430 430 for (int j2 = 0; j2 <= j1; j2++) { 431 - childrenIds[j2] = buf.getUnsignedShort(); 431 + childrenIds[j2] = buf.getUnsignedShortBE(); 432 432 if (childrenIds[j2] == 65535) 433 433 childrenIds[j2] = -1; 434 434 }
+34 -34
src/com/jagex/runescape/cache/def/ItemDefinition.java
··· 191 191 public static void load(Archive archive) { 192 192 buffer = new Buffer(archive.getFile("obj.dat")); 193 193 Buffer buffer = new Buffer(archive.getFile("obj.idx")); 194 - count = buffer.getUnsignedShort(); 194 + count = buffer.getUnsignedShortBE(); 195 195 offsets = new int[count]; 196 196 int index = 2; 197 197 for (int i = 0; i < count; i++) { 198 198 offsets[i] = index; 199 - index += buffer.getUnsignedShort(); 199 + index += buffer.getUnsignedShortBE(); 200 200 } 201 201 202 202 cache = new ItemDefinition[10]; ··· 276 276 if (opcode == 0) 277 277 return; 278 278 if (opcode == 1) 279 - modelId = buffer.getUnsignedShort(); 279 + modelId = buffer.getUnsignedShortBE(); 280 280 else if (opcode == 2) 281 281 name = buffer.getString(); 282 282 else if (opcode == 3) 283 283 description = buffer.getStringBytes(); 284 284 else if (opcode == 4) 285 - modelScale = buffer.getUnsignedShort(); 285 + modelScale = buffer.getUnsignedShortBE(); 286 286 else if (opcode == 5) 287 - modelRotationX = buffer.getUnsignedShort(); 287 + modelRotationX = buffer.getUnsignedShortBE(); 288 288 else if (opcode == 6) 289 - modelRotationY = buffer.getUnsignedShort(); 289 + modelRotationY = buffer.getUnsignedShortBE(); 290 290 else if (opcode == 7) { 291 - modelOffsetX = buffer.getUnsignedShort(); 291 + modelOffsetX = buffer.getUnsignedShortBE(); 292 292 if (modelOffsetX > 32767) 293 293 modelOffsetX -= 0x10000; 294 294 } else if (opcode == 8) { 295 - modelOffsetY = buffer.getUnsignedShort(); 295 + modelOffsetY = buffer.getUnsignedShortBE(); 296 296 if (modelOffsetY > 32767) 297 297 modelOffsetY -= 0x10000; 298 298 } else if (opcode == 10) 299 - buffer.getUnsignedShort(); // Dummy 299 + buffer.getUnsignedShortBE(); // Dummy 300 300 else if (opcode == 11) 301 301 stackable = true; 302 302 else if (opcode == 12) 303 - value = buffer.getInt(); 303 + value = buffer.getIntBE(); 304 304 else if (opcode == 16) 305 305 members = true; 306 306 else if (opcode == 23) { 307 - primaryMaleModel = buffer.getUnsignedShort(); 308 - maleTranslation = buffer.getSignedByte(); 307 + primaryMaleModel = buffer.getUnsignedShortBE(); 308 + maleTranslation = buffer.getByte(); 309 309 } else if (opcode == 24) 310 - secondaryMaleModel = buffer.getUnsignedShort(); 310 + secondaryMaleModel = buffer.getUnsignedShortBE(); 311 311 else if (opcode == 25) { 312 - primaryFemaleModel = buffer.getUnsignedShort(); 313 - femaleTranslation = buffer.getSignedByte(); 312 + primaryFemaleModel = buffer.getUnsignedShortBE(); 313 + femaleTranslation = buffer.getByte(); 314 314 } else if (opcode == 26) 315 - secondaryFemaleModel = buffer.getUnsignedShort(); 315 + secondaryFemaleModel = buffer.getUnsignedShortBE(); 316 316 else if (opcode >= 30 && opcode < 35) { 317 317 if (groundActions == null) 318 318 groundActions = new String[5]; ··· 328 328 originalColours = new int[colorCount]; 329 329 destColors = new int[colorCount]; 330 330 for (int k = 0; k < colorCount; k++) { 331 - originalColours[k] = buffer.getUnsignedShort(); 332 - destColors[k] = buffer.getUnsignedShort(); 331 + originalColours[k] = buffer.getUnsignedShortBE(); 332 + destColors[k] = buffer.getUnsignedShortBE(); 333 333 } 334 334 335 335 } else if (opcode == 78) 336 - tertiaryMaleEquipmentModel = buffer.getUnsignedShort(); 336 + tertiaryMaleEquipmentModel = buffer.getUnsignedShortBE(); 337 337 else if (opcode == 79) 338 - tertiaryFemaleEquipmentModel = buffer.getUnsignedShort(); 338 + tertiaryFemaleEquipmentModel = buffer.getUnsignedShortBE(); 339 339 else if (opcode == 90) 340 - primaryMaleHeadPiece = buffer.getUnsignedShort(); 340 + primaryMaleHeadPiece = buffer.getUnsignedShortBE(); 341 341 else if (opcode == 91) 342 - primaryFemaleHeadPiece = buffer.getUnsignedShort(); 342 + primaryFemaleHeadPiece = buffer.getUnsignedShortBE(); 343 343 else if (opcode == 92) 344 - secondaryMaleHeadPiece = buffer.getUnsignedShort(); 344 + secondaryMaleHeadPiece = buffer.getUnsignedShortBE(); 345 345 else if (opcode == 93) 346 - secondaryFemaleHeadPiece = buffer.getUnsignedShort(); 346 + secondaryFemaleHeadPiece = buffer.getUnsignedShortBE(); 347 347 else if (opcode == 95) 348 - anInt339 = buffer.getUnsignedShort(); 348 + anInt339 = buffer.getUnsignedShortBE(); 349 349 else if (opcode == 97) 350 - notedInfoId = buffer.getUnsignedShort(); 350 + notedInfoId = buffer.getUnsignedShortBE(); 351 351 else if (opcode == 98) 352 - notedTemplateId = buffer.getUnsignedShort(); 352 + notedTemplateId = buffer.getUnsignedShortBE(); 353 353 else if (opcode >= 100 && opcode < 110) { 354 354 if (stackIds == null) { 355 355 stackIds = new int[10]; 356 356 stackAmounts = new int[10]; 357 357 } 358 - stackIds[opcode - 100] = buffer.getUnsignedShort(); 359 - stackAmounts[opcode - 100] = buffer.getUnsignedShort(); 358 + stackIds[opcode - 100] = buffer.getUnsignedShortBE(); 359 + stackAmounts[opcode - 100] = buffer.getUnsignedShortBE(); 360 360 } else if (opcode == 110) 361 - groundScaleX = buffer.getUnsignedShort(); 361 + groundScaleX = buffer.getUnsignedShortBE(); 362 362 else if (opcode == 111) 363 - groundScaleY = buffer.getUnsignedShort(); 363 + groundScaleY = buffer.getUnsignedShortBE(); 364 364 else if (opcode == 112) 365 - groundScaleZ = buffer.getUnsignedShort(); 365 + groundScaleZ = buffer.getUnsignedShortBE(); 366 366 else if (opcode == 113) 367 - ambience = buffer.getSignedByte(); 367 + ambience = buffer.getByte(); 368 368 else if (opcode == 114) 369 - diffusion = buffer.getSignedByte() * 5; 369 + diffusion = buffer.getByte() * 5; 370 370 else if (opcode == 115) 371 371 team = buffer.getUnsignedByte(); 372 372 }
+8 -8
src/com/jagex/runescape/cache/media/AnimationSequence.java
··· 25 25 26 26 public static void load(Archive archive) { 27 27 Buffer buffer = new Buffer(archive.getFile("seq.dat")); 28 - AnimationSequence.count = buffer.getUnsignedShort(); 28 + AnimationSequence.count = buffer.getUnsignedShortBE(); 29 29 if (AnimationSequence.animations == null) 30 30 AnimationSequence.animations = new AnimationSequence[AnimationSequence.count]; 31 31 for (int animation = 0; animation < count; animation++) { ··· 59 59 frame1Ids = new int[frameCount]; 60 60 frameLenghts = new int[frameCount]; 61 61 for (int frame = 0; frame < frameCount; frame++) { 62 - getPrimaryFrame[frame] = buf.getUnsignedShort(); 63 - frame1Ids[frame] = buf.getUnsignedShort(); 62 + getPrimaryFrame[frame] = buf.getUnsignedShortBE(); 63 + frame1Ids[frame] = buf.getUnsignedShortBE(); 64 64 if (frame1Ids[frame] == 65535) 65 65 frame1Ids[frame] = -1; 66 - frameLenghts[frame] = buf.getUnsignedShort(); 66 + frameLenghts[frame] = buf.getUnsignedShortBE(); 67 67 } 68 68 69 69 break; 70 70 case 2: 71 - frameStep = buf.getUnsignedShort(); 71 + frameStep = buf.getUnsignedShortBE(); 72 72 break; 73 73 case 3: 74 74 int flowCount = buf.getUnsignedByte(); ··· 85 85 anInt301 = buf.getUnsignedByte(); 86 86 break; 87 87 case 6: 88 - getPlayerShieldDelta = buf.getUnsignedShort(); 88 + getPlayerShieldDelta = buf.getUnsignedShortBE(); 89 89 break; 90 90 case 7: 91 - getPlayerWeaponDelta = buf.getUnsignedShort(); 91 + getPlayerWeaponDelta = buf.getUnsignedShortBE(); 92 92 break; 93 93 case 8: 94 94 anInt304 = buf.getUnsignedByte(); ··· 103 103 anInt307 = buf.getUnsignedByte(); 104 104 break; 105 105 case 12: 106 - buf.getInt(); //dummy 106 + buf.getIntBE(); //dummy 107 107 break; 108 108 default: 109 109 System.out.println("Error unrecognised seq config code: " + attributeId);
+5 -5
src/com/jagex/runescape/cache/media/IdentityKit.java
··· 17 17 18 18 public static void load(Archive archive) { 19 19 Buffer buffer = new Buffer(archive.getFile("idk.dat")); 20 - IdentityKit.count = buffer.getUnsignedShort(); 20 + IdentityKit.count = buffer.getUnsignedShortBE(); 21 21 if (IdentityKit.cache == null) 22 22 IdentityKit.cache = new IdentityKit[IdentityKit.count]; 23 23 for (int identityKit = 0; identityKit < count; identityKit++) { ··· 38 38 int modelCount = buffer.getUnsignedByte(); 39 39 modelId = new int[modelCount]; 40 40 for (int model = 0; model < modelCount; model++) 41 - modelId[model] = buffer.getUnsignedShort(); 41 + modelId[model] = buffer.getUnsignedShortBE(); 42 42 } else if (attributeId == 3) 43 43 widgetDisplayed = true; 44 44 else if (attributeId >= 40 && attributeId < 50) 45 - originalModelColors[attributeId - 40] = buffer.getUnsignedShort(); 45 + originalModelColors[attributeId - 40] = buffer.getUnsignedShortBE(); 46 46 else if (attributeId >= 50 && attributeId < 60) 47 - modifiedModelColors[attributeId - 50] = buffer.getUnsignedShort(); 47 + modifiedModelColors[attributeId - 50] = buffer.getUnsignedShortBE(); 48 48 else if (attributeId >= 60 && attributeId < 70) 49 - headModelIds[attributeId - 60] = buffer.getUnsignedShort(); 49 + headModelIds[attributeId - 60] = buffer.getUnsignedShortBE(); 50 50 else 51 51 System.out.println("Error unrecognised config code: " + attributeId); 52 52 }
+7 -7
src/com/jagex/runescape/cache/media/ImageRGB.java
··· 53 53 public ImageRGB(Archive archive, String archiveName, int archiveIndex) { 54 54 Buffer dataBuffer = new Buffer(archive.getFile(archiveName + ".dat")); 55 55 Buffer indexBuffer = new Buffer(archive.getFile("index.dat")); 56 - indexBuffer.currentPosition = dataBuffer.getUnsignedShort(); 57 - maxWidth = indexBuffer.getUnsignedShort(); 58 - maxHeight = indexBuffer.getUnsignedShort(); 56 + indexBuffer.currentPosition = dataBuffer.getUnsignedShortBE(); 57 + maxWidth = indexBuffer.getUnsignedShortBE(); 58 + maxHeight = indexBuffer.getUnsignedShortBE(); 59 59 int length = indexBuffer.getUnsignedByte(); 60 60 int[] pixels = new int[length]; 61 61 for (int pixel = 0; pixel < length - 1; pixel++) { 62 - pixels[pixel + 1] = indexBuffer.get24BitInt(); 62 + pixels[pixel + 1] = indexBuffer.getMediumBE(); 63 63 if (pixels[pixel + 1] == 0) 64 64 pixels[pixel + 1] = 1; 65 65 } 66 66 67 67 for (int index = 0; index < archiveIndex; index++) { 68 68 indexBuffer.currentPosition += 2; 69 - dataBuffer.currentPosition += indexBuffer.getUnsignedShort() * indexBuffer.getUnsignedShort(); 69 + dataBuffer.currentPosition += indexBuffer.getUnsignedShortBE() * indexBuffer.getUnsignedShortBE(); 70 70 indexBuffer.currentPosition++; 71 71 } 72 72 73 73 offsetX = indexBuffer.getUnsignedByte(); 74 74 offsetY = indexBuffer.getUnsignedByte(); 75 - width = indexBuffer.getUnsignedShort(); 76 - height = indexBuffer.getUnsignedShort(); 75 + width = indexBuffer.getUnsignedShortBE(); 76 + height = indexBuffer.getUnsignedShortBE(); 77 77 int type = indexBuffer.getUnsignedByte(); 78 78 int pixelCount = width * height; 79 79 this.pixels = new int[pixelCount];
+9 -9
src/com/jagex/runescape/cache/media/IndexedImage.java
··· 18 18 public IndexedImage(Archive archive, String archiveName, int offset) { 19 19 Buffer dataBuffer = new Buffer(archive.getFile(archiveName + ".dat")); 20 20 Buffer indexBuffer = new Buffer(archive.getFile("index.dat")); 21 - indexBuffer.currentPosition = dataBuffer.getUnsignedShort(); 22 - maxWidth = indexBuffer.getUnsignedShort(); 23 - maxHeight = indexBuffer.getUnsignedShort(); 21 + indexBuffer.currentPosition = dataBuffer.getUnsignedShortBE(); 22 + maxWidth = indexBuffer.getUnsignedShortBE(); 23 + maxHeight = indexBuffer.getUnsignedShortBE(); 24 24 int palleteLength = indexBuffer.getUnsignedByte(); 25 25 palette = new int[palleteLength]; 26 26 for (int index = 0; index < palleteLength - 1; index++) 27 - palette[index + 1] = indexBuffer.get24BitInt(); 27 + palette[index + 1] = indexBuffer.getMediumBE(); 28 28 29 29 for (int counter = 0; counter < offset; counter++) { 30 30 indexBuffer.currentPosition += 2; 31 - dataBuffer.currentPosition += indexBuffer.getUnsignedShort() * indexBuffer.getUnsignedShort(); 31 + dataBuffer.currentPosition += indexBuffer.getUnsignedShortBE() * indexBuffer.getUnsignedShortBE(); 32 32 indexBuffer.currentPosition++; 33 33 } 34 34 35 35 xDrawOffset = indexBuffer.getUnsignedByte(); 36 36 yDrawOffset = indexBuffer.getUnsignedByte(); 37 - width = indexBuffer.getUnsignedShort(); 38 - height = indexBuffer.getUnsignedShort(); 37 + width = indexBuffer.getUnsignedShortBE(); 38 + height = indexBuffer.getUnsignedShortBE(); 39 39 int type = indexBuffer.getUnsignedByte(); 40 40 int pixelLength = width * height; 41 41 pixels = new byte[pixelLength]; 42 42 if (type == 0) { 43 43 for (int pixel = 0; pixel < pixelLength; pixel++) 44 - pixels[pixel] = dataBuffer.getSignedByte(); 44 + pixels[pixel] = dataBuffer.getByte(); 45 45 46 46 return; 47 47 } 48 48 if (type == 1) { 49 49 for (int x = 0; x < width; x++) { 50 50 for (int y = 0; y < height; y++) 51 - pixels[x + y * width] = dataBuffer.getSignedByte(); 51 + pixels[x + y * width] = dataBuffer.getByte(); 52 52 53 53 } 54 54
+8 -8
src/com/jagex/runescape/cache/media/SpotAnimation.java
··· 24 24 25 25 public static void load(Archive archive) { 26 26 Buffer buffer = new Buffer(archive.getFile("spotanim.dat")); 27 - SpotAnimation.spotAnimationCount = buffer.getUnsignedShort(); 27 + SpotAnimation.spotAnimationCount = buffer.getUnsignedShortBE(); 28 28 if (SpotAnimation.cache == null) 29 29 SpotAnimation.cache = new SpotAnimation[SpotAnimation.spotAnimationCount]; 30 30 for (int spotAnimation = 0; spotAnimation < spotAnimationCount; spotAnimation++) { ··· 42 42 if (attributeId == 0) 43 43 return; 44 44 if (attributeId == 1) 45 - modelId = buffer.getUnsignedShort(); 45 + modelId = buffer.getUnsignedShortBE(); 46 46 else if (attributeId == 2) { 47 - animationId = buffer.getUnsignedShort(); 47 + animationId = buffer.getUnsignedShortBE(); 48 48 if (AnimationSequence.animations != null) 49 49 sequences = AnimationSequence.animations[animationId]; 50 50 } else if (attributeId == 4) 51 - resizeXY = buffer.getUnsignedShort(); 51 + resizeXY = buffer.getUnsignedShortBE(); 52 52 else if (attributeId == 5) 53 - resizeZ = buffer.getUnsignedShort(); 53 + resizeZ = buffer.getUnsignedShortBE(); 54 54 else if (attributeId == 6) 55 - rotation = buffer.getUnsignedShort(); 55 + rotation = buffer.getUnsignedShortBE(); 56 56 else if (attributeId == 7) 57 57 modelLightFalloff = buffer.getUnsignedByte(); 58 58 else if (attributeId == 8) 59 59 modelLightAmbient = buffer.getUnsignedByte(); 60 60 else if (attributeId >= 40 && attributeId < 50) 61 - originalModelColors[attributeId - 40] = buffer.getUnsignedShort(); 61 + originalModelColors[attributeId - 40] = buffer.getUnsignedShortBE(); 62 62 else if (attributeId >= 50 && attributeId < 60) 63 - modifiedModelColors[attributeId - 50] = buffer.getUnsignedShort(); 63 + modifiedModelColors[attributeId - 50] = buffer.getUnsignedShortBE(); 64 64 else 65 65 System.out.println("Error unrecognised spotanim config code: " + attributeId); 66 66 }
+5 -5
src/com/jagex/runescape/cache/media/TypeFace.java
··· 58 58 public TypeFace(boolean monospace, Archive archive, String archiveName) { 59 59 Buffer dataBuffer = new Buffer(archive.getFile(archiveName + ".dat")); 60 60 Buffer indexBuffer = new Buffer(archive.getFile("index.dat")); 61 - indexBuffer.currentPosition = dataBuffer.getUnsignedShort() + 4; 61 + indexBuffer.currentPosition = dataBuffer.getUnsignedShortBE() + 4; 62 62 int k = indexBuffer.getUnsignedByte(); 63 63 if (k > 0) 64 64 indexBuffer.currentPosition += 3 * (k - 1); 65 65 for (int character = 0; character < 256; character++) { 66 66 characterXOffsets[character] = indexBuffer.getUnsignedByte(); 67 67 characterYOffsets[character] = indexBuffer.getUnsignedByte(); 68 - int characterWidth = characterWidths[character] = indexBuffer.getUnsignedShort(); 69 - int characterHeight = characterHeights[character] = indexBuffer.getUnsignedShort(); 68 + int characterWidth = characterWidths[character] = indexBuffer.getUnsignedShortBE(); 69 + int characterHeight = characterHeights[character] = indexBuffer.getUnsignedShortBE(); 70 70 int characterType = indexBuffer.getUnsignedByte(); 71 71 int characterSize = characterWidth * characterHeight; 72 72 characterPixels[character] = new byte[characterSize]; 73 73 if (characterType == 0) { 74 74 for (int pixel = 0; pixel < characterSize; pixel++) 75 - characterPixels[character][pixel] = dataBuffer.getSignedByte(); 75 + characterPixels[character][pixel] = dataBuffer.getByte(); 76 76 77 77 } else if (characterType == 1) { 78 78 for (int characterX = 0; characterX < characterWidth; characterX++) { 79 79 for (int characterY = 0; characterY < characterHeight; characterY++) 80 - characterPixels[character][characterX + characterY * characterWidth] = dataBuffer.getSignedByte(); 80 + characterPixels[character][characterX + characterY * characterWidth] = dataBuffer.getByte(); 81 81 82 82 } 83 83
+30 -30
src/com/jagex/runescape/cache/media/Widget.java
··· 105 105 public static Widget forId(int id) { 106 106 if (interfaces[id] == null) { 107 107 Buffer buf = new Buffer(data[id]); 108 - int j = buf.getUnsignedShort(); 108 + int j = buf.getUnsignedShortBE(); 109 109 interfaces[id] = parse(j, buf, id); 110 110 } 111 111 return interfaces[id]; ··· 151 151 widget.parentId = parentId; 152 152 widget.type = buffer.getUnsignedByte(); 153 153 widget.actionType = buffer.getUnsignedByte(); 154 - widget.contentType = buffer.getUnsignedShort(); 155 - widget.width = buffer.getUnsignedShort(); 156 - widget.height = buffer.getUnsignedShort(); 154 + widget.contentType = buffer.getUnsignedShortBE(); 155 + widget.width = buffer.getUnsignedShortBE(); 156 + widget.height = buffer.getUnsignedShortBE(); 157 157 widget.alpha = (byte) buffer.getUnsignedByte(); 158 158 widget.hoveredPopup = buffer.getUnsignedByte(); 159 159 if (widget.hoveredPopup != 0) ··· 172 172 widget.conditionValues = new int[conditionCount]; 173 173 for (int condition = 0; condition < conditionCount; condition++) { 174 174 widget.conditionTypes[condition] = buffer.getUnsignedByte(); 175 - widget.conditionValues[condition] = buffer.getUnsignedShort(); 175 + widget.conditionValues[condition] = buffer.getUnsignedShortBE(); 176 176 } 177 177 178 178 } ··· 180 180 if (cs1length > 0) { 181 181 widget.cs1opcodes = new int[cs1length][]; 182 182 for (int blockIdx = 0; blockIdx < cs1length; blockIdx++) { 183 - int cs1blocklen = buffer.getUnsignedShort(); 183 + int cs1blocklen = buffer.getUnsignedShortBE(); 184 184 widget.cs1opcodes[blockIdx] = new int[cs1blocklen]; 185 185 for (int cs1opcIdx = 0; cs1opcIdx < cs1blocklen; cs1opcIdx++) 186 - widget.cs1opcodes[blockIdx][cs1opcIdx] = buffer.getUnsignedShort(); 186 + widget.cs1opcodes[blockIdx][cs1opcIdx] = buffer.getUnsignedShortBE(); 187 187 188 188 } 189 189 190 190 } 191 191 if (widget.type == 0) { 192 - widget.scrollLimit = buffer.getUnsignedShort(); 192 + widget.scrollLimit = buffer.getUnsignedShortBE(); 193 193 widget.hiddenUntilHovered = buffer.getUnsignedByte() == 1; 194 - int childrenCount = buffer.getUnsignedShort(); 194 + int childrenCount = buffer.getUnsignedShortBE(); 195 195 widget.children = new int[childrenCount]; 196 196 widget.childrenX = new int[childrenCount]; 197 197 widget.childrenY = new int[childrenCount]; 198 198 for (int child = 0; child < childrenCount; child++) { 199 - widget.children[child] = buffer.getUnsignedShort(); 200 - widget.childrenX[child] = buffer.getSignedShort(); 201 - widget.childrenY[child] = buffer.getSignedShort(); 199 + widget.children[child] = buffer.getUnsignedShortBE(); 200 + widget.childrenX[child] = buffer.getShortBE(); 201 + widget.childrenY[child] = buffer.getShortBE(); 202 202 } 203 203 204 204 } 205 205 if (widget.type == 1) { 206 - widget.unknownOne = buffer.getUnsignedShort(); 206 + widget.unknownOne = buffer.getUnsignedShortBE(); 207 207 widget.unknownTwo = buffer.getUnsignedByte() == 1; 208 208 } 209 209 if (widget.type == 2) { ··· 221 221 for (int sprite = 0; sprite < 20; sprite++) { 222 222 int hasSprite = buffer.getUnsignedByte(); 223 223 if (hasSprite == 1) { 224 - widget.imageX[sprite] = buffer.getSignedShort(); 225 - widget.imageY[sprite] = buffer.getSignedShort(); 224 + widget.imageX[sprite] = buffer.getShortBE(); 225 + widget.imageY[sprite] = buffer.getShortBE(); 226 226 String spriteName = buffer.getString(); 227 227 if (spriteName.length() > 0) { 228 228 int spriteId = spriteName.lastIndexOf(","); ··· 254 254 widget.enabledText = buffer.getString(); 255 255 } 256 256 if (widget.type == 1 || widget.type == 3 || widget.type == 4) 257 - widget.disabledColor = buffer.getInt(); 257 + widget.disabledColor = buffer.getIntBE(); 258 258 if (widget.type == 3 || widget.type == 4) { 259 - widget.enabledColor = buffer.getInt(); 260 - widget.disabledHoveredColor = buffer.getInt(); 261 - widget.enabledHoveredColor = buffer.getInt(); 259 + widget.enabledColor = buffer.getIntBE(); 260 + widget.disabledHoveredColor = buffer.getIntBE(); 261 + widget.enabledHoveredColor = buffer.getIntBE(); 262 262 } 263 263 if (widget.type == 5) { 264 264 String spriteName = buffer.getString(); ··· 295 295 widget.enabledAnimation = (widgetIndex - 1 << 8) + buffer.getUnsignedByte(); 296 296 else 297 297 widget.enabledAnimation = -1; 298 - widget.zoom = buffer.getUnsignedShort(); 299 - widget.rotationX = buffer.getUnsignedShort(); 300 - widget.rotationY = buffer.getUnsignedShort(); 298 + widget.zoom = buffer.getUnsignedShortBE(); 299 + widget.rotationX = buffer.getUnsignedShortBE(); 300 + widget.rotationY = buffer.getUnsignedShortBE(); 301 301 } 302 302 if (widget.type == 7) { 303 303 widget.items = new int[widget.width * widget.height]; ··· 307 307 if (fonts != null) 308 308 widget.typeFaces = fonts[typeFaceCount]; 309 309 widget.typeFaceShadowed = buffer.getUnsignedByte() == 1; 310 - widget.disabledColor = buffer.getInt(); 311 - widget.itemSpritePadsX = buffer.getSignedShort(); 312 - widget.itemSpritePadsY = buffer.getSignedShort(); 310 + widget.disabledColor = buffer.getIntBE(); 311 + widget.itemSpritePadsX = buffer.getShortBE(); 312 + widget.itemSpritePadsY = buffer.getShortBE(); 313 313 widget.isInventory = buffer.getUnsignedByte() == 1; 314 314 widget.options = new String[5]; 315 315 for (int optionId = 0; optionId < 5; optionId++) { ··· 324 324 if (widget.actionType == 2 || widget.type == 2) { 325 325 widget.optionCircumfix = buffer.getString(); 326 326 widget.optionText = buffer.getString(); 327 - widget.optionAttributes = buffer.getUnsignedShort(); 327 + widget.optionAttributes = buffer.getUnsignedShortBE(); 328 328 } 329 329 if (widget.actionType == 1 || widget.actionType == 4 || widget.actionType == 5 || widget.actionType == 6) { 330 330 widget.tooltip = buffer.getString(); ··· 348 348 Widget.mediaArchive = mediaArchive; 349 349 Widget.fonts = fonts; 350 350 int parentId = -1; 351 - int widgetCount = buffer.getUnsignedShort(); 351 + int widgetCount = buffer.getUnsignedShortBE(); 352 352 interfaces = new Widget[widgetCount]; 353 353 data = new byte[widgetCount][]; 354 354 while (buffer.currentPosition < buffer.buffer.length) { 355 - int widgetIndex = buffer.getUnsignedShort(); 355 + int widgetIndex = buffer.getUnsignedShortBE(); 356 356 if (widgetIndex == 65535) { 357 - parentId = buffer.getUnsignedShort(); 358 - widgetIndex = buffer.getUnsignedShort(); 357 + parentId = buffer.getUnsignedShortBE(); 358 + widgetIndex = buffer.getUnsignedShortBE(); 359 359 } 360 360 int i1 = buffer.currentPosition; 361 361 Widget widget = parse(parentId, buffer, widgetIndex);
+6 -6
src/com/jagex/runescape/media/Animation.java
··· 24 24 public static void method236(byte[] bs) { 25 25 Buffer buffer = new Buffer(bs); 26 26 buffer.currentPosition = bs.length - 8; 27 - int i = buffer.getUnsignedShort(); 28 - int j = buffer.getUnsignedShort(); 29 - int k = buffer.getUnsignedShort(); 30 - int l = buffer.getUnsignedShort(); 27 + int i = buffer.getUnsignedShortBE(); 28 + int j = buffer.getUnsignedShortBE(); 29 + int k = buffer.getUnsignedShortBE(); 30 + int l = buffer.getUnsignedShortBE(); 31 31 int i1 = 0; 32 32 Buffer buffer_5_ = new Buffer(bs); 33 33 buffer_5_.currentPosition = i1; ··· 44 44 Buffer buffer_9_ = new Buffer(bs); 45 45 buffer_9_.currentPosition = i1; 46 46 Skins skins = new Skins(buffer_9_); 47 - int animationAmount = buffer_5_.getUnsignedShort(); 47 + int animationAmount = buffer_5_.getUnsignedShortBE(); 48 48 int ai[] = new int[500]; 49 49 int ai1[] = new int[500]; 50 50 int ai2[] = new int[500]; 51 51 int ai3[] = new int[500]; 52 52 for (int k1 = 0; k1 < animationAmount; k1++) { 53 - int l1 = buffer_5_.getUnsignedShort(); 53 + int l1 = buffer_5_.getUnsignedShortBE(); 54 54 Animation animation = cache[l1] = new Animation(); 55 55 animation.anInt431 = class50_sub1_sub2_4.getUnsignedByte(); 56 56 animation.animationSkins = skins;
+11 -11
src/com/jagex/runescape/media/renderable/Model.java
··· 124 124 buffer.currentPosition = modelData.length - 18; 125 125 ModelHeader modelHeader = modelHeaders[modelId] = new ModelHeader(); 126 126 modelHeader.modelData = modelData; 127 - modelHeader.vertexCount = buffer.getUnsignedShort(); 128 - modelHeader.triangleCount = buffer.getUnsignedShort(); 127 + modelHeader.vertexCount = buffer.getUnsignedShortBE(); 128 + modelHeader.triangleCount = buffer.getUnsignedShortBE(); 129 129 modelHeader.texturedTriangleCount = buffer.getUnsignedByte(); 130 130 int useTextures = buffer.getUnsignedByte(); 131 131 int useTrianglePriority = buffer.getUnsignedByte(); 132 132 int useTransparency = buffer.getUnsignedByte(); 133 133 int useTriangleSkinning = buffer.getUnsignedByte(); 134 134 int useVertexSkinning = buffer.getUnsignedByte(); 135 - int xDataLength = buffer.getUnsignedShort(); 136 - int yDataLength = buffer.getUnsignedShort(); 137 - int zDataLength = buffer.getUnsignedShort(); 138 - int triangleDataLength = buffer.getUnsignedShort(); 135 + int xDataLength = buffer.getUnsignedShortBE(); 136 + int yDataLength = buffer.getUnsignedShortBE(); 137 + int zDataLength = buffer.getUnsignedShortBE(); 138 + int triangleDataLength = buffer.getUnsignedShortBE(); 139 139 int offset = 0; 140 140 modelHeader.vertexDirectionOffset = offset; 141 141 offset += modelHeader.vertexCount; ··· 292 292 zDataOffsetBuffer.currentPosition = modelHeader.triangleAlphaOffset; 293 293 vertexSkinOffsetBuffer.currentPosition = modelHeader.triangleSkinOffset; 294 294 for (int l1 = 0; l1 < triangleCount; l1++) { 295 - triangleColorValues[l1] = vertexDirectionOffsetBuffer.getUnsignedShort(); 295 + triangleColorValues[l1] = vertexDirectionOffsetBuffer.getUnsignedShortBE(); 296 296 if (triangleDrawType != null) { 297 297 triangleDrawType[l1] = xDataOffsetBuffer.getUnsignedByte(); 298 298 } ··· 356 356 357 357 vertexDirectionOffsetBuffer.currentPosition = modelHeader.uvMapTriangleOffset; 358 358 for (int triangle = 0; triangle < texturedTriangleCount; triangle++) { 359 - texturedTrianglePointsX[triangle] = vertexDirectionOffsetBuffer.getUnsignedShort(); 360 - texturedTrianglePointsY[triangle] = vertexDirectionOffsetBuffer.getUnsignedShort(); 361 - texturedTrianglePointsZ[triangle] = vertexDirectionOffsetBuffer.getUnsignedShort(); 359 + texturedTrianglePointsX[triangle] = vertexDirectionOffsetBuffer.getUnsignedShortBE(); 360 + texturedTrianglePointsY[triangle] = vertexDirectionOffsetBuffer.getUnsignedShortBE(); 361 + texturedTrianglePointsZ[triangle] = vertexDirectionOffsetBuffer.getUnsignedShortBE(); 362 362 } 363 363 364 364 } ··· 1966 1966 } 1967 1967 } 1968 1968 1969 - //TODO Some more missing class names 1969 + //TODO Some more missing class names
+12 -12
src/com/jagex/runescape/media/renderable/actor/Player.java
··· 263 263 public void updateAppearance(Buffer buffer) { 264 264 buffer.currentPosition = 0; 265 265 gender = buffer.getUnsignedByte(); 266 - isSkulled = buffer.getSignedByte(); 267 - headIcon = buffer.getSignedByte(); 266 + isSkulled = buffer.getByte(); 267 + headIcon = buffer.getByte(); 268 268 npcDefinition = null; 269 269 teamId = 0; 270 270 for (int index = 0; index < 12; index++) { ··· 276 276 int lowerByte = buffer.getUnsignedByte(); 277 277 appearance[index] = (upperByte << 8) + lowerByte; 278 278 if (index == 0 && appearance[0] == 65535) { 279 - npcDefinition = ActorDefinition.getDefinition(buffer.getUnsignedShort()); 279 + npcDefinition = ActorDefinition.getDefinition(buffer.getUnsignedShortBE()); 280 280 break; 281 281 } 282 282 if (appearance[index] >= 512 && appearance[index] - 512 < ItemDefinition.count) { ··· 293 293 appearanceColors[l] = j1; 294 294 } 295 295 296 - super.idleAnimation = buffer.getUnsignedShort(); 296 + super.idleAnimation = buffer.getUnsignedShortBE(); 297 297 if (super.idleAnimation == 65535) 298 298 super.idleAnimation = -1; 299 - super.standTurnAnimationId = buffer.getUnsignedShort(); 299 + super.standTurnAnimationId = buffer.getUnsignedShortBE(); 300 300 if (super.standTurnAnimationId == 65535) 301 301 super.standTurnAnimationId = -1; 302 - super.walkAnimationId = buffer.getUnsignedShort(); 302 + super.walkAnimationId = buffer.getUnsignedShortBE(); 303 303 if (super.walkAnimationId == 65535) 304 304 super.walkAnimationId = -1; 305 - super.turnAroundAnimationId = buffer.getUnsignedShort(); 305 + super.turnAroundAnimationId = buffer.getUnsignedShortBE(); 306 306 if (super.turnAroundAnimationId == 65535) 307 307 super.turnAroundAnimationId = -1; 308 - super.turnRightAnimationId = buffer.getUnsignedShort(); 308 + super.turnRightAnimationId = buffer.getUnsignedShortBE(); 309 309 if (super.turnRightAnimationId == 65535) 310 310 super.turnRightAnimationId = -1; 311 - super.turnLeftAnimationId = buffer.getUnsignedShort(); 311 + super.turnLeftAnimationId = buffer.getUnsignedShortBE(); 312 312 if (super.turnLeftAnimationId == 65535) 313 313 super.turnLeftAnimationId = -1; 314 - super.runAnimationId = buffer.getUnsignedShort(); 314 + super.runAnimationId = buffer.getUnsignedShortBE(); 315 315 if (super.runAnimationId == 65535) 316 316 super.runAnimationId = -1; 317 - playerName = TextUtils.formatName(TextUtils.longToName(buffer.getLong())); 317 + playerName = TextUtils.formatName(TextUtils.longToName(buffer.getLongBE())); 318 318 combatLevel = buffer.getUnsignedByte(); 319 - skillLevel = buffer.getUnsignedShort(); 319 + skillLevel = buffer.getUnsignedShortBE(); 320 320 visible = true; 321 321 appearanceHash = 0L; 322 322 int k1 = appearance[5];
+37 -38
src/com/jagex/runescape/net/Buffer.java
··· 69 69 buffer[currentPosition++] = (byte) value; 70 70 } 71 71 72 - public void putShort(int value) { 72 + public void putShortBE(int value) { 73 73 buffer[currentPosition++] = (byte) (value >> 8); 74 74 buffer[currentPosition++] = (byte) value; 75 75 } 76 76 77 - public void putLEShort(int value) { 77 + public void putShortLECopy(int value) { 78 78 buffer[currentPosition++] = (byte) value; 79 79 buffer[currentPosition++] = (byte) (value >> 8); 80 80 } 81 81 82 - public void putTriByte(int value) { 82 + public void putMediumBE(int value) { 83 83 buffer[currentPosition++] = (byte) (value >> 16); 84 84 buffer[currentPosition++] = (byte) (value >> 8); 85 85 buffer[currentPosition++] = (byte) value; 86 86 } 87 87 88 - public void putInt(int value) { 88 + public void putIntBE(int value) { 89 89 buffer[currentPosition++] = (byte) (value >> 24); 90 90 buffer[currentPosition++] = (byte) (value >> 16); 91 91 buffer[currentPosition++] = (byte) (value >> 8); 92 92 buffer[currentPosition++] = (byte) value; 93 93 } 94 94 95 - public void putLEInt(int value) { 95 + public void putIntLE(int value) { 96 96 buffer[currentPosition++] = (byte) value; 97 97 buffer[currentPosition++] = (byte) (value >> 8); 98 98 buffer[currentPosition++] = (byte) (value >> 16); 99 99 buffer[currentPosition++] = (byte) (value >> 24); 100 100 } 101 101 102 - public void putLong(long value) { 102 + public void putLongBE(long value) { 103 103 buffer[currentPosition++] = (byte) (int) (value >> 56); 104 104 buffer[currentPosition++] = (byte) (int) (value >> 48); 105 105 buffer[currentPosition++] = (byte) (int) (value >> 40); ··· 133 133 return buffer[currentPosition++] & 0xff; 134 134 } 135 135 136 - public byte getSignedByte() { 136 + public byte getByte() { 137 137 return buffer[currentPosition++]; 138 138 } 139 139 140 - public int getUnsignedShort() { 140 + public int getUnsignedShortBE() { 141 141 currentPosition += 2; 142 142 return ((buffer[currentPosition - 2] & 0xff) << 8) + (buffer[currentPosition - 1] & 0xff); 143 143 } 144 144 145 - public int getSignedShort() { 145 + public int getShortBE() { 146 146 currentPosition += 2; 147 147 int i = ((buffer[currentPosition - 2] & 0xff) << 8) + (buffer[currentPosition - 1] & 0xff); 148 148 if (i > 32767) ··· 150 150 return i; 151 151 } 152 152 153 - public int get24BitInt() { 153 + public int getMediumBE() { 154 154 currentPosition += 3; 155 155 return ((buffer[currentPosition - 3] & 0xff) << 16) + ((buffer[currentPosition - 2] & 0xff) << 8) 156 156 + (buffer[currentPosition - 1] & 0xff); 157 157 } 158 158 159 - public int getInt() { 159 + public int getIntBE() { 160 160 currentPosition += 4; 161 161 return ((buffer[currentPosition - 4] & 0xff) << 24) + ((buffer[currentPosition - 3] & 0xff) << 16) 162 162 + ((buffer[currentPosition - 2] & 0xff) << 8) + (buffer[currentPosition - 1] & 0xff); 163 163 } 164 164 165 - public long getLong() { 166 - long l = getInt() & 0xffffffffL; 167 - long l1 = getInt() & 0xffffffffL; 165 + public long getLongBE() { 166 + long l = getIntBE() & 0xffffffffL; 167 + long l1 = getIntBE() & 0xffffffffL; 168 168 return (l << 32) + l1; 169 169 } 170 170 ··· 218 218 if (peek < 128) 219 219 return getUnsignedByte() - 64; 220 220 else 221 - return getUnsignedShort() - 49152; 221 + return getUnsignedShortBE() - 49152; 222 222 } 223 223 224 224 public int getSmart() { ··· 226 226 if (peek < 128) 227 227 return getUnsignedByte(); 228 228 else 229 - return getUnsignedShort() - 32768; 229 + return getUnsignedShortBE() - 32768; 230 230 } 231 231 232 232 public void encrypt(BigInteger modulus, BigInteger key) { ··· 245 245 putBytes(bytes, 0, bytes.length); 246 246 } 247 247 248 - public void putByteAdded(int value) { 248 + public void putOffsetByte(int value) { 249 249 buffer[currentPosition++] = (byte) (value + 128); 250 250 } 251 251 252 - public void putByteNegated(int value) { 252 + public void putInvertedByte(int value) { 253 253 buffer[currentPosition++] = (byte) (-value); 254 254 } 255 255 256 - public void putByteSubtracted(int value) { 256 + public void putNegativeOffsetByte(int value) { 257 257 buffer[currentPosition++] = (byte) (128 - value); 258 258 } 259 259 260 - public int getByteAdded() { 260 + public int getUnsignedPostNegativeOffsetByte() { 261 261 return buffer[currentPosition++] - 128 & 0xff; 262 262 } 263 263 264 - public int getByteNegated() { 264 + public int getUnsignedInvertedByte() { 265 265 return -buffer[currentPosition++] & 0xff; 266 266 } 267 267 268 - public int getByteSubtracted() { 268 + public int getUnsignedPreNegativeOffsetByte() { 269 269 return 128 - buffer[currentPosition++] & 0xff; 270 270 } 271 271 272 - public byte getSignedByteAdded() { 272 + public byte getPostNegativeOffsetByte() { 273 273 return (byte) (buffer[currentPosition++] - 128); 274 274 } 275 275 276 - public byte getSignedByteNegated() { 276 + public byte getInvertedByte() { 277 277 return (byte) (-buffer[currentPosition++]); 278 278 } 279 279 280 - public byte getSignedByteSubtracted() { 280 + public byte getPreNegativeOffsetByte() { 281 281 return (byte) (128 - buffer[currentPosition++]); 282 282 } 283 283 284 - // TODO should we remove the duplication? 285 - public void putLEShortDup(int value) { 284 + public void putShortLE(int value) { 286 285 buffer[currentPosition++] = (byte) value; 287 286 buffer[currentPosition++] = (byte) (value >> 8); 288 287 } 289 288 290 - public void putShortAdded(int value) { 289 + public void putOffsetShortBE(int value) { 291 290 buffer[currentPosition++] = (byte) (value >> 8); 292 291 buffer[currentPosition++] = (byte) (value + 128); 293 292 } 294 293 295 - public void putLEShortAdded(int value) { 294 + public void putOffsetShortLE(int value) { 296 295 buffer[currentPosition++] = (byte) (value + 128); 297 296 buffer[currentPosition++] = (byte) (value >> 8); 298 297 } 299 298 300 - public int getUnsignedLEShort() { 299 + public int getUnsignedShortLE() { 301 300 currentPosition += 2; 302 301 return ((buffer[currentPosition - 1] & 0xff) << 8) + (buffer[currentPosition - 2] & 0xff); 303 302 } 304 303 305 - public int getShortUnsingedAdded() { 304 + public int getUnsignedNegativeOffsetShortBE() { 306 305 currentPosition += 2; 307 306 return ((buffer[currentPosition - 2] & 0xff) << 8) + (buffer[currentPosition - 1] - 128 & 0xff); 308 307 } 309 308 310 - public int getLittleShortA() { 309 + public int getUnsignedNegativeOffsetShortLE() { 311 310 currentPosition += 2; 312 311 return ((buffer[currentPosition - 1] & 0xff) << 8) + (buffer[currentPosition - 2] - 128 & 0xff); 313 312 } 314 313 315 - public int getLEShort() { 314 + public int getShortLE() { 316 315 currentPosition += 2; 317 316 int j = ((buffer[currentPosition - 1] & 0xff) << 8) + (buffer[currentPosition - 2] & 0xff); 318 317 if (j > 0x7fff) ··· 320 319 return j; 321 320 } 322 321 323 - public int getShortA() { 322 + public int getNegativeOffsetShortBE() { 324 323 currentPosition += 2; 325 324 int i = ((buffer[currentPosition - 2] & 0xff) << 8) + (buffer[currentPosition - 1] - 128 & 0xff); 326 325 if (i > 32767) ··· 328 327 return i; 329 328 } 330 329 331 - public int method554() { 330 + public int getMediumME() { 332 331 currentPosition += 3; 333 332 return ((buffer[currentPosition - 2] & 0xff) << 16) + ((buffer[currentPosition - 3] & 0xff) << 8) 334 333 + (buffer[currentPosition - 1] & 0xff); 335 334 } 336 335 337 - public int method555() { 336 + public int getIntLE() { 338 337 currentPosition += 4; 339 338 return ((buffer[currentPosition - 1] & 0xff) << 24) + ((buffer[currentPosition - 2] & 0xff) << 16) 340 339 + ((buffer[currentPosition - 3] & 0xff) << 8) + (buffer[currentPosition - 4] & 0xff); 341 340 } 342 341 343 - public int method556() { 342 + public int getIntME1() { 344 343 currentPosition += 4; 345 344 return ((buffer[currentPosition - 2] & 0xff) << 24) + ((buffer[currentPosition - 1] & 0xff) << 16) 346 345 + ((buffer[currentPosition - 4] & 0xff) << 8) + (buffer[currentPosition - 3] & 0xff); 347 346 } 348 347 349 - public int method557() { 348 + public int getIntME2() { 350 349 currentPosition += 4; 351 350 return ((buffer[currentPosition - 3] & 0xff) << 24) + ((buffer[currentPosition - 4] & 0xff) << 16) 352 351 + ((buffer[currentPosition - 1] & 0xff) << 8) + (buffer[currentPosition - 2] & 0xff);
+6 -6
src/com/jagex/runescape/net/requester/OnDemandRequester.java
··· 438 438 fileVersions[version] = new int[versionCount]; 439 439 filePriorities[version] = new byte[versionCount]; 440 440 for (int file = 0; file < versionCount; file++) 441 - fileVersions[version][file] = buffer.getUnsignedShort(); 441 + fileVersions[version][file] = buffer.getUnsignedShortBE(); 442 442 443 443 } 444 444 ··· 449 449 Buffer buffer = new Buffer(data); 450 450 fileCrc[crc] = new int[crcCount]; 451 451 for (int file = 0; file < crcCount; file++) 452 - fileCrc[crc][file] = buffer.getInt(); 452 + fileCrc[crc][file] = buffer.getIntBE(); 453 453 454 454 } 455 455 ··· 470 470 regLandIndex = new int[count]; 471 471 regShouldPreload = new int[count]; 472 472 for (int reg = 0; reg < count; reg++) { 473 - regHash[reg] = buffer.getUnsignedShort(); 474 - regMapIndex[reg] = buffer.getUnsignedShort(); 475 - regLandIndex[reg] = buffer.getUnsignedShort(); 473 + regHash[reg] = buffer.getUnsignedShortBE(); 474 + regMapIndex[reg] = buffer.getUnsignedShortBE(); 475 + regLandIndex[reg] = buffer.getUnsignedShortBE(); 476 476 regShouldPreload[reg] = buffer.getUnsignedByte(); 477 477 } 478 478 ··· 481 481 count = data.length / 2; 482 482 animIndex = new int[count]; 483 483 for (int i = 0; i < count; i++) 484 - animIndex[i] = buffer.getUnsignedShort(); 484 + animIndex[i] = buffer.getUnsignedShortBE(); 485 485 486 486 data = archive.getFile("midi_index"); 487 487 buffer = new Buffer(data);
+1 -1
src/com/jagex/runescape/scene/Region.java
··· 1251 1251 break; 1252 1252 } 1253 1253 if (i_278_ <= 49) { 1254 - overlayFloorIds[i_276_][i_275_][i_277_] = class50_sub1_sub2.getSignedByte(); 1254 + overlayFloorIds[i_276_][i_275_][i_277_] = class50_sub1_sub2.getByte(); 1255 1255 overlayClippingPaths[i_276_][i_275_][i_277_] = (byte) ((i_278_ - 2) / 4); 1256 1256 overlayRotations[i_276_][i_275_][i_277_] = (byte) (i_278_ - 2 + i_274_ & 0x3); 1257 1257 } else if (i_278_ <= 81)
+6 -6
src/com/jagex/runescape/sound/SoundFilter.java
··· 74 74 numPairs[0] = numPair >> 4; 75 75 numPairs[1] = numPair & 0xf; 76 76 if (numPair != 0) { 77 - unity[0] = buffer.getUnsignedShort(); 78 - unity[1] = buffer.getUnsignedShort(); 77 + unity[0] = buffer.getUnsignedShortBE(); 78 + unity[1] = buffer.getUnsignedShortBE(); 79 79 int migrated = buffer.getUnsignedByte(); 80 80 for (int dir = 0; dir < 2; dir++) { 81 81 for (int term = 0; term < numPairs[dir]; term++) { 82 - pairPhase[dir][0][term] = buffer.getUnsignedShort(); 83 - magnitude[dir][0][term] = buffer.getUnsignedShort(); 82 + pairPhase[dir][0][term] = buffer.getUnsignedShortBE(); 83 + magnitude[dir][0][term] = buffer.getUnsignedShortBE(); 84 84 } 85 85 86 86 } ··· 88 88 for (int dir = 0; dir < 2; dir++) { 89 89 for (int term = 0; term < numPairs[dir]; term++) 90 90 if ((migrated & 1 << dir * 4 << term) != 0) { 91 - pairPhase[dir][1][term] = buffer.getUnsignedShort(); 92 - magnitude[dir][1][term] = buffer.getUnsignedShort(); 91 + pairPhase[dir][1][term] = buffer.getUnsignedShortBE(); 92 + magnitude[dir][1][term] = buffer.getUnsignedShortBE(); 93 93 } else { 94 94 pairPhase[dir][1][term] = pairPhase[dir][0][term]; 95 95 magnitude[dir][1][term] = magnitude[dir][0][term];
+16 -16
src/com/jagex/runescape/sound/SoundTrack.java
··· 25 25 SoundTrack.buffer = new Buffer(SoundTrack._buffer); 26 26 SoundTrackInstrument.decode(); 27 27 while (true) { 28 - int trackId = buffer.getUnsignedShort(); 28 + int trackId = buffer.getUnsignedShortBE(); 29 29 if (trackId == 65535) 30 30 return; 31 31 SoundTrack.tracks[trackId] = new SoundTrack(-524); ··· 53 53 } 54 54 } 55 55 56 - loopBegin = buffer.getUnsignedShort(); 57 - loopEnd = buffer.getUnsignedShort(); 56 + loopBegin = buffer.getUnsignedShortBE(); 57 + loopEnd = buffer.getUnsignedShortBE(); 58 58 } 59 59 60 60 public int delay() { ··· 81 81 public Buffer encode(int j) { 82 82 int size = mix(j); 83 83 SoundTrack.buffer.currentPosition = 0; 84 - SoundTrack.buffer.putInt(0x52494646); // "RIFF" 85 - SoundTrack.buffer.putLEInt(36 + size); // chunk length 86 - SoundTrack.buffer.putInt(0x57415645); // "WAVE" (format) 87 - SoundTrack.buffer.putInt(0x666d7420); // "FMT " (subchunk id) 88 - SoundTrack.buffer.putLEInt(16); // subchunk size 89 - SoundTrack.buffer.putLEShort(1); // PCM 90 - SoundTrack.buffer.putLEShort(1); // channels (mono) 91 - SoundTrack.buffer.putLEInt(22050); // sample rate 92 - SoundTrack.buffer.putLEInt(22050); // byte rate 93 - SoundTrack.buffer.putLEShort(1); // block alignment 94 - SoundTrack.buffer.putLEShort(8); // bits per sample 95 - SoundTrack.buffer.putInt(0x64617461); // "DATA" (subchunk id) 96 - SoundTrack.buffer.putLEInt(size); // length 84 + SoundTrack.buffer.putIntBE(0x52494646); // "RIFF" 85 + SoundTrack.buffer.putIntLE(36 + size); // chunk length 86 + SoundTrack.buffer.putIntBE(0x57415645); // "WAVE" (format) 87 + SoundTrack.buffer.putIntBE(0x666d7420); // "FMT " (subchunk id) 88 + SoundTrack.buffer.putIntLE(16); // subchunk size 89 + SoundTrack.buffer.putShortLECopy(1); // PCM 90 + SoundTrack.buffer.putShortLECopy(1); // channels (mono) 91 + SoundTrack.buffer.putIntLE(22050); // sample rate 92 + SoundTrack.buffer.putIntLE(22050); // byte rate 93 + SoundTrack.buffer.putShortLECopy(1); // block alignment 94 + SoundTrack.buffer.putShortLECopy(8); // bits per sample 95 + SoundTrack.buffer.putIntBE(0x64617461); // "DATA" (subchunk id) 96 + SoundTrack.buffer.putIntLE(size); // length 97 97 SoundTrack.buffer.currentPosition += size; 98 98 return SoundTrack.buffer; 99 99 }
+4 -4
src/com/jagex/runescape/sound/SoundTrackEnvelope.java
··· 18 18 19 19 public void decode(Buffer buffer) { 20 20 form = buffer.getUnsignedByte(); 21 - smart = buffer.getInt(); 22 - end = buffer.getInt(); 21 + smart = buffer.getIntBE(); 22 + end = buffer.getIntBE(); 23 23 decodeShape(buffer); 24 24 } 25 25 ··· 28 28 phaseDuration = new int[numPhases]; 29 29 phasePeak = new int[numPhases]; 30 30 for (int phase = 0; phase < numPhases; phase++) { 31 - phaseDuration[phase] = buffer.getUnsignedShort(); 32 - phasePeak[phase] = buffer.getUnsignedShort(); 31 + phaseDuration[phase] = buffer.getUnsignedShortBE(); 32 + phasePeak[phase] = buffer.getUnsignedShortBE(); 33 33 } 34 34 35 35 }
+2 -2
src/com/jagex/runescape/sound/SoundTrackInstrument.java
··· 266 266 267 267 delayTime = buffer.getSmart(); 268 268 delayFeedback = buffer.getSmart(); 269 - soundMillis = buffer.getUnsignedShort(); 270 - pauseMillis = buffer.getUnsignedShort(); 269 + soundMillis = buffer.getUnsignedShortBE(); 270 + pauseMillis = buffer.getUnsignedShortBE(); 271 271 filter = new SoundFilter(); 272 272 filterEnvelope = new SoundTrackEnvelope(); 273 273 filter.decode(filterEnvelope, buffer);