http api/service: update Jagex hiscore API

This commit is contained in:
Magic fTail
2018-10-31 17:21:53 +01:00
committed by Adam
parent 673a2902e7
commit 803a019a27
4 changed files with 80 additions and 75 deletions

View File

@@ -53,15 +53,15 @@ public class HiscoreResult
private Skill runecraft; private Skill runecraft;
private Skill hunter; private Skill hunter;
private Skill construction; private Skill construction;
private Skill bountyHunterHunter;
private Skill bountyHunterRogue;
private Skill clueScrollAll;
private Skill clueScrollEasy; private Skill clueScrollEasy;
private Skill clueScrollMedium; private Skill clueScrollMedium;
private Skill clueScrollAll;
private Skill bountyHunterRogue;
private Skill bountyHunterHunter;
private Skill clueScrollHard; private Skill clueScrollHard;
private Skill lastManStanding;
private Skill clueScrollElite; private Skill clueScrollElite;
private Skill clueScrollMaster; private Skill clueScrollMaster;
private Skill lastManStanding;
public String getPlayer() public String getPlayer()
{ {
@@ -313,6 +313,36 @@ public class HiscoreResult
this.construction = construction; this.construction = construction;
} }
public Skill getBountyHunterHunter()
{
return bountyHunterHunter;
}
public void setBountyHunterHunter(Skill bountyHunterHunter)
{
this.bountyHunterHunter = bountyHunterHunter;
}
public Skill getBountyHunterRogue()
{
return bountyHunterRogue;
}
public void setBountyHunterRogue(Skill bountyHunterRogue)
{
this.bountyHunterRogue = bountyHunterRogue;
}
public Skill getClueScrollAll()
{
return clueScrollAll;
}
public void setClueScrollAll(Skill clueScrollAll)
{
this.clueScrollAll = clueScrollAll;
}
public Skill getClueScrollEasy() public Skill getClueScrollEasy()
{ {
return clueScrollEasy; return clueScrollEasy;
@@ -333,36 +363,6 @@ public class HiscoreResult
this.clueScrollMedium = clueScrollMedium; this.clueScrollMedium = clueScrollMedium;
} }
public Skill getClueScrollAll()
{
return clueScrollAll;
}
public void setClueScrollAll(Skill clueScrollAll)
{
this.clueScrollAll = clueScrollAll;
}
public Skill getBountyHunterRogue()
{
return bountyHunterRogue;
}
public void setBountyHunterRogue(Skill bountyHunterRogue)
{
this.bountyHunterRogue = bountyHunterRogue;
}
public Skill getBountyHunterHunter()
{
return bountyHunterHunter;
}
public void setBountyHunterHunter(Skill bountyHunterHunter)
{
this.bountyHunterHunter = bountyHunterHunter;
}
public Skill getClueScrollHard() public Skill getClueScrollHard()
{ {
return clueScrollHard; return clueScrollHard;
@@ -373,16 +373,6 @@ public class HiscoreResult
this.clueScrollHard = clueScrollHard; this.clueScrollHard = clueScrollHard;
} }
public Skill getLastManStanding()
{
return lastManStanding;
}
public void setLastManStanding(Skill lastManStanding)
{
this.lastManStanding = lastManStanding;
}
public Skill getClueScrollElite() public Skill getClueScrollElite()
{ {
return clueScrollElite; return clueScrollElite;
@@ -403,6 +393,16 @@ public class HiscoreResult
this.clueScrollMaster = clueScrollMaster; this.clueScrollMaster = clueScrollMaster;
} }
public Skill getLastManStanding()
{
return lastManStanding;
}
public void setLastManStanding(Skill lastManStanding)
{
this.lastManStanding = lastManStanding;
}
public Skill getSkill(HiscoreSkill skill) public Skill getSkill(HiscoreSkill skill)
{ {
switch (skill) switch (skill)
@@ -455,24 +455,24 @@ public class HiscoreResult
return getConstruction(); return getConstruction();
case OVERALL: case OVERALL:
return getOverall(); return getOverall();
case BOUNTY_HUNTER_HUNTER:
return getBountyHunterHunter();
case BOUNTY_HUNTER_ROGUE:
return getBountyHunterRogue();
case CLUE_SCROLL_ALL:
return getClueScrollAll();
case CLUE_SCROLL_EASY: case CLUE_SCROLL_EASY:
return getClueScrollEasy(); return getClueScrollEasy();
case CLUE_SCROLL_MEDIUM: case CLUE_SCROLL_MEDIUM:
return getClueScrollMedium(); return getClueScrollMedium();
case CLUE_SCROLL_ALL:
return getClueScrollAll();
case BOUNTY_HUNTER_ROGUE:
return getBountyHunterRogue();
case BOUNTY_HUNTER_HUNTER:
return getBountyHunterHunter();
case CLUE_SCROLL_HARD: case CLUE_SCROLL_HARD:
return getClueScrollHard(); return getClueScrollHard();
case LAST_MAN_STANDING:
return getLastManStanding();
case CLUE_SCROLL_ELITE: case CLUE_SCROLL_ELITE:
return getClueScrollElite(); return getClueScrollElite();
case CLUE_SCROLL_MASTER: case CLUE_SCROLL_MASTER:
return getClueScrollMaster(); return getClueScrollMaster();
case LAST_MAN_STANDING:
return getLastManStanding();
} }
throw new IllegalArgumentException("Invalid hiscore item"); throw new IllegalArgumentException("Invalid hiscore item");
@@ -507,15 +507,15 @@ public class HiscoreResult
hash = 29 * hash + Objects.hashCode(this.runecraft); hash = 29 * hash + Objects.hashCode(this.runecraft);
hash = 29 * hash + Objects.hashCode(this.hunter); hash = 29 * hash + Objects.hashCode(this.hunter);
hash = 29 * hash + Objects.hashCode(this.construction); hash = 29 * hash + Objects.hashCode(this.construction);
hash = 29 * hash + Objects.hashCode(this.clueScrollEasy);
hash = 29 * hash + Objects.hashCode(this.clueScrollMedium);
hash = 29 * hash + Objects.hashCode(this.clueScrollAll);
hash = 29 * hash + Objects.hashCode(this.bountyHunterRogue); hash = 29 * hash + Objects.hashCode(this.bountyHunterRogue);
hash = 29 * hash + Objects.hashCode(this.bountyHunterHunter); hash = 29 * hash + Objects.hashCode(this.bountyHunterHunter);
hash = 29 * hash + Objects.hashCode(this.clueScrollAll);
hash = 29 * hash + Objects.hashCode(this.clueScrollEasy);
hash = 29 * hash + Objects.hashCode(this.clueScrollMedium);
hash = 29 * hash + Objects.hashCode(this.clueScrollHard); hash = 29 * hash + Objects.hashCode(this.clueScrollHard);
hash = 29 * hash + Objects.hashCode(this.lastManStanding);
hash = 29 * hash + Objects.hashCode(this.clueScrollElite); hash = 29 * hash + Objects.hashCode(this.clueScrollElite);
hash = 29 * hash + Objects.hashCode(this.clueScrollMaster); hash = 29 * hash + Objects.hashCode(this.clueScrollMaster);
hash = 29 * hash + Objects.hashCode(this.lastManStanding);
return hash; return hash;
} }

