From 8b01c6f6f0f626486584da5869ab978e5e3edbed Mon Sep 17 00:00:00 2001 From: Pazaz Date: Thu, 25 Apr 2024 03:21:00 -0400 Subject: [PATCH] refactor: Updated some field names to match server discoveries --- client/src/main/java/client.java | 160 +++++++++--------- .../src/main/java/jagex2/config/LocType.java | 44 ++--- .../src/main/java/jagex2/config/NpcType.java | 31 ++-- .../src/main/java/jagex2/config/ObjType.java | 28 +-- .../src/main/java/jagex2/config/SeqType.java | 18 +- client/src/main/java/jagex2/dash3d/World.java | 12 +- .../java/jagex2/dash3d/entity/NpcEntity.java | 2 +- .../jagex2/dash3d/entity/PlayerEntity.java | 10 +- .../src/main/java/jagex2/graphics/Draw3D.java | 14 +- 9 files changed, 165 insertions(+), 154 deletions(-) diff --git a/client/src/main/java/client.java b/client/src/main/java/client.java index 89ddd1e6..8e3b35c5 100644 --- a/client/src/main/java/client.java +++ b/client/src/main/java/client.java @@ -42,7 +42,7 @@ public class client extends GameShell { public int userTileMarkerIndex = 0; @OriginalMember(owner = "client!client", name = "E", descriptor = "I") - public static int opHeld1Counter; + public static int oplogic5; @OriginalMember(owner = "client!client", name = "F", descriptor = "Ljava/lang/String;") public static final String CHARSET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!\"£$%^&*()-_=+[{]};:'@#~,<.>/?\\| "; @@ -168,7 +168,7 @@ public class client extends GameShell { private byte[][] sceneMapLandData; @OriginalMember(owner = "client!client", name = "Ab", descriptor = "I") - public static int opLoc4Counter; + public static int oplogic1; @OriginalMember(owner = "client!client", name = "Bb", descriptor = "[I") private int[] friendWorld = new int[100]; @@ -231,7 +231,7 @@ public class client extends GameShell { private Packet in = Packet.alloc(1); @OriginalMember(owner = "client!client", name = "Zb", descriptor = "I") - public static int opNpc5Counter; + public static int oplogic4; @OriginalMember(owner = "client!client", name = "ac", descriptor = "Lclient!kb;") private Packet out = Packet.alloc(1); @@ -249,10 +249,10 @@ public class client extends GameShell { private int overrideChat; @OriginalMember(owner = "client!client", name = "gc", descriptor = "I") - public static int drawCounter; + public static int cyclelogic2; @OriginalMember(owner = "client!client", name = "ic", descriptor = "I") - public static int opHeld4Counter; + public static int oplogic3; @OriginalMember(owner = "client!client", name = "jc", descriptor = "[I") private final int[] skillLevel = new int[50]; @@ -393,7 +393,7 @@ public class client extends GameShell { private final int[] compassMaskLineOffsets = new int[33]; @OriginalMember(owner = "client!client", name = "hd", descriptor = "I") - public static int opLoc5Counter; + public static int oplogic6; @OriginalMember(owner = "client!client", name = "id", descriptor = "[I") private final int[] waveDelay = new int[50]; @@ -417,7 +417,7 @@ public class client extends GameShell { private boolean errorLoading = false; @OriginalMember(owner = "client!client", name = "rd", descriptor = "I") - public static int opNpc3Counter; + public static int oplogic2; @OriginalMember(owner = "client!client", name = "sd", descriptor = "I") private int lastHoveredInterfaceId; @@ -438,7 +438,7 @@ public class client extends GameShell { private int flameGradientCycle1; @OriginalMember(owner = "client!client", name = "Ad", descriptor = "I") - public static int opHeld9Counter; + public static int oplogic9; @OriginalMember(owner = "client!client", name = "Cd", descriptor = "[I") private final int[] messageIds = new int[100]; @@ -453,7 +453,7 @@ public class client extends GameShell { private boolean reportAbuseMuteOption = false; @OriginalMember(owner = "client!client", name = "Gd", descriptor = "I") - public static int sidebarInputCounter; + public static int cyclelogic1; @OriginalMember(owner = "client!client", name = "Id", descriptor = "Lclient!ob;") private LinkList spawnedLocations = new LinkList(); @@ -474,7 +474,7 @@ public class client extends GameShell { public static boolean lowMemory; @OriginalMember(owner = "client!client", name = "Od", descriptor = "I") - public static int opPlayer2Counter; + public static int oplogic8; @OriginalMember(owner = "client!client", name = "Pd", descriptor = "Lclient!ib;") private Pix8 imageRedstone1; @@ -537,7 +537,7 @@ public class client extends GameShell { private int hintType; @OriginalMember(owner = "client!client", name = "le", descriptor = "I") - public static int updatePlayersCounter; + public static int cyclelogic6; @OriginalMember(owner = "client!client", name = "me", descriptor = "I") private int orbitCameraX; @@ -606,7 +606,7 @@ public class client extends GameShell { private String modalMessage; @OriginalMember(owner = "client!client", name = "Je", descriptor = "I") - public static int ifButton5Counter; + public static int oplogic7; @OriginalMember(owner = "client!client", name = "Ke", descriptor = "[I") private int[] varps = new int[2000]; @@ -780,7 +780,7 @@ public class client extends GameShell { private Pix24 imageMapflag; @OriginalMember(owner = "client!client", name = "Tf", descriptor = "I") - public static int updateCounter; + public static int cyclelogic3; @OriginalMember(owner = "client!client", name = "Uf", descriptor = "Lclient!d;") private ClientStream stream; @@ -1035,7 +1035,7 @@ public class client extends GameShell { private int friendCount; @OriginalMember(owner = "client!client", name = "Hh", descriptor = "I") - public static int update2Counter; + public static int cyclelogic4; @OriginalMember(owner = "client!client", name = "Ih", descriptor = "I") private int chatCount; @@ -1083,7 +1083,7 @@ public class client extends GameShell { private final int[] LOC_KIND_TO_CLASS_ID = new int[] { 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3 }; @OriginalMember(owner = "client!client", name = "Zh", descriptor = "I") - public static int updateLocCounter; + public static int cyclelogic5; @OriginalMember(owner = "client!client", name = "ai", descriptor = "I") private int titleScreenState; @@ -2266,9 +2266,9 @@ private void drawScene() { int yaw = this.orbitCameraYaw + this.cameraAnticheatAngle & 0x7FF; this.orbitCamera(this.orbitCameraX, this.getHeightmapY(this.currentLevel, this.localPlayer.x, this.localPlayer.z) - 50, this.orbitCameraZ, yaw, pitch, pitch * 3 + 600); - drawCounter++; - if (drawCounter > 1802) { - drawCounter = 0; + cyclelogic2++; + if (cyclelogic2 > 1802) { + cyclelogic2 = 0; // ANTICHEAT_CYCLELOGIC2 this.out.p1isaac(146); this.out.p1(0); @@ -2575,8 +2575,8 @@ private void handleInterfaceInput(@OriginalArg(3) ComType com, @OriginalArg(1) i } else { if (child.interactable) { for (int op = 4; op >= 3; op--) { - if (obj.iops != null && obj.iops[op] != null) { - this.menuOption[this.menuSize] = obj.iops[op] + " @lre@" + obj.name; + if (obj.iop != null && obj.iop[op] != null) { + this.menuOption[this.menuSize] = obj.iop[op] + " @lre@" + obj.name; if (op == 3) { this.menuAction[this.menuSize] = 478; } else if (op == 4) { @@ -2606,10 +2606,10 @@ private void handleInterfaceInput(@OriginalArg(3) ComType com, @OriginalArg(1) i this.menuSize++; } - if (child.interactable && obj.iops != null) { + if (child.interactable && obj.iop != null) { for (int op = 2; op >= 0; op--) { - if (obj.iops[op] != null) { - this.menuOption[this.menuSize] = obj.iops[op] + " @lre@" + obj.name; + if (obj.iop[op] != null) { + this.menuOption[this.menuSize] = obj.iop[op] + " @lre@" + obj.name; if (op == 0) { this.menuAction[this.menuSize] = 405; } else if (op == 1) { @@ -2926,10 +2926,10 @@ private void addNpcOptions(@OriginalArg(0) NpcType npc, @OriginalArg(4) int a, @ this.menuSize++; } else if (this.spellSelected != 1) { @Pc(155) int type; - if (npc.ops != null) { + if (npc.op != null) { for (type = 4; type >= 0; type--) { - if (npc.ops[type] != null && !npc.ops[type].equalsIgnoreCase("attack")) { - this.menuOption[this.menuSize] = npc.ops[type] + " @yel@" + tooltip; + if (npc.op[type] != null && !npc.op[type].equalsIgnoreCase("attack")) { + this.menuOption[this.menuSize] = npc.op[type] + " @yel@" + tooltip; if (type == 0) { this.menuAction[this.menuSize] = 728; @@ -2951,15 +2951,15 @@ private void addNpcOptions(@OriginalArg(0) NpcType npc, @OriginalArg(4) int a, @ } } - if (npc.ops != null) { + if (npc.op != null) { for (type = 4; type >= 0; type--) { - if (npc.ops[type] != null && npc.ops[type].equalsIgnoreCase("attack")) { + if (npc.op[type] != null && npc.op[type].equalsIgnoreCase("attack")) { @Pc(279) short action = 0; if (npc.vislevel > this.localPlayer.combatLevel) { action = 2000; } - this.menuOption[this.menuSize] = npc.ops[type] + " @yel@" + tooltip; + this.menuOption[this.menuSize] = npc.op[type] + " @yel@" + tooltip; if (type == 0) { this.menuAction[this.menuSize] = action + 728; @@ -3640,7 +3640,7 @@ private void drawMinimap() { for (int i = 0; i < this.npcCount; i++) { @Pc(189) NpcEntity npc = this.npcs[this.npcIds[i]]; - if (npc != null && npc.isVisible() && npc.type.visonmap) { + if (npc != null && npc.isVisible() && npc.type.minimap) { anchorX = npc.x / 32 - this.localPlayer.x / 32; anchorY = npc.z / 32 - this.localPlayer.z / 32; this.drawOnMinimap(anchorY, this.imageMapdot1, anchorX); @@ -3703,9 +3703,9 @@ private void updateTemporaryLocs() { } } - updateLocCounter++; - if (updateLocCounter > 85) { - updateLocCounter = 0; + cyclelogic5++; + if (cyclelogic5 > 85) { + cyclelogic5 = 0; // ANTICHEAT_CYCLELOGIC5 this.out.p1isaac(85); } @@ -4847,7 +4847,7 @@ private void updateMovement(@OriginalArg(1) PathingEntity entity) { if (entity.primarySeqId != -1 && entity.primarySeqDelay == 0) { @Pc(28) SeqType seq = SeqType.instances[entity.primarySeqId]; - if (seq.labelGroups == null) { + if (seq.walkmerge == null) { entity.seqTrigger++; return; } @@ -5436,10 +5436,10 @@ private void useMenuOption(@OriginalArg(1) int optionId) { } else if (action == 405 || action == 38 || action == 422 || action == 478 || action == 347) { if (action == 478) { if ((b & 0x3) == 0) { - opHeld1Counter++; + oplogic5++; } - if (opHeld1Counter >= 90) { + if (oplogic5 >= 90) { // ANTICHEAT_OPLOGIC5 this.out.p1isaac(220); } @@ -5453,8 +5453,8 @@ private void useMenuOption(@OriginalArg(1) int optionId) { // OPHELD3 this.out.p1isaac(133); } else if (action == 405) { - opHeld4Counter += a; - if (opHeld4Counter >= 97) { + oplogic3 += a; + if (oplogic3 >= 97) { // ANTICHEAT_OPLOGIC3 this.out.p1isaac(30); this.out.p3(14953816); @@ -5497,10 +5497,10 @@ private void useMenuOption(@OriginalArg(1) int optionId) { this.out.p1isaac(8); } else if (action == 6) { if ((a & 0x3) == 0) { - opNpc3Counter++; + oplogic2++; } - if (opNpc3Counter >= 124) { + if (oplogic2 >= 124) { // ANTICHEAT_OPLOGIC2 this.out.p1isaac(88); this.out.p4(0); @@ -5516,10 +5516,10 @@ private void useMenuOption(@OriginalArg(1) int optionId) { this.out.p1isaac(194); } else if (action == 245) { if ((a & 0x3) == 0) { - opNpc5Counter++; + oplogic4++; } - if (opNpc5Counter >= 85) { + if (oplogic4 >= 85) { // ANTICHEAT_OPLOGIC4 this.out.p1isaac(176); this.out.p2(39596); @@ -5671,8 +5671,8 @@ private void useMenuOption(@OriginalArg(1) int optionId) { // OPPLAYER1 this.out.p1isaac(164); } else if (action == 151) { - opPlayer2Counter++; - if (opPlayer2Counter >= 90) { + oplogic8++; + if (oplogic8 >= 90) { // ANTICHEAT_OPLOGIC8 this.out.p1isaac(2); this.out.p2(31114); @@ -5825,10 +5825,10 @@ private void useMenuOption(@OriginalArg(1) int optionId) { this.out.p1isaac(212); } else if (action == 415) { if ((c & 0x3) == 0) { - ifButton5Counter++; + oplogic7++; } - if (ifButton5Counter >= 55) { + if (oplogic7 >= 55) { // ANTICHEAT_OPLOGIC7 this.out.p1isaac(17); this.out.p4(0); @@ -5841,10 +5841,10 @@ private void useMenuOption(@OriginalArg(1) int optionId) { this.out.p1isaac(31); } else if (action == 892) { if ((b & 0x3) == 0) { - opHeld9Counter++; + oplogic9++; } - if (opHeld9Counter >= 130) { + if (oplogic9 >= 130) { // ANTICHEAT_OPLOGIC9 this.out.p1isaac(238); this.out.p1(177); @@ -5875,10 +5875,10 @@ private void useMenuOption(@OriginalArg(1) int optionId) { } } else if (action == 581) { if ((a & 0x3) == 0) { - opLoc4Counter++; + oplogic1++; } - if (opLoc4Counter >= 99) { + if (oplogic1 >= 99) { // ANTICHEAT_OPLOGIC1 this.out.p1isaac(7); this.out.p4(0); @@ -5904,8 +5904,8 @@ private void useMenuOption(@OriginalArg(1) int optionId) { this.out.p2(a); this.out.p2(this.activeSpellId); } else if (action == 1501) { - opLoc5Counter += this.sceneBaseTileZ; - if (opLoc5Counter >= 92) { + oplogic6 += this.sceneBaseTileZ; + if (oplogic6 >= 92) { // ANTICHEAT_OPLOGIC6 this.out.p1isaac(66); this.out.p4(0); @@ -6458,7 +6458,7 @@ private boolean handleInterfaceAction(@OriginalArg(1) ComType com) { } if (clientCode == 326) { - // IF_DESIGN + // IF_PLAYERDESIGN this.out.p1isaac(52); this.out.p1(this.designGenderMale ? 0 : 1); for (int i = 0; i < 7; i++) { @@ -7732,15 +7732,16 @@ private void login(@OriginalArg(0) String username, @OriginalArg(1) String passw this.designColors[i] = 0; } - opLoc4Counter = 0; - opNpc3Counter = 0; - opHeld4Counter = 0; - opNpc5Counter = 0; - opHeld1Counter = 0; - opLoc5Counter = 0; - ifButton5Counter = 0; - opPlayer2Counter = 0; - opHeld9Counter = 0; + oplogic1 = 0; + oplogic2 = 0; + oplogic3 = 0; + oplogic4 = 0; + oplogic5 = 0; + oplogic6 = 0; + oplogic7 = 0; + oplogic8 = 0; + oplogic9 = 0; + this.prepareGameScreen(); } else if (reply == 3) { this.loginMessage0 = ""; @@ -8300,9 +8301,9 @@ private void updateGame() { } } - updateCounter++; - if (updateCounter > 127) { - updateCounter = 0; + cyclelogic3++; + if (cyclelogic3 > 127) { + cyclelogic3 = 0; // ANTICHEAT_CYCLELOGIC3 this.out.p1isaac(215); this.out.p3(4991788); @@ -8421,9 +8422,9 @@ private void updateGame() { this.minimapZoomModifier = -1; } - update2Counter++; - if (update2Counter > 110) { - update2Counter = 0; + cyclelogic4++; + if (cyclelogic4 > 110) { + cyclelogic4 = 0; // ANTICHEAT_CYCLELOGIC4 this.out.p1isaac(236); this.out.p4(0); @@ -9250,9 +9251,9 @@ private void handleTabInput() { this.redrawSideicons = true; } - sidebarInputCounter++; - if (sidebarInputCounter > 150) { - sidebarInputCounter = 0; + cyclelogic1++; + if (cyclelogic1 > 150) { + cyclelogic1 = 0; // ANTICHEAT_CYCLELOGIC1 this.out.p1isaac(233); this.out.p1(43); @@ -10017,10 +10018,10 @@ private void handleViewportOptions() { this.menuParamC[this.menuSize] = z; this.menuSize++; } else if (this.spellSelected != 1) { - if (loc.ops != null) { + if (loc.op != null) { for (int op = 4; op >= 0; op--) { - if (loc.ops[op] != null) { - this.menuOption[this.menuSize] = loc.ops[op] + " @cya@" + loc.name; + if (loc.op[op] != null) { + this.menuOption[this.menuSize] = loc.op[op] + " @cya@" + loc.name; if (op == 0) { this.menuAction[this.menuSize] = 285; } @@ -10123,8 +10124,8 @@ private void handleViewportOptions() { this.menuSize++; } else if (this.spellSelected != 1) { for (@Pc(695) int op = 4; op >= 0; op--) { - if (type.ops != null && type.ops[op] != null) { - this.menuOption[this.menuSize] = type.ops[op] + " @lre@" + type.name; + if (type.op != null && type.op[op] != null) { + this.menuOption[this.menuSize] = type.op[op] + " @lre@" + type.name; if (op == 0) { this.menuAction[this.menuSize] = 224; } @@ -10197,9 +10198,9 @@ private void updatePlayers() { } } - updatePlayersCounter++; - if (updatePlayersCounter > 1406) { - updatePlayersCounter = 0; + cyclelogic6++; + if (cyclelogic6 > 1406) { + cyclelogic6 = 0; // ANTICHEAT_CYCLELOGIC6 this.out.p1isaac(219); this.out.p1(0); @@ -10866,6 +10867,7 @@ private boolean read() { // FINISH_TRACKING @Pc(1701) Packet tracking = InputTracking.stop(); if (tracking != null) { + // EVENT_TRACKING this.out.p1isaac(81); this.out.p2(tracking.pos); this.out.pdata(tracking.data, tracking.pos, 0); diff --git a/client/src/main/java/jagex2/config/LocType.java b/client/src/main/java/jagex2/config/LocType.java index ce64420f..dd46f0c1 100644 --- a/client/src/main/java/jagex2/config/LocType.java +++ b/client/src/main/java/jagex2/config/LocType.java @@ -104,7 +104,7 @@ public class LocType { public int anim; @OriginalMember(owner = "client!ac", name = "y", descriptor = "I") - public int walloff; + public int wallwidth; @OriginalMember(owner = "client!ac", name = "z", descriptor = "B") private byte ambient; @@ -113,7 +113,7 @@ public class LocType { private byte contrast; @OriginalMember(owner = "client!ac", name = "B", descriptor = "[Ljava/lang/String;") - public String[] ops; + public String[] op; @OriginalMember(owner = "client!ac", name = "C", descriptor = "Z") private boolean disposeAlpha; @@ -140,13 +140,13 @@ public class LocType { private int resizez; @OriginalMember(owner = "client!ac", name = "K", descriptor = "I") - private int xoff; + private int offsetx; @OriginalMember(owner = "client!ac", name = "L", descriptor = "I") - private int yoff; + private int offsety; @OriginalMember(owner = "client!ac", name = "M", descriptor = "I") - private int zoff; + private int offsetz; @OriginalMember(owner = "client!ac", name = "N", descriptor = "I") public int forceapproach; @@ -223,10 +223,10 @@ public void reset() { this.sharelight = false; this.occlude = false; this.anim = -1; - this.walloff = 16; + this.wallwidth = 16; this.ambient = 0; this.contrast = 0; - this.ops = null; + this.op = null; this.disposeAlpha = false; this.mapfunction = -1; this.mapscene = -1; @@ -236,9 +236,9 @@ public void reset() { this.resizey = 128; this.resizez = 128; this.forceapproach = 0; - this.xoff = 0; - this.yoff = 0; - this.zoff = 0; + this.offsetx = 0; + this.offsety = 0; + this.offsetz = 0; this.forcedecor = false; } @@ -293,19 +293,19 @@ public void decode(@OriginalArg(1) Packet dat) { } else if (code == 25) { this.disposeAlpha = true; } else if (code == 28) { - this.walloff = dat.g1(); + this.wallwidth = dat.g1(); } else if (code == 29) { this.ambient = dat.g1b(); } else if (code == 39) { this.contrast = dat.g1b(); } else if (code >= 30 && code < 39) { - if (this.ops == null) { - this.ops = new String[5]; + if (this.op == null) { + this.op = new String[5]; } - this.ops[code - 30] = dat.gjstr(); - if (this.ops[code - 30].equalsIgnoreCase("hidden")) { - this.ops[code - 30] = null; + this.op[code - 30] = dat.gjstr(); + if (this.op[code - 30].equalsIgnoreCase("hidden")) { + this.op[code - 30] = null; } } else if (code == 40) { int count = dat.g1(); @@ -333,11 +333,11 @@ public void decode(@OriginalArg(1) Packet dat) { } else if (code == 69) { this.forceapproach = dat.g1(); } else if (code == 70) { - this.xoff = dat.g2b(); + this.offsetx = dat.g2b(); } else if (code == 71) { - this.yoff = dat.g2b(); + this.offsety = dat.g2b(); } else if (code == 72) { - this.zoff = dat.g2b(); + this.offsetz = dat.g2b(); } else if (code == 73) { this.forcedecor = true; } @@ -350,7 +350,7 @@ public void decode(@OriginalArg(1) Packet dat) { if (active == -1) { this.active = this.shapes.length > 0 && this.shapes[0] == 10; - if (this.ops != null) { + if (this.op != null) { this.active = true; } } @@ -429,7 +429,7 @@ public Model getModel(@OriginalArg(0) int shape, @OriginalArg(1) int rotation, @ } @Pc(235) boolean scaled = this.resizex != 128 || this.resizey != 128 || this.resizez != 128; - @Pc(250) boolean translated = this.xoff != 0 || this.yoff != 0 || this.zoff != 0; + @Pc(250) boolean translated = this.offsetx != 0 || this.offsety != 0 || this.offsetz != 0; @Pc(284) Model modified = new Model(model, this.recol_s == null, !this.disposeAlpha, rotation == 0 && transformId == -1 && !scaled && !translated); if (transformId != -1) { @@ -454,7 +454,7 @@ public Model getModel(@OriginalArg(0) int shape, @OriginalArg(1) int rotation, @ } if (translated) { - modified.translate(this.yoff, this.xoff, this.zoff); + modified.translate(this.offsety, this.offsetx, this.offsetz); } modified.calculateNormals(this.ambient + 64, this.contrast * 5 + 768, -50, -10, -50, !this.sharelight); diff --git a/client/src/main/java/jagex2/config/NpcType.java b/client/src/main/java/jagex2/config/NpcType.java index b4773b8e..66a8d7b7 100644 --- a/client/src/main/java/jagex2/config/NpcType.java +++ b/client/src/main/java/jagex2/config/NpcType.java @@ -70,19 +70,19 @@ public class NpcType { private int[] recol_d; @OriginalMember(owner = "client!bc", name = "u", descriptor = "[Ljava/lang/String;") - public String[] ops; + public String[] op; @OriginalMember(owner = "client!bc", name = "v", descriptor = "I") - private int code90 = -1; + private int resizex = -1; @OriginalMember(owner = "client!bc", name = "w", descriptor = "I") - private int code91 = -1; + private int resizey = -1; @OriginalMember(owner = "client!bc", name = "x", descriptor = "I") - private int code92 = -1; + private int resizez = -1; @OriginalMember(owner = "client!bc", name = "y", descriptor = "Z") - public boolean visonmap = true; + public boolean minimap = true; @OriginalMember(owner = "client!bc", name = "z", descriptor = "I") public int vislevel = -1; @@ -173,13 +173,13 @@ public void decode(@OriginalArg(1) Packet dat) { this.walkanim_r = dat.g2(); this.walkanim_l = dat.g2(); } else if (code >= 30 && code < 40) { - if (this.ops == null) { - this.ops = new String[5]; + if (this.op == null) { + this.op = new String[5]; } - this.ops[code - 30] = dat.gjstr(); - if (this.ops[code - 30].equalsIgnoreCase("hidden")) { - this.ops[code - 30] = null; + this.op[code - 30] = dat.gjstr(); + if (this.op[code - 30].equalsIgnoreCase("hidden")) { + this.op[code - 30] = null; } } else if (code == 40) { int count = dat.g1(); @@ -198,13 +198,16 @@ public void decode(@OriginalArg(1) Packet dat) { this.heads[i] = dat.g2(); } } else if (code == 90) { - this.code90 = dat.g2(); + // unused + this.resizex = dat.g2(); } else if (code == 91) { - this.code91 = dat.g2(); + // unused + this.resizey = dat.g2(); } else if (code == 92) { - this.code92 = dat.g2(); + // unused + this.resizez = dat.g2(); } else if (code == 93) { - this.visonmap = false; + this.minimap = false; } else if (code == 95) { this.vislevel = dat.g2(); } else if (code == 97) { diff --git a/client/src/main/java/jagex2/config/ObjType.java b/client/src/main/java/jagex2/config/ObjType.java index c7c645a3..c577a6c0 100644 --- a/client/src/main/java/jagex2/config/ObjType.java +++ b/client/src/main/java/jagex2/config/ObjType.java @@ -85,10 +85,10 @@ public class ObjType { public boolean members; @OriginalMember(owner = "client!cc", name = "B", descriptor = "[Ljava/lang/String;") - public String[] ops; + public String[] op; @OriginalMember(owner = "client!cc", name = "C", descriptor = "[Ljava/lang/String;") - public String[] iops; + public String[] iop; @OriginalMember(owner = "client!cc", name = "D", descriptor = "I") private int manwear; @@ -195,8 +195,8 @@ public static ObjType get(@OriginalArg(0) int id) { if (!membersWorld && obj.members) { obj.name = "Members Object"; obj.desc = "Login to a members' server to use this object."; - obj.ops = null; - obj.iops = null; + obj.op = null; + obj.iop = null; } return obj; @@ -326,8 +326,8 @@ public void reset() { this.stackable = false; this.cost = 1; this.members = false; - this.ops = null; - this.iops = null; + this.op = null; + this.iop = null; this.manwear = -1; this.manwear2 = -1; this.manwearOffsetY = 0; @@ -397,20 +397,20 @@ public void decode(@OriginalArg(1) Packet dat) { } else if (code == 26) { this.womanwear2 = dat.g2(); } else if (code >= 30 && code < 35) { - if (this.ops == null) { - this.ops = new String[5]; + if (this.op == null) { + this.op = new String[5]; } - this.ops[code - 30] = dat.gjstr(); - if (this.ops[code - 30].equalsIgnoreCase("hidden")) { - this.ops[code - 30] = null; + this.op[code - 30] = dat.gjstr(); + if (this.op[code - 30].equalsIgnoreCase("hidden")) { + this.op[code - 30] = null; } } else if (code >= 35 && code < 40) { - if (this.iops == null) { - this.iops = new String[5]; + if (this.iop == null) { + this.iop = new String[5]; } - this.iops[code - 35] = dat.gjstr(); + this.iop[code - 35] = dat.gjstr(); } else if (code == 40) { @Pc(260) int count = dat.g1(); this.recol_s = new int[count]; diff --git a/client/src/main/java/jagex2/config/SeqType.java b/client/src/main/java/jagex2/config/SeqType.java index 663b4825..0d9bfeba 100644 --- a/client/src/main/java/jagex2/config/SeqType.java +++ b/client/src/main/java/jagex2/config/SeqType.java @@ -33,7 +33,7 @@ public class SeqType { public int replayoff = -1; @OriginalMember(owner = "client!jc", name = "j", descriptor = "[I") - public int[] labelGroups; + public int[] walkmerge; @OriginalMember(owner = "client!jc", name = "k", descriptor = "Z") public boolean stretches = false; @@ -42,10 +42,10 @@ public class SeqType { public int priority = 5; @OriginalMember(owner = "client!jc", name = "m", descriptor = "I") - public int mainhand = -1; + public int righthand = -1; @OriginalMember(owner = "client!jc", name = "n", descriptor = "I") - public int offhand = -1; + public int lefthand = -1; @OriginalMember(owner = "client!jc", name = "o", descriptor = "I") public int replaycount = 99; @@ -103,21 +103,23 @@ public void decode(@OriginalArg(1) Packet dat) { this.replayoff = dat.g2(); } else if (code == 3) { int count = dat.g1(); - this.labelGroups = new int[count + 1]; + this.walkmerge = new int[count + 1]; for (@Pc(127) int i = 0; i < count; i++) { - this.labelGroups[i] = dat.g1(); + this.walkmerge[i] = dat.g1(); } - this.labelGroups[count] = 9999999; + this.walkmerge[count] = 9999999; } else if (code == 4) { this.stretches = true; } else if (code == 5) { this.priority = dat.g1(); } else if (code == 6) { - this.mainhand = dat.g2(); + // later RS (think RS3) this becomes mainhand + this.righthand = dat.g2(); } else if (code == 7) { - this.offhand = dat.g2(); + // later RS (think RS3) this becomes offhand + this.lefthand = dat.g2(); } else if (code == 8) { this.replaycount = dat.g1(); } else { diff --git a/client/src/main/java/jagex2/dash3d/World.java b/client/src/main/java/jagex2/dash3d/World.java index 8d9f9191..8393b861 100644 --- a/client/src/main/java/jagex2/dash3d/World.java +++ b/client/src/main/java/jagex2/dash3d/World.java @@ -317,7 +317,7 @@ public static void addLoc(@OriginalArg(7) int level, @OriginalArg(0) int x, @Ori width = scene.getWallBitset(level, x, z); if (width > 0) { - offset = LocType.get(width >> 14 & 0x7FFF).walloff; + offset = LocType.get(width >> 14 & 0x7FFF).wallwidth; } model2 = loc.getModel(LocType.WALLDECOR_STRAIGHT_NOOFFSET, 0, heightSW, heightSE, heightNW, heightNE, -1); @@ -644,8 +644,8 @@ private void addLoc(@OriginalArg(2) int level, @OriginalArg(9) int x, @OriginalA locs.addTail(new LocEntity(locId, level, 0, x, z, SeqType.instances[loc.anim], true)); } - if (loc.walloff != 16) { - scene.setWallDecorationOffset(level, x, z, loc.walloff); + if (loc.wallwidth != 16) { + scene.setWallDecorationOffset(level, x, z, loc.wallwidth); } } else if (shape == LocType.WALL_DIAGONALCORNER) { model = loc.getModel(LocType.WALL_DIAGONALCORNER, rotation, heightSW, heightSE, heightNW, heightNE, -1); @@ -700,8 +700,8 @@ private void addLoc(@OriginalArg(2) int level, @OriginalArg(9) int x, @OriginalA locs.addTail(new LocEntity(locId, level, 0, x, z, SeqType.instances[loc.anim], true)); } - if (loc.walloff != 16) { - scene.setWallDecorationOffset(level, x, z, loc.walloff); + if (loc.wallwidth != 16) { + scene.setWallDecorationOffset(level, x, z, loc.wallwidth); } } else if (shape == LocType.WALL_SQUARECORNER) { model = loc.getModel(LocType.WALL_SQUARECORNER, rotation, heightSW, heightSE, heightNW, heightNE, -1); @@ -748,7 +748,7 @@ private void addLoc(@OriginalArg(2) int level, @OriginalArg(9) int x, @OriginalA offset = 16; width = scene.getWallBitset(level, x, z); if (width > 0) { - offset = LocType.get(width >> 14 & 0x7FFF).walloff; + offset = LocType.get(width >> 14 & 0x7FFF).wallwidth; } model1 = loc.getModel(LocType.WALLDECOR_STRAIGHT_NOOFFSET, 0, heightSW, heightSE, heightNW, heightNE, -1); diff --git a/client/src/main/java/jagex2/dash3d/entity/NpcEntity.java b/client/src/main/java/jagex2/dash3d/entity/NpcEntity.java index ea5fa356..c33a5401 100644 --- a/client/src/main/java/jagex2/dash3d/entity/NpcEntity.java +++ b/client/src/main/java/jagex2/dash3d/entity/NpcEntity.java @@ -58,7 +58,7 @@ private Model getSequencedModel() { if (super.secondarySeqId >= 0 && super.secondarySeqId != super.seqStandId) { secondaryTransformId = SeqType.instances[super.secondarySeqId].frames[super.secondarySeqFrame]; } - return this.type.getSequencedModel(primaryTransformId, secondaryTransformId, SeqType.instances[super.primarySeqId].labelGroups); + return this.type.getSequencedModel(primaryTransformId, secondaryTransformId, SeqType.instances[super.primarySeqId].walkmerge); } int transformId = -1; diff --git a/client/src/main/java/jagex2/dash3d/entity/PlayerEntity.java b/client/src/main/java/jagex2/dash3d/entity/PlayerEntity.java index 20de2d77..db8856b8 100644 --- a/client/src/main/java/jagex2/dash3d/entity/PlayerEntity.java +++ b/client/src/main/java/jagex2/dash3d/entity/PlayerEntity.java @@ -273,13 +273,13 @@ private Model getSequencedModel() { secondaryTransformId = SeqType.instances[super.secondarySeqId].frames[super.secondarySeqFrame]; } - if (seq.mainhand >= 0) { - rightHandValue = seq.mainhand; + if (seq.righthand >= 0) { + rightHandValue = seq.righthand; hashCode += (long) rightHandValue - this.appearances[5] << 8; } - if (seq.offhand >= 0) { - leftHandValue = seq.offhand; + if (seq.lefthand >= 0) { + leftHandValue = seq.lefthand; hashCode += (long) leftHandValue - this.appearances[3] << 16; } } else if (super.secondarySeqId >= 0) { @@ -338,7 +338,7 @@ private Model getSequencedModel() { @Pc(249) Model tmp = new Model(model, true); if (primaryTransformId != -1 && secondaryTransformId != -1) { - tmp.applyTransforms(primaryTransformId, secondaryTransformId, SeqType.instances[super.primarySeqId].labelGroups); + tmp.applyTransforms(primaryTransformId, secondaryTransformId, SeqType.instances[super.primarySeqId].walkmerge); } else if (primaryTransformId != -1) { tmp.applyTransform(primaryTransformId); } diff --git a/client/src/main/java/jagex2/graphics/Draw3D.java b/client/src/main/java/jagex2/graphics/Draw3D.java index b61a031c..735ee4a5 100644 --- a/client/src/main/java/jagex2/graphics/Draw3D.java +++ b/client/src/main/java/jagex2/graphics/Draw3D.java @@ -34,7 +34,7 @@ public class Draw3D extends Draw2D { public static int[] reciprocal15 = new int[512]; @OriginalMember(owner = "client!gb", name = "I", descriptor = "[I") - public static final int[] reciprocal16 = new int[2048]; + public static int[] reciprocal16 = new int[2048]; @OriginalMember(owner = "client!gb", name = "J", descriptor = "[I") public static int[] sin = new int[2048]; @@ -96,7 +96,7 @@ public class Draw3D extends Draw2D { @OriginalMember(owner = "client!gb", name = "a", descriptor = "(Z)V") public static void unload() { reciprocal15 = null; - reciprocal15 = null; + reciprocal16 = null; // original typo: reciprocal15 = null; (yes twice) sin = null; cos = null; lineOffset = null; @@ -273,7 +273,8 @@ private static int[] getTexels(@OriginalArg(0) int id) { @OriginalMember(owner = "client!gb", name = "a", descriptor = "(ZD)V") public static void setBrightness(@OriginalArg(1) double brightness) { - @Pc(9) double randomBrightness = brightness + Math.random() * 0.03D - 0.015D; + @Pc(9) double randomized = brightness + Math.random() * 0.03D - 0.015D; + @Pc(11) int offset = 0; for (@Pc(13) int y = 0; y < 512; y++) { @Pc(24) double hue = (double) (y / 8) / 64.0D + 0.0078125D; @@ -331,16 +332,17 @@ public static void setBrightness(@OriginalArg(1) double brightness) { @Pc(264) int intG = (int) (g * 256.0D); @Pc(269) int intB = (int) (b * 256.0D); @Pc(279) int rgb = (intR << 16) + (intG << 8) + intB; - @Pc(283) int rgbAdjusted = setGamma(rgb, randomBrightness); + @Pc(283) int rgbAdjusted = setGamma(rgb, randomized); palette[offset++] = rgbAdjusted; } } + for (@Pc(298) int id = 0; id < 50; id++) { if (textures[id] != null) { @Pc(309) int[] palette = textures[id].palette; texturePalette[id] = new int[palette.length]; for (@Pc(317) int i = 0; i < palette.length; i++) { - texturePalette[id][i] = setGamma(palette[i], randomBrightness); + texturePalette[id][i] = setGamma(palette[i], randomized); } } } @@ -355,9 +357,11 @@ private static int setGamma(@OriginalArg(0) int rgb, @OriginalArg(1) double gamm @Pc(6) double r = (double) (rgb >> 16) / 256.0D; @Pc(15) double g = (double) (rgb >> 8 & 0xFF) / 256.0D; @Pc(22) double b = (double) (rgb & 0xFF) / 256.0D; + @Pc(26) double powR = Math.pow(r, gamma); @Pc(30) double powG = Math.pow(g, gamma); @Pc(34) double powB = Math.pow(b, gamma); + @Pc(39) int intR = (int) (powR * 256.0D); @Pc(44) int intG = (int) (powG * 256.0D); @Pc(49) int intB = (int) (powB * 256.0D);