sxcybot

Discord bot for OSRS based channels
git clone git://git.wimdupont.com/sxcybot.git
Log | Files | Refs | README | LICENSE

commit 85dbabb11f773c380899435c63d8b3f2867fbbe1
parent 9ab9b6cb1e8029972327fc955e84189c4b538b4d
Author: Wim Dupont <wim@wimdupont.com>
Date:   Thu, 21 Mar 2024 19:39:29 +0100

editboss as general or up

Diffstat:
Dsrc/main/java/com/wimdupont/sxcybot/exceptions/OsrsHiscoreOrderValueException.java | 9---------
Msrc/main/java/com/wimdupont/sxcybot/listeners/AdminCommandListener.java | 3++-
Dsrc/test/R__hiscores.sql | 94-------------------------------------------------------------------------------
Msrc/test/java/com/wimdupont/sxcybot/client/HiScoreClientTest.java | 4++--
4 files changed, 4 insertions(+), 106 deletions(-)

diff --git a/src/main/java/com/wimdupont/sxcybot/exceptions/OsrsHiscoreOrderValueException.java b/src/main/java/com/wimdupont/sxcybot/exceptions/OsrsHiscoreOrderValueException.java @@ -1,9 +0,0 @@ -package com.wimdupont.sxcybot.exceptions; - -public class OsrsHiscoreOrderValueException extends RuntimeException { - - - public OsrsHiscoreOrderValueException(String msg) { - super(msg); - } -} diff --git a/src/main/java/com/wimdupont/sxcybot/listeners/AdminCommandListener.java b/src/main/java/com/wimdupont/sxcybot/listeners/AdminCommandListener.java @@ -30,6 +30,7 @@ public class AdminCommandListener extends ListenerAdapter { private static final int GOD = 0; private static final int ADMIN_ROLE = 1; + private static final int GENERAL = 3; private static final int SUB_ADMIN = 5; private static final int STAFF_ROLE = 10; @@ -95,7 +96,7 @@ public class AdminCommandListener extends ListenerAdapter { editPvmListener.process(event); } case EDITBOSS -> { - isPrivileged(roleStream, event, STAFF_ROLE); + isPrivileged(roleStream, event, GENERAL); bossUpdateMultiplierListener.process(event); } default -> { diff --git a/src/test/R__hiscores.sql b/src/test/R__hiscores.sql @@ -1,94 +0,0 @@ ---DELETE FROM osrs_hiscore_stat; --- ---INSERT INTO osrs_hiscore_stat ---VALUES --- (UUID(), "Overall", 0), --- (UUID(), "Attack", 1), --- (UUID(), "Defence", 2), --- (UUID(), "Strength", 3), --- (UUID(), "Hitpoints", 4), --- (UUID(), "Ranged", 5), --- (UUID(), "Prayer", 6), --- (UUID(), "Magic", 7), --- (UUID(), "Cooking", 8), --- (UUID(), "Woodcutting", 9), --- (UUID(), "Fletching", 10), --- (UUID(), "Fishing", 11), --- (UUID(), "Firemaking", 12), --- (UUID(), "Crafting", 13), --- (UUID(), "Smithing", 14), --- (UUID(), "Mining", 15), --- (UUID(), "Herblore", 16), --- (UUID(), "Agility", 17), --- (UUID(), "Thieving", 18), --- (UUID(), "Slayer", 19), --- (UUID(), "Farming", 20), --- (UUID(), "Runecrafting", 21), --- (UUID(), "Hunter", 22), --- (UUID(), "Construction", 23); --- ---DELETE FROM osrs_hiscore_boss; --- ---INSERT INTO osrs_hiscore_boss ---VALUES ---(UUID(), 'Abyssal Sire', 1, 42, 1), ---(UUID(), 'Alchemical Hydra', 1, 43, 1), ---(UUID(), 'Artio', 2, 44, 3), ---(UUID(), 'Barrows Chests', 1, 45, 1), ---(UUID(), 'Bryophyta', 1, 46, 1), ---(UUID(), 'Cal\'varion', 2, 47, 3), ---(UUID(), 'Callisto', 3, 48, 3), ---(UUID(), 'Cerberus', 1, 49, 1), ---(UUID(), 'Chambers of Xeric', 1, 50, 2), ---(UUID(), 'Chambers of Xeric: Challenge Mode', 1, 51, 2), ---(UUID(), 'Chaos Elemental', 3, 52, 3), ---(UUID(), 'Chaos Fanatic', 2, 53, 3), ---(UUID(), 'Commander Zilyana', 1, 54, 1), ---(UUID(), 'Corporeal Beast', 1, 55, 1), ---(UUID(), 'Crazy Archaeologist', 2, 56, 3), ---(UUID(), 'Dagannoth Prime', 1, 57, 1), ---(UUID(), 'Dagannoth Rex', 1, 58, 1), ---(UUID(), 'Dagannoth Supreme', 1, 59, 1), ---(UUID(), 'Deranged Archaeologist', 1, 60, 1), ---(UUID(), 'Duke Sucellus', 1, 61, 1), ---(UUID(), 'General Graardor', 1, 62, 1), ---(UUID(), 'Giant Mole', 1, 63, 1), ---(UUID(), 'Grotesque Guardians', 1, 64, 1), ---(UUID(), 'Hespori', 1, 65, 1), ---(UUID(), 'Kalphite Queen', 1, 66, 1), ---(UUID(), 'King Black Dragon', 1, 67, 1), ---(UUID(), 'Kraken', 1, 68, 1), ---(UUID(), 'Kree\' Arra', 1, 69, 1), ---(UUID(), 'K\'ril Tsutsaroth', 1, 70, 1), ---(UUID(), 'Lunar Chests', 1, 71, 1), ---(UUID(), 'Mimic', 1, 72, 1), ---(UUID(), 'Nex', 3, 73, 1), ---(UUID(), 'Nightmare', 1, 74, 1), ---(UUID(), 'Phosani\'s Nightmare', 6, 75, 1), ---(UUID(), 'Obor', 1, 76, 1), ---(UUID(), 'Phantom Muspah', 2, 77, 1), ---(UUID(), 'Sarachnis', 1, 78, 1), ---(UUID(), 'Scorpia', 3, 79, 3), ---(UUID(), 'Scurrius', 1, 80, 1), ---(UUID(), 'Skotizo', 1, 81, 1), ---(UUID(), 'Sol Heredit', 1, 82, 1), ---(UUID(), 'Spindel', 2, 83, 3), ---(UUID(), 'Tempoross', 1, 84, 0), ---(UUID(), 'The Gauntlet', 1, 85, 1), ---(UUID(), 'The Corrupted Gauntlet', 1, 86, 1), ---(UUID(), 'The Leviathan', 1, 87, 1), ---(UUID(), 'The Whisperer', 1, 88, 1), ---(UUID(), 'Theatre of Blood', 1, 89, 2), ---(UUID(), 'Theatre of Blood: Hard Mode', 1, 90, 2), ---(UUID(), 'Thermonuclear Smoke Devil', 1, 91, 1), ---(UUID(), 'Tombs of Amascut', 10, 92, 5), ---(UUID(), 'Tombs of Amascut: Expert Mode', 14, 93, 5), ---(UUID(), 'TzKal-Zuk', 1, 94, 1), ---(UUID(), 'TzTok-Jad', 1, 95, 1), ---(UUID(), 'Vardorvis', 1, 96, 1), ---(UUID(), 'Venenatis', 3, 97, 3), ---(UUID(), 'Vet\'ion', 3, 95, 6), ---(UUID(), 'Vorkath', 1, 96, 4), ---(UUID(), 'Wintertodt', 1, 100, 0), ---(UUID(), 'Zalcano', 1, 101, 0), ---(UUID(), 'Zulrah', 1, 102, 1); diff --git a/src/test/java/com/wimdupont/sxcybot/client/HiScoreClientTest.java b/src/test/java/com/wimdupont/sxcybot/client/HiScoreClientTest.java @@ -75,10 +75,10 @@ class HiScoreClientTest { assertTrue(1939 <= Integer.parseInt(result.get(0).level())); assertEquals("Strength", result.get(3).name()); - assertTrue(99 == Integer.parseInt(result.get(3).level())); + assertEquals(99, Integer.parseInt(result.get(3).level())); assertEquals("Hitpoints", result.get(4).name()); - assertTrue(99 == Integer.parseInt(result.get(4).level())); + assertEquals(99, Integer.parseInt(result.get(4).level())); } @Test