View File

@@ -77,15 +77,15 @@ public class HiscoreResultBuilder
hiscoreResult.setRunecraft(skills.get(21)); hiscoreResult.setRunecraft(skills.get(21));
hiscoreResult.setHunter(skills.get(22)); hiscoreResult.setHunter(skills.get(22));
hiscoreResult.setConstruction(skills.get(23)); hiscoreResult.setConstruction(skills.get(23));
hiscoreResult.setClueScrollEasy(skills.get(24)); hiscoreResult.setBountyHunterHunter(skills.get(24));
hiscoreResult.setClueScrollMedium(skills.get(25)); hiscoreResult.setBountyHunterRogue(skills.get(25));
hiscoreResult.setClueScrollAll(skills.get(26)); hiscoreResult.setClueScrollAll(skills.get(26));
hiscoreResult.setBountyHunterRogue(skills.get(27)); hiscoreResult.setClueScrollEasy(skills.get(27));
hiscoreResult.setBountyHunterHunter(skills.get(28)); hiscoreResult.setClueScrollMedium(skills.get(28));
hiscoreResult.setClueScrollHard(skills.get(29)); hiscoreResult.setClueScrollHard(skills.get(29));
hiscoreResult.setLastManStanding(skills.get(30)); hiscoreResult.setClueScrollElite(skills.get(30));
hiscoreResult.setClueScrollElite(skills.get(31)); hiscoreResult.setClueScrollMaster(skills.get(31));
hiscoreResult.setClueScrollMaster(skills.get(32)); hiscoreResult.setLastManStanding(skills.get(32));
return hiscoreResult; return hiscoreResult;
} }
} }

