From 6ae8172f9152ce93c41448f98715b8a230343d11 Mon Sep 17 00:00:00 2001 From: syeyoung Date: Sun, 22 Oct 2023 01:03:07 +0900 Subject: - only send stomp when is actually connected Signed-off-by: syeyoung --- .../main/java/kr/syeyoung/dungeonsguide/mod/party/PartyManager.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'mod/src/main/java/kr') diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/party/PartyManager.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/party/PartyManager.java index 51d374d3..80dad6c8 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/party/PartyManager.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/party/PartyManager.java @@ -431,13 +431,16 @@ public class PartyManager { } private void leaveParty() { + + if (partyContext != null) { getPartyContext().setPartyExistHypixel(false); if (getPartyContext().isSelfSolo()) return; if (getPartyContext().getPartyID() != null) { JSONObject object = new JSONObject(); object.put("partyid", getPartyContext().getPartyID()); - StompManager.getInstance().send(new StompPayload().payload(object.toString()).destination( "/app/party.leave")); + if (StompManager.getInstance().isStompConnected()) + StompManager.getInstance().send(new StompPayload().payload(object.toString()).destination( "/app/party.leave")); } } @@ -450,6 +453,7 @@ public class PartyManager { getPartyContext().setPartyMember(new TreeSet<>(String.CASE_INSENSITIVE_ORDER)); getPartyContext().setModeratorComplete(true); getPartyContext().setAllInvite(false); joinedParty(); + } private void joinedParty() { JSONArray jsonArray = new JSONArray(); -- cgit