xp updater: send account hash to templeosrs
This commit is contained in:
@@ -114,8 +114,8 @@ public class XpUpdaterPlugin extends Plugin
|
|||||||
// Don't submit update unless xp threshold is reached
|
// Don't submit update unless xp threshold is reached
|
||||||
if (Math.abs(totalXp - lastXp) > XP_THRESHOLD)
|
if (Math.abs(totalXp - lastXp) > XP_THRESHOLD)
|
||||||
{
|
{
|
||||||
log.debug("Submitting update for {}", local.getName());
|
log.debug("Submitting update for {} accountHash {}", local.getName(), lastAccount);
|
||||||
update(local.getName());
|
update(lastAccount, local.getName());
|
||||||
lastXp = totalXp;
|
lastXp = totalXp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -131,12 +131,12 @@ public class XpUpdaterPlugin extends Plugin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void update(String username)
|
private void update(long accountHash, String username)
|
||||||
{
|
{
|
||||||
EnumSet<WorldType> worldTypes = client.getWorldType();
|
EnumSet<WorldType> worldTypes = client.getWorldType();
|
||||||
username = username.replace(" ", "_");
|
username = username.replace(" ", "_");
|
||||||
updateCml(username, worldTypes);
|
updateCml(username, worldTypes);
|
||||||
updateTempleosrs(username, worldTypes);
|
updateTempleosrs(accountHash, username, worldTypes);
|
||||||
updateWom(username, worldTypes);
|
updateWom(username, worldTypes);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -165,7 +165,7 @@ public class XpUpdaterPlugin extends Plugin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateTempleosrs(String username, EnumSet<WorldType> worldTypes)
|
private void updateTempleosrs(long accountHash, String username, EnumSet<WorldType> worldTypes)
|
||||||
{
|
{
|
||||||
if (config.templeosrs()
|
if (config.templeosrs()
|
||||||
&& !worldTypes.contains(WorldType.SEASONAL)
|
&& !worldTypes.contains(WorldType.SEASONAL)
|
||||||
@@ -178,6 +178,7 @@ public class XpUpdaterPlugin extends Plugin
|
|||||||
.addPathSegment("php")
|
.addPathSegment("php")
|
||||||
.addPathSegment("add_datapoint.php")
|
.addPathSegment("add_datapoint.php")
|
||||||
.addQueryParameter("player", username)
|
.addQueryParameter("player", username)
|
||||||
|
.addQueryParameter("accountHash", Long.toString(accountHash))
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
Request request = new Request.Builder()
|
Request request = new Request.Builder()
|
||||||
|
|||||||
Reference in New Issue
Block a user