From fb41c05d3f5f1f7f005df8b8f8e57fb3f18f1a6c Mon Sep 17 00:00:00 2001 From: Tomas Slusny Date: Fri, 1 Feb 2019 23:13:33 +0100 Subject: [PATCH] Request party sync on party plugin startup If user is in party request party data syncup on party plugin startup Signed-off-by: Tomas Slusny --- .../runelite/client/plugins/party/PartyPlugin.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/party/PartyPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/party/PartyPlugin.java index 4b69e8dee9..b87c2c3564 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/party/PartyPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/party/PartyPlugin.java @@ -125,7 +125,7 @@ public class PartyPlugin extends Plugin implements KeyListener private final List pendingTilePings = Collections.synchronizedList(new ArrayList<>()); private int lastHp, lastPray; - private boolean hotkeyDown; + private boolean hotkeyDown, doSync; @Override public void configure(Binder binder) @@ -142,6 +142,7 @@ public class PartyPlugin extends Plugin implements KeyListener wsClient.registerMessage(TilePing.class); wsClient.registerMessage(LocationUpdate.class); keyManager.registerKeyListener(this); + doSync = true; // Delay sync so eventbus can process correctly. } @Override @@ -157,6 +158,7 @@ public class PartyPlugin extends Plugin implements KeyListener wsClient.unregisterMessage(LocationUpdate.class); keyManager.unregisterKeyListener(this); hotkeyDown = false; + doSync = false; } @Provides @@ -271,6 +273,14 @@ public class PartyPlugin extends Plugin implements KeyListener @Subscribe public void onGameTick(final GameTick event) { + if (doSync && !party.getMembers().isEmpty()) + { + // Request sync + ws.send(new UserSync(party.getLocalMember().getMemberId())); + } + + doSync = false; + final int currentHealth = client.getBoostedSkillLevel(Skill.HITPOINTS); final int currentPrayer = client.getBoostedSkillLevel(Skill.PRAYER); final int realHealth = client.getRealSkillLevel(Skill.HITPOINTS);