From 1cfdc86a5ca3d1b3a8a229f474e9ee579e5a54ae Mon Sep 17 00:00:00 2001 From: Adam Date: Wed, 27 Apr 2022 09:22:27 -0400 Subject: [PATCH 01/12] clues: update guardian mummy cryptic clue --- .../runelite/client/plugins/cluescrolls/clues/CrypticClue.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/CrypticClue.java b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/CrypticClue.java index 785ffce336..b494082b01 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/CrypticClue.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/CrypticClue.java @@ -153,7 +153,7 @@ public class CrypticClue extends ClueScroll implements TextClueScroll, NpcClueSc new CrypticClue("Search the crates in the Port Sarim Fishing shop.", CRATE_9534, new WorldPoint(3012, 3222, 0), "Search the crates, by the door, in Gerrant's Fishy Business in Port Sarim."), new CrypticClue("Speak to The Lady of the Lake.", "The Lady of the Lake", new WorldPoint(2924, 3405, 0), "Talk to The Lady of the Lake in Taverley."), new CrypticClue("Rotting next to a ditch. Dig next to the fish.", new WorldPoint(3547, 3183, 0), "Dig next to a fishing spot on the south-east side of Burgh de Rott."), - new CrypticClue("The King's magic won't be wasted by me.", "Guardian mummy", new WorldPoint(1934, 4427, 0), "Talk to the Guardian mummy inside the Pyramid Plunder minigame in Sophanem."), + new CrypticClue("The King's magic shouldn't be wasted by me.", "Guardian mummy", new WorldPoint(1934, 4427, 0), "Talk to the Guardian mummy inside the Pyramid Plunder minigame in Sophanem."), new CrypticClue("Dig where the forces of Zamorak and Saradomin collide.", new WorldPoint(3049, 4839, 0), "Dig next to the law rift in the Abyss."), new CrypticClue("Search the boxes in the goblin house near Lumbridge.", BOXES, new WorldPoint(3245, 3245, 0), "Goblin house on the eastern side of the river outside of Lumbridge."), new CrypticClue("W marks the spot.", new WorldPoint(2867, 3546, 0), "Dig in the middle of the Warriors' Guild entrance hall."), From b6c2653a0e0d1e200e6a9dfdb4cbbfda039ad172 Mon Sep 17 00:00:00 2001 From: Max Weber Date: Wed, 27 Apr 2022 08:32:12 -0600 Subject: [PATCH 02/12] cache: correctly link bought & placeholder items this was causing bought items (bounds, league cabbages) to render incorrectly --- .../java/net/runelite/cache/ItemManager.java | 24 ++++++ .../cache/definitions/ItemDefinition.java | 81 ++++++++++++++++--- .../cache/item/ItemSpriteFactory.java | 7 +- .../cache/item/ItemSpriteFactoryTest.java | 1 + 4 files changed, 94 insertions(+), 19 deletions(-) diff --git a/cache/src/main/java/net/runelite/cache/ItemManager.java b/cache/src/main/java/net/runelite/cache/ItemManager.java index bff27593d6..8e05bc80eb 100644 --- a/cache/src/main/java/net/runelite/cache/ItemManager.java +++ b/cache/src/main/java/net/runelite/cache/ItemManager.java @@ -70,6 +70,30 @@ public class ItemManager implements ItemProvider } } + public void link() + { + for (ItemDefinition oc : items.values()) + { + link(oc); + } + } + + private void link(ItemDefinition item) + { + if (item.notedTemplate != -1) + { + item.linkNote(getItem(item.notedTemplate), getItem(item.notedID)); + } + if (item.boughtTemplateId != -1) + { + item.linkBought(getItem(item.boughtTemplateId), getItem(item.boughtId)); + } + if (item.placeholderTemplateId != -1) + { + item.linkPlaceholder(getItem(item.placeholderTemplateId), getItem(item.placeholderId)); + } + } + public Collection getItems() { return Collections.unmodifiableCollection(items.values()); diff --git a/cache/src/main/java/net/runelite/cache/definitions/ItemDefinition.java b/cache/src/main/java/net/runelite/cache/definitions/ItemDefinition.java index f918da5a54..ebd97409a0 100644 --- a/cache/src/main/java/net/runelite/cache/definitions/ItemDefinition.java +++ b/cache/src/main/java/net/runelite/cache/definitions/ItemDefinition.java @@ -60,19 +60,13 @@ public class ItemDefinition public int ambient; public int contrast; - + public int[] countCo; public int[] countObj; - public String[] options = new String[] - { - null, null, "Take", null, null - }; - - public String[] interfaceOptions = new String[] - { - null, null, null, null, "Drop" - }; + public String[] options = new String[]{null, null, "Take", null, null}; + + public String[] interfaceOptions = new String[]{null, null, null, null, "Drop"}; public int maleModel0 = -1; public int maleModel1 = -1; @@ -87,7 +81,7 @@ public class ItemDefinition public int femaleOffset; public int femaleHeadModel = -1; public int femaleHeadModel2 = -1; - + public int category; public int notedID = -1; @@ -99,13 +93,13 @@ public class ItemDefinition public int boughtId = -1; public int boughtTemplateId = -1; - + public int placeholderId = -1; public int placeholderTemplateId = -1; public Map params = null; - public void updateNote(ItemDefinition notedItem, ItemDefinition unnotedItem) + public void linkNote(ItemDefinition notedItem, ItemDefinition unnotedItem) { this.inventoryModel = notedItem.inventoryModel; this.zoom2d = notedItem.zoom2d; @@ -123,4 +117,65 @@ public class ItemDefinition this.cost = unnotedItem.cost; this.stackable = 1; } + + public void linkBought(ItemDefinition var1, ItemDefinition var2) + { + this.inventoryModel = var1.inventoryModel; + this.zoom2d = var1.zoom2d; + this.xan2d = var1.xan2d; + this.yan2d = var1.yan2d; + this.zan2d = var1.zan2d; + this.xOffset2d = var1.xOffset2d; + this.yOffset2d = var1.yOffset2d; + this.colorFind = var2.colorFind; + this.colorReplace = var2.colorReplace; + this.textureFind = var2.textureFind; + this.textureReplace = var2.textureReplace; + this.name = var2.name; + this.members = var2.members; + this.stackable = var2.stackable; + this.maleModel0 = var2.maleModel0; + this.maleModel1 = var2.maleModel1; + this.maleModel2 = var2.maleModel2; + this.femaleModel0 = var2.femaleModel0; + this.femaleModel1 = var2.femaleModel1; + this.femaleModel2 = var2.femaleModel2; + this.maleHeadModel = var2.maleHeadModel; + this.maleHeadModel2 = var2.maleHeadModel2; + this.femaleHeadModel = var2.femaleHeadModel; + this.femaleHeadModel2 = var2.femaleHeadModel2; + this.team = var2.team; + this.options = var2.options; + this.interfaceOptions = new String[5]; + if (var2.interfaceOptions != null) + { + for (int var3 = 0; var3 < 4; ++var3) + { + this.interfaceOptions[var3] = var2.interfaceOptions[var3]; + } + } + + this.interfaceOptions[4] = "Discard"; + this.cost = 0; + } + + public void linkPlaceholder(ItemDefinition var1, ItemDefinition var2) + { + this.inventoryModel = var1.inventoryModel; + this.zoom2d = var1.zoom2d; + this.xan2d = var1.xan2d; + this.yan2d = var1.yan2d; + this.zan2d = var1.zan2d; + this.xOffset2d = var1.xOffset2d; + this.yOffset2d = var1.yOffset2d; + this.colorFind = var1.colorFind; + this.colorReplace = var1.colorReplace; + this.textureFind = var1.textureFind; + this.textureReplace = var1.textureReplace; + this.stackable = var1.stackable; + this.name = var2.name; + this.cost = 0; + this.members = false; + this.isTradeable = false; + } } diff --git a/cache/src/main/java/net/runelite/cache/item/ItemSpriteFactory.java b/cache/src/main/java/net/runelite/cache/item/ItemSpriteFactory.java index cd70e9b218..6768f69f70 100644 --- a/cache/src/main/java/net/runelite/cache/item/ItemSpriteFactory.java +++ b/cache/src/main/java/net/runelite/cache/item/ItemSpriteFactory.java @@ -72,11 +72,6 @@ public class ItemSpriteFactory } } - if (item.notedTemplate != -1) - { - item.updateNote(itemProvider.provide(item.notedTemplate), itemProvider.provide(item.notedID)); - } - Model itemModel = getModel(modelProvider, item); if (itemModel == null) { @@ -96,7 +91,7 @@ public class ItemSpriteFactory else if (item.boughtTemplateId != -1) { auxSpritePixels = createSpritePixels(itemProvider, modelProvider, spriteProvider, textureProvider, - item.boughtId, quantity, border, shadowColor, false); + item.boughtId, quantity, border, 0, false); if (auxSpritePixels == null) { return null; diff --git a/cache/src/test/java/net/runelite/cache/item/ItemSpriteFactoryTest.java b/cache/src/test/java/net/runelite/cache/item/ItemSpriteFactoryTest.java index 30fb140a1b..86140bf4e8 100644 --- a/cache/src/test/java/net/runelite/cache/item/ItemSpriteFactoryTest.java +++ b/cache/src/test/java/net/runelite/cache/item/ItemSpriteFactoryTest.java @@ -67,6 +67,7 @@ public class ItemSpriteFactoryTest ItemManager itemManager = new ItemManager(store); itemManager.load(); + itemManager.link(); ModelProvider modelProvider = new ModelProvider() { From 4975781bd368c9876d9912b25f2dcd8f2fd5b7d7 Mon Sep 17 00:00:00 2001 From: Max Weber Date: Wed, 27 Apr 2022 09:22:20 -0600 Subject: [PATCH 03/12] cache: do not return partially or doubly lit textures --- .../net/runelite/cache/item/RSTextureProvider.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/cache/src/main/java/net/runelite/cache/item/RSTextureProvider.java b/cache/src/main/java/net/runelite/cache/item/RSTextureProvider.java index a38f14dce3..dfe885d504 100644 --- a/cache/src/main/java/net/runelite/cache/item/RSTextureProvider.java +++ b/cache/src/main/java/net/runelite/cache/item/RSTextureProvider.java @@ -69,13 +69,16 @@ public class RSTextureProvider TextureDefinition var2 = this.textures[var1]; if (var2 != null) { - if (var2.pixels != null) + synchronized (var2) { + if (var2.pixels != null) + { + return var2.pixels; + } + + var2.method2680(this.brightness, this.width, spriteProvider); return var2.pixels; } - - boolean var3 = var2.method2680(this.brightness, this.width, spriteProvider); - return var2.pixels; } return null; From bd1dc2d0b7271bc3b8bc9abc4fb9adbf4184ba5b Mon Sep 17 00:00:00 2001 From: Jordan Atwood Date: Sat, 23 Apr 2022 13:54:06 -0700 Subject: [PATCH 04/12] github: Add Discussions issue template This adds an issue form geared specifically toward bug reports, and links to GitHub discussions for feature requests and enhancements instead, with the mindset of improving intake triage. --- .github/CONTRIBUTING.md | 2 + .github/ISSUE_TEMPLATE/Bug_report.md | 32 ---------- .github/ISSUE_TEMPLATE/Feature_request.md | 19 ------ .github/ISSUE_TEMPLATE/bug-issue.yml | 74 +++++++++++++++++++++++ .github/ISSUE_TEMPLATE/config.yml | 8 +++ 5 files changed, 84 insertions(+), 51 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/Bug_report.md delete mode 100644 .github/ISSUE_TEMPLATE/Feature_request.md create mode 100644 .github/ISSUE_TEMPLATE/bug-issue.yml create mode 100644 .github/ISSUE_TEMPLATE/config.yml diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 8f0c7b7a03..1f4ad1a55d 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -45,6 +45,8 @@ Before you submit your pull request consider the following guidelines: * Search [GitHub](https://github.com/runelite/runelite/pulls) for an open or closed Pull Request that relates to your submission. You don't want to duplicate effort. +* If adding a feature or enhancement, we recommend you first [start a discussion for + it](https://github.com/runelite/runelite/discussions) before submitting a Pull Request. * [Fork](https://help.github.com/articles/fork-a-repo/) this repo. * [Clone](https://help.github.com/articles/cloning-a-repository/) your copy. ```shell diff --git a/.github/ISSUE_TEMPLATE/Bug_report.md b/.github/ISSUE_TEMPLATE/Bug_report.md deleted file mode 100644 index 219706327f..0000000000 --- a/.github/ISSUE_TEMPLATE/Bug_report.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -name: "\U0001F41B Bug report" -about: Create a report to help us improve - ---- - -Please check if your issue is not a duplicate by [searching existing issues](https://github.com/runelite/runelite/search?type=Issues) - -**Describe the bug** -A clear and concise description of what the bug is. - -**To Reproduce** -Steps to reproduce the behavior: -1. Go to '...' -2. Click on '....' -3. Scroll down to '....' -4. See error - -**Expected behavior** -A clear and concise description of what you expected to happen. - -**Screenshots** -If applicable, add screenshots to help explain your problem. - -**Environment (please complete the following information):** - - OS: [e.g. Windows, Ubuntu, macOS] - - RuneLite version: [e.g 1.4.6] - - Launcher version: [e.g 1.5.2] - -**Additional context** -Add any other context about the problem here, e.g. logs. Your client logs can usually be found in -`C:\Users\\.runelite\logs` on Windows and `~/.runelite/logs` on Linux and macOS. diff --git a/.github/ISSUE_TEMPLATE/Feature_request.md b/.github/ISSUE_TEMPLATE/Feature_request.md deleted file mode 100644 index 57cf66a8dd..0000000000 --- a/.github/ISSUE_TEMPLATE/Feature_request.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -name: "\U0001F680 Feature Request" -about: Suggest an idea for this project - ---- - -**Is your feature request related to a problem? Please describe.** -A clear and concise description of what the problem is. Ex. I'm always -frustrated when [...] - -**Describe the solution you'd like** -A clear and concise description of what you want to happen. - -**Describe alternatives you've considered** -A clear and concise description of any alternative solutions or features you've -considered. - -**Additional context** -Add any other context or screenshots about the feature request here. diff --git a/.github/ISSUE_TEMPLATE/bug-issue.yml b/.github/ISSUE_TEMPLATE/bug-issue.yml new file mode 100644 index 0000000000..2a1a89575b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug-issue.yml @@ -0,0 +1,74 @@ +name: Bug Report +description: Report a clearly broken issue. +labels: ["needs-triage"] +body: + - type: markdown + attributes: + value: | + # RuneLite bug report + + Before filing a bug report, please check whether your issue has been reported before: + - Read the pinned issues (if any) at the top of https://github.com/runelite/runelite/issues. + - Search for your issue in both [the issue listing](https://github.com/runelite/runelite/issues) and the [Q&A discussion listing](https://github.com/runelite/runelite/discussions/categories/q-a). If you find that it already exists, respond with a reaction or add any further information that may be helpful. + - type: dropdown + attributes: + label: Type + options: + - Crash or hang + - Incorrect behavior + - Performance + - GPU + - Other + validations: + required: true + - type: dropdown + attributes: + label: Operating System + options: + - Windows + - MacOS + - Linux + validations: + required: false + - type: input + attributes: + label: OS Version + description: Version information for your operating system, ex. Windows 11, MacOS Big Sur, Ubuntu Linux, etc. + validations: + required: false + - type: textarea + attributes: + label: Bug description + description: How did you find the bug? Any additional details that might help? + validations: + required: true + - type: textarea + attributes: + label: Screenshots or videos + description: Add screenshots or videos that show the bug here. + validations: + required: false + - type: textarea + attributes: + label: RuneLite version + description: RuneLite and launcher version used. (Open the info panel to find this information) + placeholder: | + RuneLite version: 1.8.18.1 + Launcher version: 2.4.2 + - type: markdown + attributes: + value: | + ## Logs + + Attaching log files is encouraged for reported bugs. You can find them in one of two ways: + + 1. Open the screenshot directory (by right-clicking the \"Camera\" button if you have access to the client) and navigate one directory up and then open logs folder + 2. Navigate to `%userprofile%\.runelite\logs` on **Windows** or `$HOME/.runelite/logs` on **Linux** and **MacOS** + + You should upload both your `client.log` and `launcher.log` files, along with recently-created `jvm_crash_pid` files if this bug report is regarding the client crashing. + - type: textarea + attributes: + label: Logs + placeholder: Drag and drop log files into this box. + validations: + required: false diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000000..6cde237beb --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,8 @@ +blank_issues_enabled: false +contact_links: + - name: Suggestion or feature request + url: https://github.com/runelite/runelite/discussions/categories/ideas + about: Got an idea of something which should be changed or added? Search for or start a new discussion! + - name: Help + url: https://github.com/runelite/runelite/discussions/categories/q-a + about: Need support or think you've encountered a bug? Check the Q&A section! From e9474a86bb3d2d86e06f9f6b2a6651c0fd8f17f7 Mon Sep 17 00:00:00 2001 From: Adam Date: Wed, 27 Apr 2022 15:54:09 -0400 Subject: [PATCH 05/12] fairy ring: add Necropolis --- .../java/net/runelite/client/plugins/fairyring/FairyRings.java | 1 + 1 file changed, 1 insertion(+) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/fairyring/FairyRings.java b/runelite-client/src/main/java/net/runelite/client/plugins/fairyring/FairyRings.java index cf4f2456da..5fd9f83c3a 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/fairyring/FairyRings.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/fairyring/FairyRings.java @@ -36,6 +36,7 @@ public enum FairyRings AJQ("Cave south of Dorgesh-Kaan"), AJR("Slayer cave"), AJS("Penguins near Miscellania"), + AKP("Necropolis"), AKQ("Piscatoris Hunter area"), AKS("Feldip Hunter area"), ALP("(Island) Lighthouse"), From 8ac8cd3cdd17130426bc9bbba2de060d2fd0fd21 Mon Sep 17 00:00:00 2001 From: Adam Date: Wed, 27 Apr 2022 16:28:45 -0400 Subject: [PATCH 06/12] clues: add Necropolis mine coordinate clue hint --- .../client/plugins/cluescrolls/clues/CoordinateClue.java | 1 + 1 file changed, 1 insertion(+) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/CoordinateClue.java b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/CoordinateClue.java index 2f55fd4d79..08e5f9ba08 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/CoordinateClue.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/CoordinateClue.java @@ -218,6 +218,7 @@ public class CoordinateClue extends ClueScroll implements TextClueScroll, Locati .put(new WorldPoint(2318, 2954, 0), new CoordinateClueInfo("North-east corner of the Isle of Souls.", BANDOSIAN_GUARD)) .put(new WorldPoint(2094, 2889, 0), new CoordinateClueInfo("West side of the Isle of Souls.", ARMADYLEAN_GUARD)) .put(new WorldPoint(1451, 3509, 0), new CoordinateClueInfo("Ruins of Morra.", ARMADYLEAN_OR_BANDOSIAN_GUARD)) + .put(new WorldPoint(3318, 2706, 0), new CoordinateClueInfo("Necropolis mine", ARMADYLEAN_OR_BANDOSIAN_GUARD)) // Master .put(new WorldPoint(2178, 3209, 0), new CoordinateClueInfo("South of Iorwerth Camp.", BRASSICAN_MAGE)) .put(new WorldPoint(2155, 3100, 0), new CoordinateClueInfo("South of Port Tyras (BJS if 76 Agility).", BRASSICAN_MAGE)) From bed28462a3f831fbb82c71db50cd947b2740f6ad Mon Sep 17 00:00:00 2001 From: JoRouss Date: Mon, 25 Apr 2022 01:59:40 -0400 Subject: [PATCH 07/12] dps counter: fix only boss damage to work in parties When in a party, "Only boss damage" would work only if everyone in the party had it setup the same. Members who had it enabled would not send their hit to those who had it disabled. Members who had it enabled would receive and count hits from those who had it disabled. --- .../plugins/dpscounter/DpsCounterPlugin.java | 34 +++++++++++-------- .../client/plugins/dpscounter/DpsUpdate.java | 2 ++ 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/dpscounter/DpsCounterPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/dpscounter/DpsCounterPlugin.java index fd66d3c91a..d158b151a7 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/dpscounter/DpsCounterPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/dpscounter/DpsCounterPlugin.java @@ -186,36 +186,36 @@ public class DpsCounterPlugin extends Plugin Hitsplat hitsplat = hitsplatApplied.getHitsplat(); + final int npcId = ((NPC) actor).getId(); + final boolean isBoss = BOSSES.contains(npcId); + if (hitsplat.isMine()) { - final int npcId = ((NPC) actor).getId(); - boolean isBoss = BOSSES.contains(npcId); + int hit = hitsplat.getAmount(); + PartyMember localMember = partyService.getLocalMember(); + + // broadcast damage + if (localMember != null) + { + final DpsUpdate dpsUpdate = new DpsUpdate(hit, isBoss); + dpsUpdate.setMemberId(localMember.getMemberId()); + wsClient.send(dpsUpdate); + } + if (dpsConfig.bossDamage() && !isBoss) { return; } - int hit = hitsplat.getAmount(); - // Update local member - PartyMember localMember = partyService.getLocalMember(); // If not in a party, user local player name final String name = localMember == null ? player.getName() : localMember.getName(); DpsMember dpsMember = members.computeIfAbsent(name, DpsMember::new); dpsMember.addDamage(hit); - // broadcast damage - if (localMember != null) - { - final DpsUpdate specialCounterUpdate = new DpsUpdate(hit); - specialCounterUpdate.setMemberId(localMember.getMemberId()); - wsClient.send(specialCounterUpdate); - } // apply to total } else if (hitsplat.isOthers()) { - final int npcId = ((NPC) actor).getId(); - boolean isBoss = BOSSES.contains(npcId); if ((dpsConfig.bossDamage() || actor != player.getInteracting()) && !isBoss) { // only track damage to npcs we are attacking, or is a nearby common boss @@ -246,6 +246,12 @@ public class DpsCounterPlugin extends Plugin return; } + // Received non-boss damage, but we only want boss damage + if (!dpsUpdate.isBoss() && dpsConfig.bossDamage()) + { + return; + } + unpause(); DpsMember dpsMember = members.computeIfAbsent(name, DpsMember::new); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/dpscounter/DpsUpdate.java b/runelite-client/src/main/java/net/runelite/client/plugins/dpscounter/DpsUpdate.java index 81e5859b38..ee1b652c34 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/dpscounter/DpsUpdate.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/dpscounter/DpsUpdate.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2020 Adam + * Copyright (c) 2021, Jonathan Rousseau * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -33,4 +34,5 @@ import net.runelite.http.api.ws.messages.party.PartyMemberMessage; public class DpsUpdate extends PartyMemberMessage { private int hit; + private boolean isBoss; } From 1eda2c3658d2993c2f2fe9f1066abbf02c70ca49 Mon Sep 17 00:00:00 2001 From: Max Weber Date: Thu, 28 Apr 2022 13:19:42 -0600 Subject: [PATCH 08/12] rl-api: expose ObjectComposition::varbitId/varPlayerId --- .../net/runelite/api/ObjectComposition.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/runelite-api/src/main/java/net/runelite/api/ObjectComposition.java b/runelite-api/src/main/java/net/runelite/api/ObjectComposition.java index 1d0357b78a..1aa69b6082 100644 --- a/runelite-api/src/main/java/net/runelite/api/ObjectComposition.java +++ b/runelite-api/src/main/java/net/runelite/api/ObjectComposition.java @@ -24,6 +24,8 @@ */ package net.runelite.api; +import net.runelite.api.annotations.Varbit; + /** * Information about a specific {@link ObjectID} */ @@ -73,4 +75,21 @@ public interface ObjectComposition extends ParamHolder * @throws NullPointerException if {@link #getImpostorIds()} is null */ ObjectComposition getImpostor(); + + /** + * Gets the {@link Varbits} used to switch this multiloc, or {@code -1} if this is not switched by a Varbit + * + * @see #getImpostor() + * @see #getImpostorIds() + */ + @Varbit + int getVarbitId(); + + /** + * Gets the {@link VarPlayer} used to switch this multiloc, or {@code -1} if this is not switched by a VarPlayer + * + * @see #getImpostor() + * @see #getImpostorIds() + */ + int getVarPlayerId(); } From c40b33a1e988b344f3e59ff2659cf26cfb752422 Mon Sep 17 00:00:00 2001 From: Adam Date: Thu, 28 Apr 2022 18:56:00 -0400 Subject: [PATCH 09/12] Don't overwrite okhttp ua if already set If the request has its own UA set, don't overwrite it with the default RuneLite one. This has to be an interceptor and not a network interceptor so that it runs prior to the okhttp BridgeInteceptor, which is what sets the default okhttp ua. --- .../src/main/java/net/runelite/client/RuneLite.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/RuneLite.java b/runelite-client/src/main/java/net/runelite/client/RuneLite.java index b338cbd981..dc3ab7a24d 100644 --- a/runelite-client/src/main/java/net/runelite/client/RuneLite.java +++ b/runelite-client/src/main/java/net/runelite/client/RuneLite.java @@ -434,9 +434,15 @@ public class RuneLite { OkHttpClient.Builder builder = new OkHttpClient.Builder() .pingInterval(30, TimeUnit.SECONDS) - .addNetworkInterceptor(chain -> + .addInterceptor(chain -> { - Request userAgentRequest = chain.request() + Request request = chain.request(); + if (request.header("User-Agent") != null) + { + return chain.proceed(request); + } + + Request userAgentRequest = request .newBuilder() .header("User-Agent", USER_AGENT) .build(); From 936f83793de72b7bbc5fe3bff39fb30b00ba4b90 Mon Sep 17 00:00:00 2001 From: Owain van Brakel Date: Fri, 29 Apr 2022 08:28:20 +0200 Subject: [PATCH 10/12] project: Fix merge --- .../main/java/net/runelite/cache/item/ItemSpriteFactory.java | 4 ---- .../src/main/java/net/runelite/api/ObjectComposition.java | 5 ++--- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/cache/src/main/java/net/runelite/cache/item/ItemSpriteFactory.java b/cache/src/main/java/net/runelite/cache/item/ItemSpriteFactory.java index 16147b1a97..dbbfb08404 100644 --- a/cache/src/main/java/net/runelite/cache/item/ItemSpriteFactory.java +++ b/cache/src/main/java/net/runelite/cache/item/ItemSpriteFactory.java @@ -91,11 +91,7 @@ public class ItemSpriteFactory else if (item.boughtTemplateId != -1) { auxSpritePixels = createSpritePixels(itemProvider, modelProvider, spriteProvider, textureProvider, -<<<<<<< HEAD - item.boughtId, quantity, border, shadowColor, false); -======= item.boughtId, quantity, border, 0, false); ->>>>>>> runelite/master if (auxSpritePixels == null) { return null; diff --git a/runelite-api/src/main/java/net/runelite/api/ObjectComposition.java b/runelite-api/src/main/java/net/runelite/api/ObjectComposition.java index 11e2e72f2a..76aea5c25f 100644 --- a/runelite-api/src/main/java/net/runelite/api/ObjectComposition.java +++ b/runelite-api/src/main/java/net/runelite/api/ObjectComposition.java @@ -77,12 +77,12 @@ public interface ObjectComposition extends ParamHolder ObjectComposition getImpostor(); /** -<<<<<<< HEAD * Get the bitmask that contains information on which directions you can interact * with this object from. */ int getAccessBitMask(); -======= + + /** * Gets the {@link Varbits} used to switch this multiloc, or {@code -1} if this is not switched by a Varbit * * @see #getImpostor() @@ -98,5 +98,4 @@ public interface ObjectComposition extends ParamHolder * @see #getImpostorIds() */ int getVarPlayerId(); ->>>>>>> runelite/master } From 96a5e68c15a43f83b506d8ebf6d4337f145cbb84 Mon Sep 17 00:00:00 2001 From: Owain van Brakel Date: Fri, 29 Apr 2022 08:28:57 +0200 Subject: [PATCH 11/12] project(mixins): Fix formatting --- .../mixins/RSObjectCompositionMixin.java | 177 ++++++++++++++---- 1 file changed, 142 insertions(+), 35 deletions(-) diff --git a/runelite-mixins/src/main/java/net/runelite/mixins/RSObjectCompositionMixin.java b/runelite-mixins/src/main/java/net/runelite/mixins/RSObjectCompositionMixin.java index 64dc949aba..382398027e 100644 --- a/runelite-mixins/src/main/java/net/runelite/mixins/RSObjectCompositionMixin.java +++ b/runelite-mixins/src/main/java/net/runelite/mixins/RSObjectCompositionMixin.java @@ -2,7 +2,12 @@ package net.runelite.mixins; import net.runelite.api.IterableHashTable; import net.runelite.api.Node; -import net.runelite.api.mixins.*; +import net.runelite.api.mixins.Copy; +import net.runelite.api.mixins.Inject; +import net.runelite.api.mixins.MethodHook; +import net.runelite.api.mixins.Mixin; +import net.runelite.api.mixins.Replace; +import net.runelite.api.mixins.Shadow; import net.runelite.rs.api.RSBuffer; import net.runelite.rs.api.RSClient; import net.runelite.rs.api.RSEvictingDualNodeHashTable; @@ -66,7 +71,10 @@ public abstract class RSObjectCompositionMixin implements RSObjectComposition } } } - else if (opcode == 2) setName(buffer.readStringCp1252NullTerminated()); + else if (opcode == 2) + { + setName(buffer.readStringCp1252NullTerminated()); + } else if (opcode == 5) { var3 = buffer.readUnsignedByte(); @@ -88,27 +96,63 @@ public abstract class RSObjectCompositionMixin implements RSObjectComposition } } } - else if (opcode == 14) setSizeX(buffer.readUnsignedByte()); - else if (opcode == 15) setSizeY(buffer.readUnsignedByte()); + else if (opcode == 14) + { + setSizeX(buffer.readUnsignedByte()); + } + else if (opcode == 15) + { + setSizeY(buffer.readUnsignedByte()); + } else if (opcode == 17) { setInteractType(0); setBoolean1(false); } - else if (opcode == 18) setBoolean1(false); - else if (opcode == 19) setInt1(buffer.readUnsignedByte()); - else if (opcode == 21) setClipType(0); - else if (opcode == 22) setNonFlatShading(true); - else if (opcode == 23) setModelClipped(true); + else if (opcode == 18) + { + setBoolean1(false); + } + else if (opcode == 19) + { + setInt1(buffer.readUnsignedByte()); + } + else if (opcode == 21) + { + setClipType(0); + } + else if (opcode == 22) + { + setNonFlatShading(true); + } + else if (opcode == 23) + { + setModelClipped(true); + } else if (opcode == 24) { setAnimationId(buffer.readUnsignedShort()); - if (getAnimationId() == 65535) setAnimationId(-1); + if (getAnimationId() == 65535) + { + setAnimationId(-1); + } + } + else if (opcode == 27) + { + setInteractType(1); + } + else if (opcode == 28) + { + setInt2(buffer.readUnsignedByte()); + } + else if (opcode == 29) + { + setAmbient(buffer.readByte()); + } + else if (opcode == 39) + { + setContrast(buffer.readByte() * 25); } - else if (opcode == 27) setInteractType(1); - else if (opcode == 28) setInt2(buffer.readUnsignedByte()); - else if (opcode == 29) setAmbient(buffer.readByte()); - else if (opcode == 39) setContrast(buffer.readByte() * 25); else if (opcode >= 30 && opcode < 35) { getActions()[opcode - 30] = buffer.readStringCp1252NullTerminated(); @@ -139,20 +183,62 @@ public abstract class RSObjectCompositionMixin implements RSObjectComposition getRetextureTo()[var4] = (short) buffer.readUnsignedShort(); } } - else if (opcode == 61) buffer.readUnsignedShort(); - else if (opcode == 62) setIsRotated(true); - else if (opcode == 64) setClipped(false); - else if (opcode == 65) setModelSizeX(buffer.readUnsignedShort()); - else if (opcode == 66) setModelHeight(buffer.readUnsignedShort()); - else if (opcode == 67) setModelSizeY(buffer.readUnsignedShort()); - else if (opcode == 68) setMapSceneId(buffer.readUnsignedShort()); - else if (opcode == 69) accessBitMask = buffer.readUnsignedByte(); - else if (opcode == 70) setOffsetX(buffer.readShort()); - else if (opcode == 71) setOffsetHeight(buffer.readShort()); - else if (opcode == 72) setOffsetY(buffer.readShort()); - else if (opcode == 73) setBoolean2(true) ; - else if (opcode == 74) setIsSolid(true); - else if (opcode == 75) setInt3(buffer.readUnsignedByte()); + else if (opcode == 61) + { + buffer.readUnsignedShort(); + } + else if (opcode == 62) + { + setIsRotated(true); + } + else if (opcode == 64) + { + setClipped(false); + } + else if (opcode == 65) + { + setModelSizeX(buffer.readUnsignedShort()); + } + else if (opcode == 66) + { + setModelHeight(buffer.readUnsignedShort()); + } + else if (opcode == 67) + { + setModelSizeY(buffer.readUnsignedShort()); + } + else if (opcode == 68) + { + setMapSceneId(buffer.readUnsignedShort()); + } + else if (opcode == 69) + { + accessBitMask = buffer.readUnsignedByte(); + } + else if (opcode == 70) + { + setOffsetX(buffer.readShort()); + } + else if (opcode == 71) + { + setOffsetHeight(buffer.readShort()); + } + else if (opcode == 72) + { + setOffsetY(buffer.readShort()); + } + else if (opcode == 73) + { + setBoolean2(true); + } + else if (opcode == 74) + { + setIsSolid(true); + } + else if (opcode == 75) + { + setInt3(buffer.readUnsignedByte()); + } else if (opcode != 77 && opcode != 92) { if (opcode == 78) @@ -174,9 +260,18 @@ public abstract class RSObjectCompositionMixin implements RSObjectComposition getSoundEffectIds()[var4] = buffer.readUnsignedShort(); } } - else if (opcode == 81) setClipType(buffer.readUnsignedByte() * 256); - else if (opcode == 82) setMapIconId(buffer.readUnsignedShort()); - else if (opcode == 89) setBoolean3(false); + else if (opcode == 81) + { + setClipType(buffer.readUnsignedByte() * 256); + } + else if (opcode == 82) + { + setMapIconId(buffer.readUnsignedShort()); + } + else if (opcode == 89) + { + setBoolean3(false); + } else if (opcode == 249) { setParams((IterableHashTable) client.readStringIntParameters(buffer, getParams())); @@ -185,16 +280,25 @@ public abstract class RSObjectCompositionMixin implements RSObjectComposition else { setTransformVarbit(buffer.readUnsignedShort()); - if (getTransformVarbit() == 65535) setTransformVarbit(-1); + if (getTransformVarbit() == 65535) + { + setTransformVarbit(-1); + } setTransformVarp(buffer.readUnsignedShort()); - if (getTransformVarp() == 65535) setTransformVarp(-1); + if (getTransformVarp() == 65535) + { + setTransformVarp(-1); + } var3 = -1; if (opcode == 92) { var3 = buffer.readUnsignedShort(); - if (var3 == 65535) var3 = -1; + if (var3 == 65535) + { + var3 = -1; + } } var4 = buffer.readUnsignedByte(); @@ -203,7 +307,10 @@ public abstract class RSObjectCompositionMixin implements RSObjectComposition for (int var5 = 0; var5 <= var4; ++var5) { getTransforms()[var5] = buffer.readUnsignedShort(); - if (getTransforms()[var5] == 65535) getTransforms()[var5] = -1; + if (getTransforms()[var5] == 65535) + { + getTransforms()[var5] = -1; + } } getTransforms()[var4 + 1] = var3; From a2cfd7b7dcfedeef038a074df9bf89cee1bf4c50 Mon Sep 17 00:00:00 2001 From: Owain van Brakel Date: Fri, 29 Apr 2022 08:31:49 +0200 Subject: [PATCH 12/12] project(mixins): Mixins --- .../main/java/net/runelite/rs/api/RSObjectComposition.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/runescape-api/src/main/java/net/runelite/rs/api/RSObjectComposition.java b/runescape-api/src/main/java/net/runelite/rs/api/RSObjectComposition.java index c01c350ce4..1b31583788 100644 --- a/runescape-api/src/main/java/net/runelite/rs/api/RSObjectComposition.java +++ b/runescape-api/src/main/java/net/runelite/rs/api/RSObjectComposition.java @@ -235,12 +235,18 @@ public interface RSObjectComposition extends ObjectComposition @Import("transformVarbit") int getTransformVarbit(); + @Import("transformVarbit") + int getVarbitId(); + @Import("transformVarp") void setTransformVarp(int transformVarp); @Import("transformVarp") int getTransformVarp(); + @Import("transformVarp") + int getVarPlayerId(); + @Import("transforms") void setTransforms(int[] transforms);