Maybe fixed party
This commit is contained in:
parent
777415f97e
commit
2b77607072
|
|
@ -1,6 +1,5 @@
|
||||||
package com.alttd.chat.database;
|
package com.alttd.chat.database;
|
||||||
|
|
||||||
import com.alttd.chat.managers.ChatUserManager;
|
|
||||||
import com.alttd.chat.managers.PartyManager;
|
import com.alttd.chat.managers.PartyManager;
|
||||||
import com.alttd.chat.objects.ChatUser;
|
import com.alttd.chat.objects.ChatUser;
|
||||||
import com.alttd.chat.objects.Mail;
|
import com.alttd.chat.objects.Mail;
|
||||||
|
|
@ -10,8 +9,10 @@ import com.alttd.chat.objects.channels.Channel;
|
||||||
import com.alttd.chat.util.ALogger;
|
import com.alttd.chat.util.ALogger;
|
||||||
|
|
||||||
import java.sql.*;
|
import java.sql.*;
|
||||||
import java.util.*;
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
public class Queries {
|
public class Queries {
|
||||||
|
|
||||||
|
|
@ -185,6 +186,7 @@ public class Queries {
|
||||||
ALogger.warn("Unable to retrieve party: " + id);
|
ALogger.warn("Unable to retrieve party: " + id);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
System.out.println("ADDING PARTY USER " + party.getPartyName() + " " + playerName);
|
||||||
party.putPartyUser(new PartyUser(uuid, displayName, playerName));
|
party.putPartyUser(new PartyUser(uuid, displayName, playerName));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ public class Party {
|
||||||
private UUID ownerUuid;
|
private UUID ownerUuid;
|
||||||
private String partyName;
|
private String partyName;
|
||||||
private String partyPassword;
|
private String partyPassword;
|
||||||
private static ArrayList<PartyUser> partyUsers;
|
private final ArrayList<PartyUser> partyUsers;
|
||||||
|
|
||||||
public Party(int partyId, UUID ownerUuid, String partyName, String partyPassword) {
|
public Party(int partyId, UUID ownerUuid, String partyName, String partyPassword) {
|
||||||
this.partyId = partyId;
|
this.partyId = partyId;
|
||||||
|
|
@ -29,6 +29,9 @@ public class Party {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addUser(ChatUser chatUser, String playerName) {
|
public void addUser(ChatUser chatUser, String playerName) {
|
||||||
|
Party party = PartyManager.getParty(chatUser.getPartyId());
|
||||||
|
if (party != null)
|
||||||
|
party.removeUser(chatUser);
|
||||||
partyUsers.add(new PartyUser(chatUser.getUuid(), chatUser.getDisplayName(), playerName));
|
partyUsers.add(new PartyUser(chatUser.getUuid(), chatUser.getDisplayName(), playerName));
|
||||||
chatUser.setPartyId(getPartyId());
|
chatUser.setPartyId(getPartyId());
|
||||||
Queries.addPartyUser(chatUser);
|
Queries.addPartyUser(chatUser);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user