diff options
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/party')
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/party/PartyManager.java | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/party/PartyManager.java b/src/main/java/kr/syeyoung/dungeonsguide/party/PartyManager.java index 2ba47dfc..8f938ca3 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/party/PartyManager.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/party/PartyManager.java @@ -23,10 +23,8 @@ import org.json.JSONArray; import org.json.JSONObject; import java.security.SecureRandom; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; +import java.util.*; +import java.util.function.Consumer; public class PartyManager implements StompMessageHandler { public static final PartyManager INSTANCE = new PartyManager(); @@ -46,6 +44,10 @@ public class PartyManager implements StompMessageHandler { private int invitedDash =0; @Getter + private Queue<Consumer<Set<String>>> runOnMembersReceived = new LinkedList<>(); + + + @Getter @Setter private int maxParty = 5; @@ -141,6 +143,10 @@ public class PartyManager implements StompMessageHandler { if (partyJoin == 2 || partyJoin == 100) { partyJoin = 0; // REQ PARTY JOIN + Consumer<Set<String>> r; + while ((r = runOnMembersReceived.poll()) != null){ + r.accept(members); + } JSONArray jsonArray = new JSONArray(); for (String member : members) { |