From 5135d001b15890b76c5ad5d467e03a7e4ab324ea Mon Sep 17 00:00:00 2001 From: syeyoung Date: Mon, 31 Jan 2022 16:58:40 +0900 Subject: - add "Party was transfered to X because Y left" --- .../java/kr/syeyoung/dungeonsguide/chat/PartyManager.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/main/java/kr/syeyoung/dungeonsguide/chat/PartyManager.java b/src/main/java/kr/syeyoung/dungeonsguide/chat/PartyManager.java index 72261ae9..fce62813 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/chat/PartyManager.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/chat/PartyManager.java @@ -228,11 +228,21 @@ public class PartyManager implements StompMessageHandler { newLeader = s; break; } - String oldLeader = messageSplit[messageSplit.length-1]; + String oldLeader; + boolean left= false; + if (str.endsWith("§r§eleft§r")) { + oldLeader = messageSplit[messageSplit.length-2]; + left = true; + } else { + oldLeader = messageSplit[messageSplit.length-1]; + } if (oldLeader != null && newLeader != null ) { getPartyContext(true).setPartyOwner(newLeader); - getPartyContext(true).addPartyModerator(oldLeader); + if (left) + getPartyContext(true).removeFromParty(oldLeader); + else + getPartyContext(true).addPartyModerator(oldLeader); } a.put("type", "party_transfer"); potentialInvitenessChange(); -- cgit