View File

@@ -50,15 +50,15 @@ public enum HiscoreSkill
RUNECRAFT("Runecraft"), RUNECRAFT("Runecraft"),
HUNTER("Hunter"), HUNTER("Hunter"),
CONSTRUCTION("Construction"), CONSTRUCTION("Construction"),
BOUNTY_HUNTER_HUNTER("Bounty Hunter - Hunter"),
BOUNTY_HUNTER_ROGUE("Bounty Hunter - Rogue"),
CLUE_SCROLL_ALL("Clue Scrolls (all)"),
CLUE_SCROLL_EASY("Clue Scrolls (easy)"), CLUE_SCROLL_EASY("Clue Scrolls (easy)"),
CLUE_SCROLL_MEDIUM("Clue Scrolls (medium)"), CLUE_SCROLL_MEDIUM("Clue Scrolls (medium)"),
CLUE_SCROLL_ALL("Clue Scrolls (all)"),
BOUNTY_HUNTER_ROGUE("Bounty Hunter - Rogue"),
BOUNTY_HUNTER_HUNTER("Bounty Hunter - Hunter"),
CLUE_SCROLL_HARD("Clue Scrolls (hard)"), CLUE_SCROLL_HARD("Clue Scrolls (hard)"),
LAST_MAN_STANDING("Last Man Standing"),
CLUE_SCROLL_ELITE("Clue Scrolls (elite)"), CLUE_SCROLL_ELITE("Clue Scrolls (elite)"),
CLUE_SCROLL_MASTER("Clue Scrolls (master)"); CLUE_SCROLL_MASTER("Clue Scrolls (master)"),
LAST_MAN_STANDING("Last Man Standing");
private final String name; private final String name;

View File

@@ -61,14 +61,14 @@ public class HiscoreServiceTest
+ "516239,9,1000\n" + "516239,9,1000\n"
+ "492790,1,0\n" + "492790,1,0\n"
+ "-1,-1\n" + "-1,-1\n"
+ "-1,-1\n" + "73,1738\n"
+ "531,1432\n" + "531,1432\n"
+ "-1,-1\n" + "8008,131\n"
+ "-1,-1\n" + "1337,911\n"
+ "-1,-1\n" + "42,14113\n"
+ "-1,-1\n" + "1,777\n"
+ "-1,-1\n" + "254,92\n"
+ "254,92"; + "-1,-1";
private final MockWebServer server = new MockWebServer(); private final MockWebServer server = new MockWebServer();
@@ -97,7 +97,12 @@ public class HiscoreServiceTest
Assert.assertEquals(159727L, result.getFishing().getExperience()); Assert.assertEquals(159727L, result.getFishing().getExperience());
Assert.assertEquals(492790, result.getConstruction().getRank()); Assert.assertEquals(492790, result.getConstruction().getRank());
Assert.assertEquals(1432, result.getClueScrollAll().getLevel()); Assert.assertEquals(1432, result.getClueScrollAll().getLevel());
Assert.assertEquals(8008, result.getClueScrollEasy().getRank());
Assert.assertEquals(911, result.getClueScrollMedium().getLevel());
Assert.assertEquals(42, result.getClueScrollHard().getRank());
Assert.assertEquals(777, result.getClueScrollElite().getLevel());
Assert.assertEquals(254, result.getClueScrollMaster().getRank()); Assert.assertEquals(254, result.getClueScrollMaster().getRank());
Assert.assertEquals(-1, result.getLastManStanding().getLevel());
} }
} }