From 9cf95ef324359bfeaacabc057c86ed5365551041 Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 10 Feb 2020 17:59:09 -0500 Subject: [PATCH 01/15] http-service: increase ge history retention to 90 days --- .../runelite/http/service/ge/GrandExchangeService.java | 10 ++++++++-- http-service/src/main/resources/application.yaml | 4 +++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/http-service/src/main/java/net/runelite/http/service/ge/GrandExchangeService.java b/http-service/src/main/java/net/runelite/http/service/ge/GrandExchangeService.java index 6456beb85f..f53a9095c6 100644 --- a/http-service/src/main/java/net/runelite/http/service/ge/GrandExchangeService.java +++ b/http-service/src/main/java/net/runelite/http/service/ge/GrandExchangeService.java @@ -28,6 +28,7 @@ import java.util.Collection; import net.runelite.http.api.ge.GrandExchangeTrade; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.beans.factory.annotation.Value; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Service; import org.sql2o.Connection; @@ -51,11 +52,16 @@ public class GrandExchangeService ") ENGINE=InnoDB;"; private final Sql2o sql2o; + private final int historyDays; @Autowired - public GrandExchangeService(@Qualifier("Runelite SQL2O") Sql2o sql2o) + public GrandExchangeService( + @Qualifier("Runelite SQL2O") Sql2o sql2o, + @Value("${runelite.ge.history}") int historyDays + ) { this.sql2o = sql2o; + this.historyDays = historyDays; // Ensure necessary tables exist try (Connection con = sql2o.open()) @@ -106,7 +112,7 @@ public class GrandExchangeService { try (Connection con = sql2o.open()) { - con.createQuery("delete from ge_trades where time < current_timestamp - interval 1 month") + con.createQuery("delete from ge_trades where time < current_timestamp - interval " + historyDays + " day") .executeUpdate(); } } diff --git a/http-service/src/main/resources/application.yaml b/http-service/src/main/resources/application.yaml index f5e1a799d9..4328ccfdc0 100644 --- a/http-service/src/main/resources/application.yaml +++ b/http-service/src/main/resources/application.yaml @@ -39,4 +39,6 @@ runelite: twitter: consumerkey: secretkey: - listid: 1185897074786742273 \ No newline at end of file + listid: 1185897074786742273 + ge: + history: 90 # days \ No newline at end of file From d93497c7fc0f02a3bcd7222a52744426be044ee3 Mon Sep 17 00:00:00 2001 From: Oelderoth Date: Tue, 11 Feb 2020 16:47:29 -0600 Subject: [PATCH 02/15] grandexchange plugin: log cancelled buy/sell offers --- .../grandexchange/GrandExchangePlugin.java | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/grandexchange/GrandExchangePlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/grandexchange/GrandExchangePlugin.java index 1e7636f97a..a769660b93 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/grandexchange/GrandExchangePlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/grandexchange/GrandExchangePlugin.java @@ -292,8 +292,14 @@ public class GrandExchangePlugin extends Plugin return; } - // Only interested in offers which are fully bought/sold - if (offer.getState() != GrandExchangeOfferState.BOUGHT && offer.getState() != GrandExchangeOfferState.SOLD) + if (offer.getState() != GrandExchangeOfferState.BOUGHT && offer.getState() != GrandExchangeOfferState.SOLD && + offer.getState() != GrandExchangeOfferState.CANCELLED_BUY && offer.getState() != GrandExchangeOfferState.CANCELLED_SELL) + { + return; + } + + // Cancelled offers may have been cancelled before buying/selling any items + if (offer.getQuantitySold() == 0) { return; } @@ -305,12 +311,12 @@ public class GrandExchangePlugin extends Plugin } // getPrice() is the price of the offer, not necessarily what the item bought at - int priceEach = offer.getSpent() / offer.getTotalQuantity(); + int priceEach = offer.getSpent() / offer.getQuantitySold(); GrandExchangeTrade grandExchangeTrade = new GrandExchangeTrade(); - grandExchangeTrade.setBuy(offer.getState() == GrandExchangeOfferState.BOUGHT); + grandExchangeTrade.setBuy(offer.getState() == GrandExchangeOfferState.BOUGHT || offer.getState() == GrandExchangeOfferState.CANCELLED_BUY); grandExchangeTrade.setItemId(offer.getItemId()); - grandExchangeTrade.setQuantity(offer.getTotalQuantity()); + grandExchangeTrade.setQuantity(offer.getQuantitySold()); grandExchangeTrade.setPrice(priceEach); log.debug("Submitting trade: {}", grandExchangeTrade); From cf9f7fc9fb4d76490995f4afcbceb68d17ff8c1f Mon Sep 17 00:00:00 2001 From: Max Weber Date: Mon, 10 Feb 2020 18:33:27 -0700 Subject: [PATCH 03/15] gpu: refactor shader compilation --- .../runelite/client/plugins/gpu/GLUtil.java | 78 +------ .../client/plugins/gpu/GpuPlugin.java | 150 ++++--------- .../runelite/client/plugins/gpu/Shader.java | 123 +++++++++++ .../client/plugins/gpu/template/Template.java | 52 ++++- .../client/plugins/gpu/ShaderTest.java | 199 ------------------ .../plugins/gpu/template/TemplateTest.java | 4 +- 6 files changed, 214 insertions(+), 392 deletions(-) create mode 100644 runelite-client/src/main/java/net/runelite/client/plugins/gpu/Shader.java delete mode 100644 runelite-client/src/test/java/net/runelite/client/plugins/gpu/ShaderTest.java diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/gpu/GLUtil.java b/runelite-client/src/main/java/net/runelite/client/plugins/gpu/GLUtil.java index af5d5ea018..65da9b96e9 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/gpu/GLUtil.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/gpu/GLUtil.java @@ -25,8 +25,6 @@ package net.runelite.client.plugins.gpu; import com.jogamp.opengl.GL4; -import java.io.InputStream; -import java.util.Scanner; class GLUtil { @@ -58,14 +56,14 @@ class GLUtil { byte[] err = new byte[ERR_LEN]; gl.glGetShaderInfoLog(shader, ERR_LEN, buf, 0, err, 0); - return new String(err); + return new String(err, 0, buf[0]); } static String glGetProgramInfoLog(GL4 gl, int program) { byte[] err = new byte[ERR_LEN]; gl.glGetProgramInfoLog(program, ERR_LEN, buf, 0, err, 0); - return new String(err); + return new String(err, 0, buf[0]); } static int glGenVertexArrays(GL4 gl) @@ -127,76 +125,4 @@ class GLUtil buf[0] = renderBuffer; gl.glDeleteRenderbuffers(1, buf, 0); } - - static void loadShaders(GL4 gl, int glProgram, int glVertexShader, int glGeometryShader, int glFragmentShader, - String vertexShaderStr, String geomShaderStr, String fragShaderStr) throws ShaderException - { - compileAndAttach(gl, glProgram, glVertexShader, vertexShaderStr); - - if (glGeometryShader != -1) - { - compileAndAttach(gl, glProgram, glGeometryShader, geomShaderStr); - } - - compileAndAttach(gl, glProgram, glFragmentShader, fragShaderStr); - - gl.glLinkProgram(glProgram); - - if (glGetProgram(gl, glProgram, gl.GL_LINK_STATUS) == gl.GL_FALSE) - { - String err = glGetProgramInfoLog(gl, glProgram); - throw new ShaderException(err); - } - - gl.glValidateProgram(glProgram); - - if (glGetProgram(gl, glProgram, gl.GL_VALIDATE_STATUS) == gl.GL_FALSE) - { - String err = glGetProgramInfoLog(gl, glProgram); - throw new ShaderException(err); - } - } - - static void loadComputeShader(GL4 gl, int glProgram, int glComputeShader, String str) throws ShaderException - { - compileAndAttach(gl, glProgram, glComputeShader, str); - - gl.glLinkProgram(glProgram); - - if (glGetProgram(gl, glProgram, gl.GL_LINK_STATUS) == gl.GL_FALSE) - { - String err = glGetProgramInfoLog(gl, glProgram); - throw new ShaderException(err); - } - - gl.glValidateProgram(glProgram); - - if (glGetProgram(gl, glProgram, gl.GL_VALIDATE_STATUS) == gl.GL_FALSE) - { - String err = glGetProgramInfoLog(gl, glProgram); - throw new ShaderException(err); - } - } - - private static void compileAndAttach(GL4 gl, int program, int shader, String source) throws ShaderException - { - gl.glShaderSource(shader, 1, new String[]{source}, null); - gl.glCompileShader(shader); - - if (glGetShader(gl, shader, gl.GL_COMPILE_STATUS) == gl.GL_TRUE) - { - gl.glAttachShader(program, shader); - } - else - { - String err = glGetShaderInfoLog(gl, shader); - throw new ShaderException(err); - } - } - - static String inputStreamToString(InputStream in) - { - Scanner scanner = new Scanner(in).useDelimiter("\\A"); - return scanner.next(); - } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/gpu/GpuPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/gpu/GpuPlugin.java index e4a0233c0f..3dccef8212 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/gpu/GpuPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/gpu/GpuPlugin.java @@ -46,7 +46,6 @@ import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.FloatBuffer; import java.nio.IntBuffer; -import java.util.function.Function; import javax.inject.Inject; import javax.swing.SwingUtilities; import jogamp.nativewindow.SurfaceScaleUtils; @@ -124,28 +123,41 @@ public class GpuPlugin extends Plugin implements DrawCallbacks private GLContext glContext; private GLDrawable glDrawable; + static final String LINUX_VERSION_HEADER = + "#version 420\n" + + "#extension GL_ARB_compute_shader : require\n" + + "#extension GL_ARB_shader_storage_buffer_object : require\n" + + "#extension GL_ARB_explicit_attrib_location : require\n"; + static final String WINDOWS_VERSION_HEADER = "#version 430\n"; + + static final Shader PROGRAM = new Shader() + .add(GL4.GL_VERTEX_SHADER, "vert.glsl") + .add(GL4.GL_GEOMETRY_SHADER, "geom.glsl") + .add(GL4.GL_FRAGMENT_SHADER, "frag.glsl"); + + static final Shader COMPUTE_PROGRAM = new Shader() + .add(GL4.GL_COMPUTE_SHADER, "comp.glsl"); + + static final Shader SMALL_COMPUTE_PROGRAM = new Shader() + .add(GL4.GL_COMPUTE_SHADER, "comp_small.glsl"); + + static final Shader UNORDERED_COMPUTE_PROGRAM = new Shader() + .add(GL4.GL_COMPUTE_SHADER, "comp_unordered.glsl"); + + static final Shader UI_PROGRAM = new Shader() + .add(GL4.GL_VERTEX_SHADER, "vertui.glsl") + .add(GL4.GL_FRAGMENT_SHADER, "fragui.glsl"); + private int glProgram; - private int glVertexShader; - private int glGeomShader; - private int glFragmentShader; - private int glComputeProgram; - private int glComputeShader; - private int glSmallComputeProgram; - private int glSmallComputeShader; - private int glUnorderedComputeProgram; - private int glUnorderedComputeShader; + private int glUiProgram; private int vaoHandle; private int interfaceTexture; - private int glUiProgram; - private int glUiVertexShader; - private int glUiFragmentShader; - private int vaoUiHandle; private int vboUiHandle; @@ -434,79 +446,23 @@ public class GpuPlugin extends Plugin implements DrawCallbacks private void initProgram() throws ShaderException { - glProgram = gl.glCreateProgram(); - glVertexShader = gl.glCreateShader(gl.GL_VERTEX_SHADER); - glGeomShader = gl.glCreateShader(gl.GL_GEOMETRY_SHADER); - glFragmentShader = gl.glCreateShader(gl.GL_FRAGMENT_SHADER); - - final String glVersionHeader; - - if (OSType.getOSType() == OSType.Linux) + String versionHeader = OSType.getOSType() == OSType.Linux ? LINUX_VERSION_HEADER : WINDOWS_VERSION_HEADER; + Template template = new Template(); + template.add(key -> { - glVersionHeader = - "#version 420\n" + - "#extension GL_ARB_compute_shader : require\n" + - "#extension GL_ARB_shader_storage_buffer_object : require\n"; - } - else - { - glVersionHeader = "#version 430\n"; - } - - Function resourceLoader = (s) -> - { - if (s.endsWith(".glsl")) + if ("version_header".equals(key)) { - return inputStreamToString(getClass().getResourceAsStream(s)); + return versionHeader; } + return null; + }); + template.addInclude(GpuPlugin.class); - if (s.equals("version_header")) - { - return glVersionHeader; - } - - return ""; - }; - - Template template = new Template(resourceLoader); - String source = template.process(resourceLoader.apply("geom.glsl")); - - template = new Template(resourceLoader); - String vertSource = template.process(resourceLoader.apply("vert.glsl")); - - template = new Template(resourceLoader); - String fragSource = template.process(resourceLoader.apply("frag.glsl")); - - GLUtil.loadShaders(gl, glProgram, glVertexShader, glGeomShader, glFragmentShader, - vertSource, - source, - fragSource); - - glComputeProgram = gl.glCreateProgram(); - glComputeShader = gl.glCreateShader(gl.GL_COMPUTE_SHADER); - template = new Template(resourceLoader); - source = template.process(resourceLoader.apply("comp.glsl")); - GLUtil.loadComputeShader(gl, glComputeProgram, glComputeShader, source); - - glSmallComputeProgram = gl.glCreateProgram(); - glSmallComputeShader = gl.glCreateShader(gl.GL_COMPUTE_SHADER); - template = new Template(resourceLoader); - source = template.process(resourceLoader.apply("comp_small.glsl")); - GLUtil.loadComputeShader(gl, glSmallComputeProgram, glSmallComputeShader, source); - - glUnorderedComputeProgram = gl.glCreateProgram(); - glUnorderedComputeShader = gl.glCreateShader(gl.GL_COMPUTE_SHADER); - template = new Template(resourceLoader); - source = template.process(resourceLoader.apply("comp_unordered.glsl")); - GLUtil.loadComputeShader(gl, glUnorderedComputeProgram, glUnorderedComputeShader, source); - - glUiProgram = gl.glCreateProgram(); - glUiVertexShader = gl.glCreateShader(gl.GL_VERTEX_SHADER); - glUiFragmentShader = gl.glCreateShader(gl.GL_FRAGMENT_SHADER); - GLUtil.loadShaders(gl, glUiProgram, glUiVertexShader, -1, glUiFragmentShader, - inputStreamToString(getClass().getResourceAsStream("vertui.glsl")), - null, - inputStreamToString(getClass().getResourceAsStream("fragui.glsl"))); + glProgram = PROGRAM.compile(gl, template); + glComputeProgram = COMPUTE_PROGRAM.compile(gl, template); + glSmallComputeProgram = SMALL_COMPUTE_PROGRAM.compile(gl, template); + glUnorderedComputeProgram = UNORDERED_COMPUTE_PROGRAM.compile(gl, template); + glUiProgram = UI_PROGRAM.compile(gl, template); initUniforms(); } @@ -532,46 +488,18 @@ public class GpuPlugin extends Plugin implements DrawCallbacks private void shutdownProgram() { - gl.glDeleteShader(glVertexShader); - glVertexShader = -1; - - gl.glDeleteShader(glGeomShader); - glGeomShader = -1; - - gl.glDeleteShader(glFragmentShader); - glFragmentShader = -1; - gl.glDeleteProgram(glProgram); glProgram = -1; - /// - - gl.glDeleteShader(glComputeShader); - glComputeShader = -1; - gl.glDeleteProgram(glComputeProgram); glComputeProgram = -1; - gl.glDeleteShader(glSmallComputeShader); - glSmallComputeShader = -1; - gl.glDeleteProgram(glSmallComputeProgram); glSmallComputeProgram = -1; - gl.glDeleteShader(glUnorderedComputeShader); - glUnorderedComputeShader = -1; - gl.glDeleteProgram(glUnorderedComputeProgram); glUnorderedComputeProgram = -1; - /// - - gl.glDeleteShader(glUiVertexShader); - glUiVertexShader = -1; - - gl.glDeleteShader(glUiFragmentShader); - glUiFragmentShader = -1; - gl.glDeleteProgram(glUiProgram); glUiProgram = -1; } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/gpu/Shader.java b/runelite-client/src/main/java/net/runelite/client/plugins/gpu/Shader.java new file mode 100644 index 0000000000..1146fd3332 --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/gpu/Shader.java @@ -0,0 +1,123 @@ +/* + * Copyright (c) 2018, Adam + * Copyright (c) 2020 Abex + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.client.plugins.gpu; + +import com.google.common.annotations.VisibleForTesting; +import com.jogamp.opengl.GL4; +import java.util.ArrayList; +import java.util.List; +import lombok.Getter; +import lombok.RequiredArgsConstructor; +import net.runelite.client.plugins.gpu.template.Template; + +public class Shader +{ + @VisibleForTesting + final List units = new ArrayList<>(); + + @RequiredArgsConstructor + @VisibleForTesting + static class Unit + { + @Getter + private final int type; + + @Getter + private final String filename; + } + + public Shader() + { + } + + public Shader add(int type, String name) + { + units.add(new Unit(type, name)); + return this; + } + + public int compile(GL4 gl, Template template) throws ShaderException + { + int program = gl.glCreateProgram(); + int[] shaders = new int[units.size()]; + int i = 0; + boolean ok = false; + try + { + while (i < shaders.length) + { + Unit unit = units.get(i); + int shader = gl.glCreateShader(unit.type); + String source = template.load(unit.filename); + gl.glShaderSource(shader, 1, new String[]{source}, null); + gl.glCompileShader(shader); + + if (GLUtil.glGetShader(gl, shader, gl.GL_COMPILE_STATUS) != gl.GL_TRUE) + { + String err = GLUtil.glGetShaderInfoLog(gl, shader); + gl.glDeleteShader(shader); + throw new ShaderException(err); + } + gl.glAttachShader(program, shader); + shaders[i++] = shader; + } + + gl.glLinkProgram(program); + + if (GLUtil.glGetProgram(gl, program, gl.GL_LINK_STATUS) == gl.GL_FALSE) + { + String err = GLUtil.glGetProgramInfoLog(gl, program); + throw new ShaderException(err); + } + + gl.glValidateProgram(program); + + if (GLUtil.glGetProgram(gl, program, gl.GL_VALIDATE_STATUS) == gl.GL_FALSE) + { + String err = GLUtil.glGetProgramInfoLog(gl, program); + throw new ShaderException(err); + } + + ok = true; + } + finally + { + while (i > 0) + { + int shader = shaders[--i]; + gl.glDetachShader(program, shader); + gl.glDeleteShader(shader); + } + + if (!ok) + { + gl.glDeleteProgram(program); + } + } + + return program; + } +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/gpu/template/Template.java b/runelite-client/src/main/java/net/runelite/client/plugins/gpu/template/Template.java index 1f2ea73549..3bf7059382 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/gpu/template/Template.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/gpu/template/Template.java @@ -24,15 +24,18 @@ */ package net.runelite.client.plugins.gpu.template; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.List; +import java.util.Scanner; import java.util.function.Function; public class Template { - private final Function resourceLoader; + private final List> resourceLoaders = new ArrayList<>(); - public Template(Function resourceLoader) + public Template() { - this.resourceLoader = resourceLoader; } public String process(String str) @@ -43,8 +46,8 @@ public class Template if (line.startsWith("#include ")) { String resource = line.substring(9); - String resourceStr = resourceLoader.apply(resource); - sb.append(process(resourceStr)); + String resourceStr = load(resource); + sb.append(resourceStr); } else { @@ -53,4 +56,43 @@ public class Template } return sb.toString(); } + + public String load(String filename) + { + for (Function loader : resourceLoaders) + { + String value = loader.apply(filename); + if (value != null) + { + return process(value); + } + } + + return ""; + } + + public Template add(Function fn) + { + resourceLoaders.add(fn); + return this; + } + + public Template addInclude(Class clazz) + { + return add(f -> + { + InputStream is = clazz.getResourceAsStream(f); + if (is != null) + { + return inputStreamToString(is); + } + return null; + }); + } + + private static String inputStreamToString(InputStream in) + { + Scanner scanner = new Scanner(in).useDelimiter("\\A"); + return scanner.next(); + } } diff --git a/runelite-client/src/test/java/net/runelite/client/plugins/gpu/ShaderTest.java b/runelite-client/src/test/java/net/runelite/client/plugins/gpu/ShaderTest.java deleted file mode 100644 index bc42b37239..0000000000 --- a/runelite-client/src/test/java/net/runelite/client/plugins/gpu/ShaderTest.java +++ /dev/null @@ -1,199 +0,0 @@ -/* - * Copyright (c) 2018, Adam - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -package net.runelite.client.plugins.gpu; - -import com.jogamp.nativewindow.AbstractGraphicsConfiguration; -import com.jogamp.nativewindow.NativeWindowFactory; -import com.jogamp.nativewindow.awt.AWTGraphicsConfiguration; -import com.jogamp.nativewindow.awt.JAWTWindow; -import com.jogamp.opengl.GL4; -import com.jogamp.opengl.GLCapabilities; -import com.jogamp.opengl.GLContext; -import com.jogamp.opengl.GLDrawable; -import com.jogamp.opengl.GLDrawableFactory; -import com.jogamp.opengl.GLProfile; -import java.awt.Canvas; -import java.util.function.Function; -import javax.swing.JFrame; -import static net.runelite.client.plugins.gpu.GLUtil.inputStreamToString; -import net.runelite.client.plugins.gpu.template.Template; -import static org.junit.Assert.fail; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Test; - -public class ShaderTest -{ - private static final String VERTEX_SHADER = "" + - "void main() {" + - " gl_Position = vec4(1.0, 1.0, 1.0, 1.0);" + - "}"; - private GL4 gl; - - @Before - public void before() - { - Canvas canvas = new Canvas(); - JFrame frame = new JFrame(); - frame.setSize(100, 100); - frame.add(canvas); - frame.setVisible(true); - - GLProfile glProfile = GLProfile.getMaxFixedFunc(true); - - GLCapabilities glCaps = new GLCapabilities(glProfile); - AbstractGraphicsConfiguration config = AWTGraphicsConfiguration.create(canvas.getGraphicsConfiguration(), - glCaps, glCaps); - - JAWTWindow jawtWindow = (JAWTWindow) NativeWindowFactory.getNativeWindow(canvas, config); - - GLDrawableFactory glDrawableFactory = GLDrawableFactory.getFactory(glProfile); - - GLDrawable glDrawable = glDrawableFactory.createGLDrawable(jawtWindow); - glDrawable.setRealized(true); - - - GLContext glContext = glDrawable.createContext(null); - int res = glContext.makeCurrent(); - if (res == GLContext.CONTEXT_NOT_CURRENT) - { - fail("error making context current"); - } - - gl = glContext.getGL().getGL4(); - } - - @Test - @Ignore - public void testUnordered() throws ShaderException - { - int glComputeProgram = gl.glCreateProgram(); - int glComputeShader = gl.glCreateShader(gl.GL_COMPUTE_SHADER); - try - { - Function func = (s) -> inputStreamToString(getClass().getResourceAsStream(s)); - Template template = new Template(func); - String source = template.process(func.apply("comp_unordered.glsl")); - - int line = 0; - for (String str : source.split("\\n")) - { - System.out.println(++line + " " + str); - } - - GLUtil.loadComputeShader(gl, glComputeProgram, glComputeShader, source); - } - finally - { - gl.glDeleteShader(glComputeShader); - gl.glDeleteProgram(glComputeProgram); - } - } - - @Test - @Ignore - public void testSmall() throws ShaderException - { - int glComputeProgram = gl.glCreateProgram(); - int glComputeShader = gl.glCreateShader(gl.GL_COMPUTE_SHADER); - try - { - Function func = (s) -> inputStreamToString(getClass().getResourceAsStream(s)); - Template template = new Template(func); - String source = template.process(func.apply("comp_small.glsl")); - - int line = 0; - for (String str : source.split("\\n")) - { - System.out.println(++line + " " + str); - } - - GLUtil.loadComputeShader(gl, glComputeProgram, glComputeShader, source); - } - finally - { - gl.glDeleteShader(glComputeShader); - gl.glDeleteProgram(glComputeProgram); - } - } - - @Test - @Ignore - public void testComp() throws ShaderException - { - int glComputeProgram = gl.glCreateProgram(); - int glComputeShader = gl.glCreateShader(gl.GL_COMPUTE_SHADER); - try - { - Function func = (s) -> inputStreamToString(getClass().getResourceAsStream(s)); - Template template = new Template(func); - String source = template.process(func.apply("comp.glsl")); - - int line = 0; - for (String str : source.split("\\n")) - { - System.out.println(++line + " " + str); - } - - GLUtil.loadComputeShader(gl, glComputeProgram, glComputeShader, source); - } - finally - { - gl.glDeleteShader(glComputeShader); - gl.glDeleteProgram(glComputeProgram); - } - } - - @Test - @Ignore - public void testGeom() throws ShaderException - { - int glComputeProgram = gl.glCreateProgram(); - int glVertexShader = gl.glCreateShader(gl.GL_VERTEX_SHADER); - int glGeometryShader = gl.glCreateShader(gl.GL_GEOMETRY_SHADER); - int glFragmentShader = gl.glCreateShader(gl.GL_FRAGMENT_SHADER); - try - { - Function func = (s) -> inputStreamToString(getClass().getResourceAsStream(s)); - Template template = new Template(func); - String source = template.process(func.apply("geom.glsl")); - - int line = 0; - for (String str : source.split("\\n")) - { - System.out.println(++line + " " + str); - } - - GLUtil.loadShaders(gl, glComputeProgram, glVertexShader, glGeometryShader, glFragmentShader, VERTEX_SHADER, source, ""); - } - finally - { - gl.glDeleteShader(glVertexShader); - gl.glDeleteShader(glGeometryShader); - gl.glDeleteShader(glFragmentShader); - gl.glDeleteProgram(glComputeProgram); - } - } -} diff --git a/runelite-client/src/test/java/net/runelite/client/plugins/gpu/template/TemplateTest.java b/runelite-client/src/test/java/net/runelite/client/plugins/gpu/template/TemplateTest.java index 0c35e65d52..2c60d58bd8 100644 --- a/runelite-client/src/test/java/net/runelite/client/plugins/gpu/template/TemplateTest.java +++ b/runelite-client/src/test/java/net/runelite/client/plugins/gpu/template/TemplateTest.java @@ -58,7 +58,9 @@ public class TemplateTest throw new RuntimeException("unknown resource"); } }; - String out = new Template(func).process(FILE1); + String out = new Template() + .add(func) + .process(FILE1); assertEquals(RESULT, out); } } \ No newline at end of file From 7e8bebc08329b6c9422237eaab9d0e7eba2f4a38 Mon Sep 17 00:00:00 2001 From: Max Weber Date: Mon, 10 Feb 2020 18:35:29 -0700 Subject: [PATCH 04/15] gpu: run glslangValidator on shaders during tests --- pom.xml | 4 + .../client/plugins/gpu/ShaderTest.java | 130 ++++++++++++++++++ travis/build.sh | 8 +- 3 files changed, 141 insertions(+), 1 deletion(-) create mode 100644 runelite-client/src/test/java/net/runelite/client/plugins/gpu/ShaderTest.java diff --git a/pom.xml b/pom.xml index fafd15de44..76ac38187a 100644 --- a/pom.xml +++ b/pom.xml @@ -42,6 +42,7 @@ true true + 188 @@ -171,6 +172,9 @@ true -Xmx512m + + ${glslang.path} + diff --git a/runelite-client/src/test/java/net/runelite/client/plugins/gpu/ShaderTest.java b/runelite-client/src/test/java/net/runelite/client/plugins/gpu/ShaderTest.java new file mode 100644 index 0000000000..7b206cbacd --- /dev/null +++ b/runelite-client/src/test/java/net/runelite/client/plugins/gpu/ShaderTest.java @@ -0,0 +1,130 @@ +/* + * Copyright (c) 2020 Abex + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.client.plugins.gpu; + +import com.jogamp.opengl.GL4; +import java.io.File; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.util.ArrayList; +import java.util.List; +import joptsimple.internal.Strings; +import lombok.extern.slf4j.Slf4j; +import net.runelite.client.plugins.gpu.template.Template; +import org.junit.Assert; +import org.junit.Assume; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TemporaryFolder; + +@Slf4j +public class ShaderTest +{ + @Rule + public TemporaryFolder temp = new TemporaryFolder(); + + @Test + public void testShaders() throws Exception + { + String verifier = System.getProperty("glslang.path"); + Assume.assumeFalse("glslang.path is not set", Strings.isNullOrEmpty(verifier)); + + Template[] templates = { + new Template() + .addInclude(GpuPlugin.class) + .add(key -> + { + if ("version_header".equals(key)) + { + return GpuPlugin.WINDOWS_VERSION_HEADER; + } + return null; + }), + }; + + Shader[] shaders = { + GpuPlugin.PROGRAM, + GpuPlugin.COMPUTE_PROGRAM, + GpuPlugin.SMALL_COMPUTE_PROGRAM, + GpuPlugin.UNORDERED_COMPUTE_PROGRAM, + GpuPlugin.UI_PROGRAM, + }; + + for (Template t : templates) + { + for (Shader s : shaders) + { + verify(t, s); + } + } + } + + private void verify(Template template, Shader shader) throws Exception + { + File folder = temp.newFolder(); + List args = new ArrayList<>(); + args.add(System.getProperty("glslang.path")); + args.add("-l"); + for (Shader.Unit u : shader.units) + { + String contents = template.load(u.getFilename()); + String ext; + switch (u.getType()) + { + case GL4.GL_VERTEX_SHADER: + ext = "vert"; + break; + case GL4.GL_TESS_CONTROL_SHADER: + ext = "tesc"; + break; + case GL4.GL_TESS_EVALUATION_SHADER: + ext = "tese"; + break; + case GL4.GL_GEOMETRY_SHADER: + ext = "geom"; + break; + case GL4.GL_FRAGMENT_SHADER: + ext = "frag"; + break; + case GL4.GL_COMPUTE_SHADER: + ext = "comp"; + break; + default: + throw new IllegalArgumentException(u.getType() + ""); + } + File file = new File(folder, u.getFilename() + "." + ext); + Files.write(file.toPath(), contents.getBytes(StandardCharsets.UTF_8)); + args.add(file.getAbsolutePath()); + } + + ProcessBuilder pb = new ProcessBuilder(args.toArray(new String[0])); + pb.inheritIO(); + Process proc = pb.start(); + if (proc.waitFor() != 0) + { + Assert.fail(); + } + } +} diff --git a/travis/build.sh b/travis/build.sh index deba275667..d86e56f113 100755 --- a/travis/build.sh +++ b/travis/build.sh @@ -1,3 +1,9 @@ #!/bin/bash -mvn clean install --settings travis/settings.xml +set -e -x + +wget -O/tmp/glslang.zip 'https://github.com/KhronosGroup/glslang/releases/download/8.13.3559/glslang-master-linux-Release.zip' +echo '9adcfdef5b52275e61068aafbb62747936c6c18ab6dc32a6ef707cfc7b0df423 /tmp/glslang.zip' | sha256sum -c +unzip -q /tmp/glslang.zip -d /tmp/glslang + +mvn clean install --settings travis/settings.xml -Dglslang.path=/tmp/glslang/bin/glslangValidator From a330631945855fec65caf86d28fad80ab3a7c8f8 Mon Sep 17 00:00:00 2001 From: Max Weber Date: Mon, 10 Feb 2020 18:38:11 -0700 Subject: [PATCH 05/15] gpu: rename length to size in shaders `.length` has special meaning in glsl, and the verifier got upset that we were shadowing it --- .../net/runelite/client/plugins/gpu/comp.glsl | 2 +- .../client/plugins/gpu/comp_common.glsl | 2 +- .../client/plugins/gpu/comp_unordered.glsl | 4 ++-- .../client/plugins/gpu/priority_render.glsl | 20 +++++++++---------- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/gpu/comp.glsl b/runelite-client/src/main/resources/net/runelite/client/plugins/gpu/comp.glsl index f569bceed6..7c7f948ea3 100644 --- a/runelite-client/src/main/resources/net/runelite/client/plugins/gpu/comp.glsl +++ b/runelite-client/src/main/resources/net/runelite/client/plugins/gpu/comp.glsl @@ -44,7 +44,7 @@ void main() { uint groupId = gl_WorkGroupID.x; uint localId = gl_LocalInvocationID.x * 4; modelinfo minfo = ol[groupId]; - int length = minfo.length; + int length = minfo.size; if (localId == 0) { min10 = 1600; diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/gpu/comp_common.glsl b/runelite-client/src/main/resources/net/runelite/client/plugins/gpu/comp_common.glsl index c527a942c3..934407b94b 100644 --- a/runelite-client/src/main/resources/net/runelite/client/plugins/gpu/comp_common.glsl +++ b/runelite-client/src/main/resources/net/runelite/client/plugins/gpu/comp_common.glsl @@ -41,7 +41,7 @@ struct modelinfo { int offset; // offset into buffer int uvOffset; // offset into uv buffer - int length; // length in faces + int size; // length in faces int idx; // write idx in target buffer int flags; // radius, orientation int x; // scene position x diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/gpu/comp_unordered.glsl b/runelite-client/src/main/resources/net/runelite/client/plugins/gpu/comp_unordered.glsl index b4b526838b..531eb6c935 100644 --- a/runelite-client/src/main/resources/net/runelite/client/plugins/gpu/comp_unordered.glsl +++ b/runelite-client/src/main/resources/net/runelite/client/plugins/gpu/comp_unordered.glsl @@ -37,14 +37,14 @@ void main() { modelinfo minfo = ol[groupId]; int offset = minfo.offset; - int length = minfo.length; + int size = minfo.size; int outOffset = minfo.idx; int uvOffset = minfo.uvOffset; int flags = minfo.flags; int orientation = flags & 0x7ff; ivec4 pos = ivec4(minfo.x, minfo.y, minfo.z, 0); - if (localId >= length) { + if (localId >= size) { return; } diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/gpu/priority_render.glsl b/runelite-client/src/main/resources/net/runelite/client/plugins/gpu/priority_render.glsl index 968f8aec00..5077182e1a 100644 --- a/runelite-client/src/main/resources/net/runelite/client/plugins/gpu/priority_render.glsl +++ b/runelite-client/src/main/resources/net/runelite/client/plugins/gpu/priority_render.glsl @@ -113,7 +113,7 @@ int count_prio_offset(int priority) { void get_face(uint localId, modelinfo minfo, int cameraYaw, int cameraPitch, int centerX, int centerY, int zoom, out int prio, out int dis, out ivec4 o1, out ivec4 o2, out ivec4 o3) { int offset = minfo.offset; - int length = minfo.length; + int size = minfo.size; int flags = minfo.flags; int radius = (flags & 0x7fffffff) >> 12; int orientation = flags & 0x7ff; @@ -121,7 +121,7 @@ void get_face(uint localId, modelinfo minfo, int cameraYaw, int cameraPitch, int uint ssboOffset; - if (localId < length) { + if (localId < size) { ssboOffset = localId; } else { ssboOffset = 0; @@ -148,7 +148,7 @@ void get_face(uint localId, modelinfo minfo, int cameraYaw, int cameraPitch, int int thisPriority, thisDistance; - if (localId < length) { + if (localId < size) { // rotate for model orientation thisrvA = rotate(thisA, orientation); thisrvB = rotate(thisB, orientation); @@ -186,14 +186,14 @@ void get_face(uint localId, modelinfo minfo, int cameraYaw, int cameraPitch, int } int map_face_priority(uint localId, modelinfo minfo, int thisPriority, int thisDistance, out int prio) { - int length = minfo.length; + int size = minfo.size; // Compute average distances for 0/2, 3/4, and 6/8 int adjPrio; int prioIdx; - if (localId < length) { + if (localId < size) { int avg1 = 0; int avg2 = 0; int avg3 = 0; @@ -224,9 +224,9 @@ int map_face_priority(uint localId, modelinfo minfo, int thisPriority, int thisD } void insert_dfs(uint localId, modelinfo minfo, int adjPrio, int distance, int prioIdx) { - int length = minfo.length; + int size = minfo.size; - if (localId < length) { + if (localId < size) { // calculate base offset into dfs based on number of faces with a lower priority int baseOff = count_prio_offset(adjPrio); // store into face array offset array by unique index @@ -236,14 +236,14 @@ void insert_dfs(uint localId, modelinfo minfo, int adjPrio, int distance, int pr void sort_and_insert(uint localId, modelinfo minfo, int thisPriority, int thisDistance, ivec4 thisrvA, ivec4 thisrvB, ivec4 thisrvC) { /* compute face distance */ - int length = minfo.length; + int size = minfo.size; int outOffset = minfo.idx; int uvOffset = minfo.uvOffset; int flags = minfo.flags; ivec4 pos = ivec4(minfo.x, minfo.y, minfo.z, 0); int start, end, myOffset; - if (localId < length) { + if (localId < size) { const int priorityOffset = count_prio_offset(thisPriority); const int numOfPriority = totalMappedNum[thisPriority]; start = priorityOffset; // index of first face with this priority @@ -253,7 +253,7 @@ void sort_and_insert(uint localId, modelinfo minfo, int thisPriority, int thisDi start = end = myOffset = 0; } - if (localId < length) { + if (localId < size) { // we only have to order faces against others of the same priority // calculate position this face will be in for (int i = start; i < end; ++i) { From 94ff26f3d82eb4ef60ef7bc53f0bf1b2fb3f45ef Mon Sep 17 00:00:00 2001 From: Adam Date: Tue, 11 Feb 2020 18:36:39 -0500 Subject: [PATCH 06/15] widgetitemoverlay: clip dragged items when outside of parent bounds Since dragged items are not moved until after the drag is complete, the item still gets queued to be drawn, even if dragged outside of the parent layer. --- .../client/ui/overlay/WidgetItemOverlay.java | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/ui/overlay/WidgetItemOverlay.java b/runelite-client/src/main/java/net/runelite/client/ui/overlay/WidgetItemOverlay.java index c234a0d4dd..b351dcf808 100644 --- a/runelite-client/src/main/java/net/runelite/client/ui/overlay/WidgetItemOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/ui/overlay/WidgetItemOverlay.java @@ -89,12 +89,26 @@ public abstract class WidgetItemOverlay extends Overlay Widget parent = widget.getParent(); Rectangle parentBounds = parent.getBounds(); Rectangle itemCanvasBounds = widgetItem.getCanvasBounds(); + boolean dragging = widgetItem.getDraggingCanvasBounds() != null; boolean shouldClip; - shouldClip = itemCanvasBounds.y < parentBounds.y && itemCanvasBounds.y + itemCanvasBounds.height >= parentBounds.y; - shouldClip |= itemCanvasBounds.y < parentBounds.y + parentBounds.height && itemCanvasBounds.y + itemCanvasBounds.height >= parentBounds.y + parentBounds.height; - shouldClip |= itemCanvasBounds.x < parentBounds.x && (itemCanvasBounds.x + itemCanvasBounds.width) >= parentBounds.x; - shouldClip |= itemCanvasBounds.x < parentBounds.x + parentBounds.width && itemCanvasBounds.x + itemCanvasBounds.width >= parentBounds.x + parentBounds.width; + if (dragging) + { + // If dragging, clip if the dragged item is outside of the parent bounds + shouldClip = itemCanvasBounds.x < parentBounds.x; + shouldClip |= itemCanvasBounds.x + itemCanvasBounds.width >= parentBounds.x + parentBounds.width; + shouldClip |= itemCanvasBounds.y < parentBounds.y; + shouldClip |= itemCanvasBounds.y + itemCanvasBounds.height >= parentBounds.y + parentBounds.height; + } + else + { + // Otherwise, we only need to clip the overlay if it intersects the parent bounds, + // since items completely outside of the parent bounds are not drawn + shouldClip = itemCanvasBounds.y < parentBounds.y && itemCanvasBounds.y + itemCanvasBounds.height >= parentBounds.y; + shouldClip |= itemCanvasBounds.y < parentBounds.y + parentBounds.height && itemCanvasBounds.y + itemCanvasBounds.height >= parentBounds.y + parentBounds.height; + shouldClip |= itemCanvasBounds.x < parentBounds.x && itemCanvasBounds.x + itemCanvasBounds.width >= parentBounds.x; + shouldClip |= itemCanvasBounds.x < parentBounds.x + parentBounds.width && itemCanvasBounds.x + itemCanvasBounds.width >= parentBounds.x + parentBounds.width; + } if (shouldClip) { if (curClipParent != parent) From ff8c0115cdd660c53063792d1d1f55d51edbbb6a Mon Sep 17 00:00:00 2001 From: Grahm Larkham Date: Tue, 11 Feb 2020 20:25:25 -0500 Subject: [PATCH 07/15] imp plugin: fix notifications on npc change --- .../runelite/client/plugins/implings/ImplingsPlugin.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/implings/ImplingsPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/implings/ImplingsPlugin.java index a20895b8f4..f2c25bcbda 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/implings/ImplingsPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/implings/ImplingsPlugin.java @@ -113,14 +113,17 @@ public class ImplingsPlugin extends Plugin NPC npc = npcCompositionChanged.getNpc(); Impling impling = Impling.findImpling(npc.getId()); - if (impling != null && !implings.contains(npc)) + if (impling != null) { if (showImplingType(impling.getImplingType()) == ImplingsConfig.ImplingMode.NOTIFY) { notifier.notify(impling.getImplingType().getName() + " impling is in the area"); } - implings.add(npc); + if (!implings.contains(npc)) + { + implings.add(npc); + } } } From 43e1bfedd2dd2333a38543582b6ae638af83498d Mon Sep 17 00:00:00 2001 From: Trevor Date: Wed, 12 Feb 2020 21:31:11 -0500 Subject: [PATCH 08/15] hot cold clues: add new slepe location --- .../plugins/cluescrolls/clues/hotcold/HotColdLocation.java | 1 + 1 file changed, 1 insertion(+) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/hotcold/HotColdLocation.java b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/hotcold/HotColdLocation.java index f7f498ad2d..63558034db 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/hotcold/HotColdLocation.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/hotcold/HotColdLocation.java @@ -135,6 +135,7 @@ public enum HotColdLocation MORYTANIA_MOS_LES_HARMLESS_BAR(new WorldPoint(3670, 2974, 0), MORYTANIA, "Near Mos Le'Harmless southern bar."), MORYTANIA_DRAGONTOOTH_NORTH(new WorldPoint(3811, 3569, 0), MORYTANIA, "Northern part of Dragontooth Island."), MORYTANIA_DRAGONTOOTH_SOUTH(new WorldPoint(3803, 3532, 0), MORYTANIA, "Southern part of Dragontooth Island."), + MORYTANIA_SLEPE_TENTS(new WorldPoint(3766, 3384, 0), MORYTANIA, "North-east of Slepe, near the tents."), NORTHEAST_OF_AL_KHARID_MINE(true, new WorldPoint(3332, 3313, 0), MISTHALIN, "Northeast of Al Kharid Mine"), WESTERN_PROVINCE_EAGLES_PEAK(new WorldPoint(2297, 3529, 0), WESTERN_PROVINCE, "North-west of Eagles' Peak."), WESTERN_PROVINCE_PISCATORIS(new WorldPoint(2334, 3685, 0), WESTERN_PROVINCE, "Piscatoris Fishing Colony"), From 976ecd8f6b3dc9806b7fceacddf97b3161bad8bb Mon Sep 17 00:00:00 2001 From: dekvall Date: Thu, 6 Feb 2020 16:43:41 +0100 Subject: [PATCH 09/15] hiscores: add nightmare boss --- .../runelite/http/api/hiscore/HiscoreResult.java | 3 +++ .../http/api/hiscore/HiscoreResultBuilder.java | 1 + .../runelite/http/api/hiscore/HiscoreSkill.java | 1 + .../http/service/hiscore/HiscoreServiceTest.java | 1 + .../client/plugins/hiscore/HiscorePanel.java | 12 ++++++------ .../client/plugins/hiscore/bosses/nightmare.png | Bin 0 -> 811 bytes 6 files changed, 12 insertions(+), 6 deletions(-) create mode 100644 runelite-client/src/main/resources/net/runelite/client/plugins/hiscore/bosses/nightmare.png diff --git a/http-api/src/main/java/net/runelite/http/api/hiscore/HiscoreResult.java b/http-api/src/main/java/net/runelite/http/api/hiscore/HiscoreResult.java index 576b20a39f..aae95b9b83 100644 --- a/http-api/src/main/java/net/runelite/http/api/hiscore/HiscoreResult.java +++ b/http-api/src/main/java/net/runelite/http/api/hiscore/HiscoreResult.java @@ -92,6 +92,7 @@ public class HiscoreResult private Skill kreearra; private Skill krilTsutsaroth; private Skill mimic; + private Skill nightmare; private Skill obor; private Skill sarachnis; private Skill scorpia; @@ -237,6 +238,8 @@ public class HiscoreResult return krilTsutsaroth; case MIMIC: return mimic; + case NIGHTMARE: + return nightmare; case OBOR: return obor; case SARACHNIS: diff --git a/http-api/src/main/java/net/runelite/http/api/hiscore/HiscoreResultBuilder.java b/http-api/src/main/java/net/runelite/http/api/hiscore/HiscoreResultBuilder.java index 3ea03502bd..430755e7dd 100644 --- a/http-api/src/main/java/net/runelite/http/api/hiscore/HiscoreResultBuilder.java +++ b/http-api/src/main/java/net/runelite/http/api/hiscore/HiscoreResultBuilder.java @@ -117,6 +117,7 @@ class HiscoreResultBuilder hiscoreResult.setKreearra(skills.get(index++)); hiscoreResult.setKrilTsutsaroth(skills.get(index++)); hiscoreResult.setMimic(skills.get(index++)); + hiscoreResult.setNightmare(skills.get(index++)); hiscoreResult.setObor(skills.get(index++)); hiscoreResult.setSarachnis(skills.get(index++)); hiscoreResult.setScorpia(skills.get(index++)); diff --git a/http-api/src/main/java/net/runelite/http/api/hiscore/HiscoreSkill.java b/http-api/src/main/java/net/runelite/http/api/hiscore/HiscoreSkill.java index ac57522a5b..e20fafac0f 100644 --- a/http-api/src/main/java/net/runelite/http/api/hiscore/HiscoreSkill.java +++ b/http-api/src/main/java/net/runelite/http/api/hiscore/HiscoreSkill.java @@ -96,6 +96,7 @@ public enum HiscoreSkill KREEARRA("Kree'Arra", BOSS), KRIL_TSUTSAROTH("K'ril Tsutsaroth", BOSS), MIMIC("Mimic", BOSS), + NIGHTMARE("Nightmare", BOSS), OBOR("Obor", BOSS), SARACHNIS("Sarachnis", BOSS), SCORPIA("Scorpia", BOSS), diff --git a/http-service/src/test/java/net/runelite/http/service/hiscore/HiscoreServiceTest.java b/http-service/src/test/java/net/runelite/http/service/hiscore/HiscoreServiceTest.java index ee91740e17..d825d3047b 100644 --- a/http-service/src/test/java/net/runelite/http/service/hiscore/HiscoreServiceTest.java +++ b/http-service/src/test/java/net/runelite/http/service/hiscore/HiscoreServiceTest.java @@ -98,6 +98,7 @@ public class HiscoreServiceTest + "10170,184\n" + "8064,202\n" + "6936,2\n" + + "2335,9\n" + "-1,-1\n" + "-1,-1\n" + "19779,22\n" diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/hiscore/HiscorePanel.java b/runelite-client/src/main/java/net/runelite/client/plugins/hiscore/HiscorePanel.java index fa2a72f92a..4e67a0868c 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/hiscore/HiscorePanel.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/hiscore/HiscorePanel.java @@ -105,12 +105,12 @@ public class HiscorePanel extends PluginPanel GIANT_MOLE, GROTESQUE_GUARDIANS, HESPORI, KALPHITE_QUEEN, KING_BLACK_DRAGON, KRAKEN, KREEARRA, KRIL_TSUTSAROTH, MIMIC, - OBOR, SARACHNIS, SCORPIA, - SKOTIZO, THE_GAUNTLET, THE_CORRUPTED_GAUNTLET, - THEATRE_OF_BLOOD, THERMONUCLEAR_SMOKE_DEVIL, TZKAL_ZUK, - TZTOK_JAD, VENENATIS, VETION, - VORKATH, WINTERTODT, ZALCANO, - ZULRAH + NIGHTMARE, OBOR, SARACHNIS, + SCORPIA, SKOTIZO, THE_GAUNTLET, + THE_CORRUPTED_GAUNTLET, THEATRE_OF_BLOOD, THERMONUCLEAR_SMOKE_DEVIL, + TZKAL_ZUK, TZTOK_JAD, VENENATIS, + VETION, VORKATH, WINTERTODT, + ZALCANO, ZULRAH ); @Inject diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/hiscore/bosses/nightmare.png b/runelite-client/src/main/resources/net/runelite/client/plugins/hiscore/bosses/nightmare.png new file mode 100644 index 0000000000000000000000000000000000000000..22907bb92fa8a2b1cfe2892e74ef1e40dfdaff73 GIT binary patch literal 811 zcmV+`1JwM9P)0nT6(TMe9V8egG#VWu8X_tnA|@gx zEFvm2CMqy0E;TAOKrAvjE-o@KH9RsoKs7u=IX^}^LP|YFO+ZLdLP}IaE;U0#NJULn zMo?NvNKQ#oTuMq&Ofo!7RbEY3Voo(ZP*7G-T4Yf+KvFkAQa4FbTxV2XYE@NRRyspg zVQg1dT~}joSUg5qSz%gQVO%{)U0r2eYIa^;Wnf@uVq$7$W^QR|aA|3BYe-&fZFO#L zcW_K&aBz8Xae8ucdv#D}c6NVwcz}3#fqHs_dwYd@e1&{`hJAg9e}9RAfs2EKjf8}b zg@uoXhLDF_cZi6SiHenri=k6?a}kD8E>o05{Al$4*9m7$iGqnn$kot>$m zpsb>zucV}}rKPc_r?RT5wyPCetgN@KuDP$Ty0Njlwzj{^7;DuUar-rl4-8OF00007 zbW%=J000gwrNiOq*^O5K00C=BL_t(2Q&rOYTftBm2XIV0 zN+Oa_DMj~-f4`lx)id88&*!}F`<%VgXf-H=4#?3FS~(i6`dDQc(0Pz!X)&M0q5!(z zk3>R2wo($a+v@-*fbR40IL9$`tLKa(kYIPIV|0a z699-m7!*34&e8r}%x;Cp*Yb1>52ev)#C-oyb~|jHt>F?3_ho6gm*yy`qT1fYB^d6i z49m?^E{D|u;Z0>3jmOaH!3g_GQdZ0A9Ble?G7tc?i!jb}ZqlC3EW)~9ltFr5d*|sb z#kff7AeVquzcK@W#ua$^j4x2L=f%9qWJ=)gh@b|{&mS!5a8$&cK|h@_Ai=Gi&f)u) z$K@^;@_L(X$%F(|n57H_#^Wi~ZBk~Wb^s_4eM~03ftJr_G#ce?;Z}mMAqe3>G#ri! pE6Nt7cZ}^-z1ne^nw-Et!!J0iIfM2CWiJ2#002ovPDHLkV1kj)P|*MY literal 0 HcmV?d00001 From 20e29fd7309e52c6ed71497fa4590e55afc67540 Mon Sep 17 00:00:00 2001 From: Runelite auto updater Date: Thu, 13 Feb 2020 12:32:44 +0000 Subject: [PATCH 10/15] Release 1.6.6 --- cache-client/pom.xml | 2 +- cache-updater/pom.xml | 2 +- cache/pom.xml | 2 +- http-api/pom.xml | 2 +- http-service/pom.xml | 2 +- pom.xml | 4 ++-- protocol-api/pom.xml | 2 +- protocol/pom.xml | 2 +- runelite-api/pom.xml | 2 +- runelite-client/pom.xml | 2 +- runelite-script-assembler-plugin/pom.xml | 2 +- 11 files changed, 12 insertions(+), 12 deletions(-) diff --git a/cache-client/pom.xml b/cache-client/pom.xml index fa4cf3dc73..261f18d03b 100644 --- a/cache-client/pom.xml +++ b/cache-client/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.6.6-SNAPSHOT + 1.6.6 cache-client diff --git a/cache-updater/pom.xml b/cache-updater/pom.xml index 2312226b8d..3b6063afb5 100644 --- a/cache-updater/pom.xml +++ b/cache-updater/pom.xml @@ -28,7 +28,7 @@ net.runelite runelite-parent - 1.6.6-SNAPSHOT + 1.6.6 Cache Updater diff --git a/cache/pom.xml b/cache/pom.xml index 01b80224af..774c2e138b 100644 --- a/cache/pom.xml +++ b/cache/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.6.6-SNAPSHOT + 1.6.6 cache diff --git a/http-api/pom.xml b/http-api/pom.xml index 15e99bfcfa..b871122ff3 100644 --- a/http-api/pom.xml +++ b/http-api/pom.xml @@ -28,7 +28,7 @@ net.runelite runelite-parent - 1.6.6-SNAPSHOT + 1.6.6 Web API diff --git a/http-service/pom.xml b/http-service/pom.xml index cdaf89b09d..cc352be6f9 100644 --- a/http-service/pom.xml +++ b/http-service/pom.xml @@ -28,7 +28,7 @@ net.runelite runelite-parent - 1.6.6-SNAPSHOT + 1.6.6 Web Service diff --git a/pom.xml b/pom.xml index 76ac38187a..93f5fe113a 100644 --- a/pom.xml +++ b/pom.xml @@ -28,7 +28,7 @@ net.runelite runelite-parent - 1.6.6-SNAPSHOT + 1.6.6 pom RuneLite @@ -60,7 +60,7 @@ https://github.com/runelite/runelite scm:git:git://github.com/runelite/runelite scm:git:git@github.com:runelite/runelite - HEAD + runelite-parent-1.6.6 diff --git a/protocol-api/pom.xml b/protocol-api/pom.xml index a9b3409ba5..9df030d3c8 100644 --- a/protocol-api/pom.xml +++ b/protocol-api/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.6.6-SNAPSHOT + 1.6.6 protocol-api diff --git a/protocol/pom.xml b/protocol/pom.xml index ac83929c03..c5e087207e 100644 --- a/protocol/pom.xml +++ b/protocol/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.6.6-SNAPSHOT + 1.6.6 protocol diff --git a/runelite-api/pom.xml b/runelite-api/pom.xml index 771f6b1665..8d319e6cc9 100644 --- a/runelite-api/pom.xml +++ b/runelite-api/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.6.6-SNAPSHOT + 1.6.6 runelite-api diff --git a/runelite-client/pom.xml b/runelite-client/pom.xml index c7e38492ff..7e525c27b9 100644 --- a/runelite-client/pom.xml +++ b/runelite-client/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.6.6-SNAPSHOT + 1.6.6 client diff --git a/runelite-script-assembler-plugin/pom.xml b/runelite-script-assembler-plugin/pom.xml index 231e04a190..35e953f2a9 100644 --- a/runelite-script-assembler-plugin/pom.xml +++ b/runelite-script-assembler-plugin/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.6.6-SNAPSHOT + 1.6.6 script-assembler-plugin From 9d908110b87a8a9e39601f21d6ad44416470e279 Mon Sep 17 00:00:00 2001 From: Runelite auto updater Date: Thu, 13 Feb 2020 12:32:53 +0000 Subject: [PATCH 11/15] Bump for 1.6.7-SNAPSHOT --- cache-client/pom.xml | 2 +- cache-updater/pom.xml | 2 +- cache/pom.xml | 2 +- http-api/pom.xml | 2 +- http-service/pom.xml | 2 +- pom.xml | 4 ++-- protocol-api/pom.xml | 2 +- protocol/pom.xml | 2 +- runelite-api/pom.xml | 2 +- runelite-client/pom.xml | 2 +- runelite-script-assembler-plugin/pom.xml | 2 +- 11 files changed, 12 insertions(+), 12 deletions(-) diff --git a/cache-client/pom.xml b/cache-client/pom.xml index 261f18d03b..21c063b812 100644 --- a/cache-client/pom.xml +++ b/cache-client/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.6.6 + 1.6.7-SNAPSHOT cache-client diff --git a/cache-updater/pom.xml b/cache-updater/pom.xml index 3b6063afb5..d5b0c7bceb 100644 --- a/cache-updater/pom.xml +++ b/cache-updater/pom.xml @@ -28,7 +28,7 @@ net.runelite runelite-parent - 1.6.6 + 1.6.7-SNAPSHOT Cache Updater diff --git a/cache/pom.xml b/cache/pom.xml index 774c2e138b..e699f46625 100644 --- a/cache/pom.xml +++ b/cache/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.6.6 + 1.6.7-SNAPSHOT cache diff --git a/http-api/pom.xml b/http-api/pom.xml index b871122ff3..beafb32aa8 100644 --- a/http-api/pom.xml +++ b/http-api/pom.xml @@ -28,7 +28,7 @@ net.runelite runelite-parent - 1.6.6 + 1.6.7-SNAPSHOT Web API diff --git a/http-service/pom.xml b/http-service/pom.xml index cc352be6f9..9367ee16c5 100644 --- a/http-service/pom.xml +++ b/http-service/pom.xml @@ -28,7 +28,7 @@ net.runelite runelite-parent - 1.6.6 + 1.6.7-SNAPSHOT Web Service diff --git a/pom.xml b/pom.xml index 93f5fe113a..94bd9be594 100644 --- a/pom.xml +++ b/pom.xml @@ -28,7 +28,7 @@ net.runelite runelite-parent - 1.6.6 + 1.6.7-SNAPSHOT pom RuneLite @@ -60,7 +60,7 @@ https://github.com/runelite/runelite scm:git:git://github.com/runelite/runelite scm:git:git@github.com:runelite/runelite - runelite-parent-1.6.6 + HEAD diff --git a/protocol-api/pom.xml b/protocol-api/pom.xml index 9df030d3c8..3f3d3523c9 100644 --- a/protocol-api/pom.xml +++ b/protocol-api/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.6.6 + 1.6.7-SNAPSHOT protocol-api diff --git a/protocol/pom.xml b/protocol/pom.xml index c5e087207e..c145b19707 100644 --- a/protocol/pom.xml +++ b/protocol/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.6.6 + 1.6.7-SNAPSHOT protocol diff --git a/runelite-api/pom.xml b/runelite-api/pom.xml index 8d319e6cc9..079fbd25fb 100644 --- a/runelite-api/pom.xml +++ b/runelite-api/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.6.6 + 1.6.7-SNAPSHOT runelite-api diff --git a/runelite-client/pom.xml b/runelite-client/pom.xml index 7e525c27b9..6783d4de51 100644 --- a/runelite-client/pom.xml +++ b/runelite-client/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.6.6 + 1.6.7-SNAPSHOT client diff --git a/runelite-script-assembler-plugin/pom.xml b/runelite-script-assembler-plugin/pom.xml index 35e953f2a9..7aaea29f51 100644 --- a/runelite-script-assembler-plugin/pom.xml +++ b/runelite-script-assembler-plugin/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.6.6 + 1.6.7-SNAPSHOT script-assembler-plugin From e737d73257d8a38c7e7c5a6a102c9a7b547c7b03 Mon Sep 17 00:00:00 2001 From: Adam Date: Thu, 13 Feb 2020 10:39:49 -0500 Subject: [PATCH 12/15] loottracker: prevent null events Also detect and log null events from the clue scroll reward interface --- .../client/plugins/loottracker/LootTrackerPlugin.java | 9 ++++++++- .../client/plugins/loottracker/LootTrackerRecord.java | 2 ++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerPlugin.java index b48684ddf9..100bac6b29 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerPlugin.java @@ -54,6 +54,7 @@ import javax.inject.Inject; import javax.swing.SwingUtilities; import lombok.AccessLevel; import lombok.Getter; +import lombok.NonNull; import lombok.extern.slf4j.Slf4j; import net.runelite.api.ChatMessageType; import net.runelite.api.Client; @@ -345,7 +346,7 @@ public class LootTrackerPlugin extends Plugin } } - void addLoot(String name, int combatLevel, LootRecordType type, Collection items) + void addLoot(@NonNull String name, int combatLevel, LootRecordType type, Collection items) { final LootTrackerItem[] entries = buildEntries(stack(items)); SwingUtilities.invokeLater(() -> panel.add(name, type, combatLevel, entries)); @@ -429,6 +430,12 @@ public class LootTrackerPlugin extends Plugin // Clue Scrolls use same InventoryID as Barrows event = eventType; container = client.getItemContainer(InventoryID.BARROWS_REWARD); + + if (event == null) + { + log.debug("Clue scroll reward interface with no event!"); + return; + } break; case (WidgetID.KINGDOM_GROUP_ID): event = "Kingdom of Miscellania"; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerRecord.java b/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerRecord.java index a7f455c1f7..2887d90627 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerRecord.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerRecord.java @@ -24,12 +24,14 @@ */ package net.runelite.client.plugins.loottracker; +import lombok.NonNull; import lombok.Value; import net.runelite.http.api.loottracker.LootRecordType; @Value class LootTrackerRecord { + @NonNull private final String title; private final String subTitle; private final LootRecordType type; From 99e885cb0ae0b4f7cf5dfc60e88e68cfdd4e5d5b Mon Sep 17 00:00:00 2001 From: Adam Date: Thu, 13 Feb 2020 10:47:47 -0500 Subject: [PATCH 13/15] loottracker: fix tracking first clue opens --- .../plugins/loottracker/LootTrackerPlugin.java | 2 +- .../loottracker/LootTrackerPluginTest.java | 18 ++++++++++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerPlugin.java index 100bac6b29..f62e2b4e79 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerPlugin.java @@ -112,7 +112,7 @@ import org.apache.commons.text.WordUtils; public class LootTrackerPlugin extends Plugin { // Activity/Event loot handling - private static final Pattern CLUE_SCROLL_PATTERN = Pattern.compile("You have completed [0-9]+ ([a-z]+) Treasure Trails."); + private static final Pattern CLUE_SCROLL_PATTERN = Pattern.compile("You have completed [0-9]+ ([a-z]+) Treasure Trails?\\."); private static final int THEATRE_OF_BLOOD_REGION = 12867; // Herbiboar loot handling diff --git a/runelite-client/src/test/java/net/runelite/client/plugins/loottracker/LootTrackerPluginTest.java b/runelite-client/src/test/java/net/runelite/client/plugins/loottracker/LootTrackerPluginTest.java index 29a690c694..e28f122305 100644 --- a/runelite-client/src/test/java/net/runelite/client/plugins/loottracker/LootTrackerPluginTest.java +++ b/runelite-client/src/test/java/net/runelite/client/plugins/loottracker/LootTrackerPluginTest.java @@ -76,19 +76,29 @@ public class LootTrackerPluginTest public void setUp() { Guice.createInjector(BoundFieldModule.of(this)).injectMembers(this); + + Player player = mock(Player.class); + when(player.getWorldLocation()).thenReturn(new WorldPoint(0, 0, 0)); + when(client.getLocalPlayer()).thenReturn(player); } @Test public void testPickPocket() { - Player player = mock(Player.class); - when(player.getWorldLocation()).thenReturn(new WorldPoint(0, 0, 0)); - when(client.getLocalPlayer()).thenReturn(player); - ChatMessage chatMessage = new ChatMessage(null, ChatMessageType.SPAM, "", "You pick the hero's pocket.", "", 0); lootTrackerPlugin.onChatMessage(chatMessage); assertEquals("Hero", lootTrackerPlugin.eventType); assertEquals(LootRecordType.PICKPOCKET, lootTrackerPlugin.lootRecordType); } + + @Test + public void testFirstClue() + { + ChatMessage chatMessage = new ChatMessage(null, ChatMessageType.GAMEMESSAGE, "", "You have completed 1 master Treasure Trail.", "", 0); + lootTrackerPlugin.onChatMessage(chatMessage); + + assertEquals("Clue Scroll (Master)", lootTrackerPlugin.eventType); + assertEquals(LootRecordType.EVENT, lootTrackerPlugin.lootRecordType); + } } \ No newline at end of file From ed8a1b92ba397f404d861e225b812d744739515b Mon Sep 17 00:00:00 2001 From: Adam Date: Thu, 13 Feb 2020 17:25:46 -0500 Subject: [PATCH 14/15] pom: update maven repo link and use https --- pom.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 94bd9be594..505c997920 100644 --- a/pom.xml +++ b/pom.xml @@ -84,12 +84,12 @@ maven-central - http://repo1.maven.org/maven2 + https://repo.maven.apache.org/maven2 runelite RuneLite - http://repo.runelite.net + https://repo.runelite.net true always @@ -99,12 +99,12 @@ maven-central-plugins - http://repo1.maven.org/maven2 + https://repo.maven.apache.org/maven2 runelite-plugins RuneLite Plugins - http://repo.runelite.net + https://repo.runelite.net true always From 4228e89c18c3642a51e02189c69acacc66900b32 Mon Sep 17 00:00:00 2001 From: Owain van Brakel Date: Sat, 15 Feb 2020 02:33:51 +0100 Subject: [PATCH 15/15] version: Bump RL version --- buildSrc/src/main/kotlin/Dependencies.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildSrc/src/main/kotlin/Dependencies.kt b/buildSrc/src/main/kotlin/Dependencies.kt index 07b0ca823c..1129b24d1a 100644 --- a/buildSrc/src/main/kotlin/Dependencies.kt +++ b/buildSrc/src/main/kotlin/Dependencies.kt @@ -25,7 +25,7 @@ object ProjectVersions { const val launcherVersion = "2.0.4" - const val rlVersion = "1.6.6-SNAPSHOT" + const val rlVersion = "1.6.6" const val openosrsVersion = "3.0.0"