From d0725e4b0a6494c70237ad0a6f2b0839610c0642 Mon Sep 17 00:00:00 2001 From: David Luong Date: Wed, 1 Jun 2022 12:01:32 -0400 Subject: [PATCH 1/3] item identification: Add Desert Treasure diamonds (#14764) --- .../client/plugins/itemidentification/ItemIdentification.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/itemidentification/ItemIdentification.java b/runelite-client/src/main/java/net/runelite/client/plugins/itemidentification/ItemIdentification.java index dd25f32fc7..5564b4123e 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/itemidentification/ItemIdentification.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/itemidentification/ItemIdentification.java @@ -254,6 +254,10 @@ enum ItemIdentification DRAGONSTONE(Type.GEM, "Dragon", "DR", ItemID.UNCUT_DRAGONSTONE, ItemID.DRAGONSTONE), ONYX(Type.GEM, "Onyx", "ON", ItemID.UNCUT_ONYX, ItemID.ONYX), ZENYTE(Type.GEM, "Zenyte", "Z", ItemID.UNCUT_ZENYTE, ItemID.ZENYTE), + SHADOW_DIAMOND(Type.GEM, "Shadow", "SHD", ItemID.SHADOW_DIAMOND), + BLOOD_DIAMOND(Type.GEM, "Blood", "BD", ItemID.BLOOD_DIAMOND), + ICE_DIAMOND(Type.GEM, "Ice", "ID", ItemID.ICE_DIAMOND), + SMOKE_DIAMOND(Type.GEM, "Smoke", "SMD", ItemID.SMOKE_DIAMOND), // Potions ATTACK(Type.POTION, "Att", "A", ItemID.ATTACK_POTION4, ItemID.ATTACK_POTION3, ItemID.ATTACK_POTION2, ItemID.ATTACK_POTION1), From 80c150c8e9dd52192b8db4c63c06304ada63989b Mon Sep 17 00:00:00 2001 From: Max Weber Date: Wed, 1 Jun 2022 12:06:48 -0600 Subject: [PATCH 2/3] ClientLoader: don't fail patching to hidden files FileOutputStream (by design) passes FILE_ATTRIBUTE_NORMAL and CREATE_ALWAYS to CreateFile, which causes it to fail with access denied if it is opening a FILE_ATTRIBUTE_HIDDEN or FILE_ATTRIBUTE_SYSTEM file See JDK-8047342 --- .../src/main/java/net/runelite/client/rs/ClientLoader.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/rs/ClientLoader.java b/runelite-client/src/main/java/net/runelite/client/rs/ClientLoader.java index 1966f6fbf4..1912f95bf7 100644 --- a/runelite-client/src/main/java/net/runelite/client/rs/ClientLoader.java +++ b/runelite-client/src/main/java/net/runelite/client/rs/ClientLoader.java @@ -36,7 +36,6 @@ import java.applet.Applet; import java.io.ByteArrayOutputStream; import java.io.DataInputStream; import java.io.File; -import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; @@ -487,7 +486,7 @@ public class ClientLoader implements Supplier } } - try (HashingOutputStream hos = new HashingOutputStream(Hashing.sha512(), new FileOutputStream(PATCHED_CACHE)); + try (HashingOutputStream hos = new HashingOutputStream(Hashing.sha512(), java.nio.file.Files.newOutputStream(PATCHED_CACHE.toPath())); InputStream patch = ClientLoader.class.getResourceAsStream("/client.patch")) { new FileByFileV1DeltaApplier().applyDelta(VANILLA_CACHE, patch, hos); From 4b8dc6fbeacff678b5957af915bd313729e69d8e Mon Sep 17 00:00:00 2001 From: Max Weber Date: Wed, 1 Jun 2022 13:56:23 -0600 Subject: [PATCH 3/3] SessionManager: don't fail to login with a existing hidden session file --- .../main/java/net/runelite/client/account/SessionManager.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/account/SessionManager.java b/runelite-client/src/main/java/net/runelite/client/account/SessionManager.java index c9f432db02..81f08dd3e6 100644 --- a/runelite-client/src/main/java/net/runelite/client/account/SessionManager.java +++ b/runelite-client/src/main/java/net/runelite/client/account/SessionManager.java @@ -27,12 +27,12 @@ package net.runelite.client.account; import com.google.gson.Gson; import java.io.File; import java.io.FileInputStream; -import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.io.Writer; import java.nio.charset.StandardCharsets; +import java.nio.file.Files; import java.time.Instant; import java.util.UUID; import javax.inject.Inject; @@ -123,7 +123,7 @@ public class SessionManager return; } - try (Writer fw = new OutputStreamWriter(new FileOutputStream(sessionFile), StandardCharsets.UTF_8)) + try (Writer fw = new OutputStreamWriter(Files.newOutputStream(sessionFile.toPath()), StandardCharsets.UTF_8)) { gson.toJson(accountSession, fw);