Merge remote-tracking branch 'runelite/master'

This commit is contained in:
Owain van Brakel
2022-04-29 08:11:02 +02:00
13 changed files with 276 additions and 40 deletions

View File

@@ -549,9 +549,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();

View File

@@ -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))

View File

@@ -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."),

View File

@@ -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);

View File

@@ -1,5 +1,6 @@
/*
* Copyright (c) 2020 Adam <Adam@sigterm.info>
* Copyright (c) 2021, Jonathan Rousseau <https://github.com/JoRouss>
* 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;
}

View File

@@ -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"),