Added party disband command and a way to remove all users from a party

This commit is contained in:
auto committed 2022-01-31 03:06:52 +01:00
1 parent 032d0e2bef
commit 0c8a4a97d3
5 files changed
+96

No files matched your search

@@ -316,6 +316,24 @@ public class Queries {
}
}
public static void removeAllPartyUsers(ArrayList<PartyUser> partyUsers) {
String query = "UPDATE chat_users SET party_id = -1 WHERE uuid = ?";
try {
Connection connection = DatabaseConnection.getConnection();
PreparedStatement statement = connection.prepareStatement(query);
for (PartyUser partyUser : partyUsers) {
statement.setString(1, partyUser.getUuid().toString());
statement.addBatch();
}
statement.executeBatch();
} catch (SQLException e) {
e.printStackTrace();
}
}
public static void removePartyUser(UUID uuid) {
String query = "UPDATE chat_users SET party_id = -1 WHERE uuid = ?";