From be82a602c461720a86a4206892117f059df57e8d Mon Sep 17 00:00:00 2001 From: GoldenGnu Date: Sat, 26 Oct 2024 19:36:52 +0200 Subject: [PATCH 1/5] Code: Minor optimization of the stockpile tool --- .../eve/jeveasset/gui/tabs/stockpile/Stockpile.java | 12 +++++++++++- .../jeveasset/gui/tabs/stockpile/StockpileData.java | 12 ++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/nikr/eve/jeveasset/gui/tabs/stockpile/Stockpile.java b/src/main/java/net/nikr/eve/jeveasset/gui/tabs/stockpile/Stockpile.java index f6c87c46c..ca8b5e272 100644 --- a/src/main/java/net/nikr/eve/jeveasset/gui/tabs/stockpile/Stockpile.java +++ b/src/main/java/net/nikr/eve/jeveasset/gui/tabs/stockpile/Stockpile.java @@ -877,6 +877,7 @@ public int compare(StockpileFilter o1, StockpileFilter o2) { } //Jobs } else if (industryJob != null) { + //Note: Industry jobs are also filtered for isNotDeliveredToAssets() in StockpileData.updateStockpileItems(Stockpile, boolean) if (typeID < 0) { //Copying in progress (not delivered to assets) if (filter.isJobs() && industryJob.isCopying() && industryJob.isNotDeliveredToAssets()) { if (runs) { //BPC Runs @@ -893,7 +894,8 @@ public int compare(StockpileFilter o1, StockpileFilter o2) { } } } - //Manufacturing in progress (not delivered to assets) + //Manufacturing in progress (not delivered to assets) + //Note: Industry jobs are also filtered for isNotDeliveredToAssets() in StockpileData.updateStockpileItems(Stockpile, boolean) } else if (filter.isJobs() && industryJob.isManufacturing() && industryJob.isNotDeliveredToAssets()) { if (add) { //Match jobsCountNow = jobsCountNow + ((long)industryJob.getRuns() * (long)industryJob.getProductQuantity()); @@ -908,12 +910,14 @@ public int compare(StockpileFilter o1, StockpileFilter o2) { if (runs && typeID < 0) { continue; //Ignore BPC runs (Can't sell BPC) } + //Note: Market orders are also filtered for isActive() in StockpileData.updateStockpileItems(Stockpile, boolean) if (!marketOrder.isBuyOrder() && marketOrder.isActive() && filter.isSellOrders()) { if (add) { //Open/Active sell order - match sellOrdersCountNow = sellOrdersCountNow + marketOrder.getVolumeRemain(); } else { count = count + marketOrder.getVolumeRemain(); } + //Note: Market orders are also filtered for isActive() in StockpileData.updateStockpileItems(Stockpile, boolean) } else if (marketOrder.isBuyOrder() && marketOrder.isActive() && filter.isBuyOrders()) { if (add) { //Open/Active buy order - match buyOrdersCountNow = buyOrdersCountNow + marketOrder.getVolumeRemain(); @@ -928,12 +932,14 @@ public int compare(StockpileFilter o1, StockpileFilter o2) { if (runs && typeID < 0) { continue; //Ignore BPC runs (Can't sell BPC) } + //Note: Transactions are also filter for isAfterAssets() in StockpileData.updateStockpileItems(Stockpile, boolean) if (transaction.isAfterAssets() && transaction.isBuy() && filter.isBuyTransactions()) { if (add) { //Buy - match buyTransactionsCountNow = buyTransactionsCountNow + transaction.getQuantity(); } else { count = count + transaction.getQuantity(); } + //Note: Transactions are also filter for isAfterAssets() in StockpileData.updateStockpileItems(Stockpile, boolean) } else if (transaction.isAfterAssets() && transaction.isSell() && filter.isSellTransactions()) { if (add) { //Sell - match sellTransactionsCountNow = sellTransactionsCountNow - transaction.getQuantity(); @@ -956,6 +962,7 @@ public int compare(StockpileFilter o1, StockpileFilter o2) { boolean isAcceptor = contractItem.getContract().getAcceptorID() > 0 && matchOwner(filter, contractItem.getContract().getAcceptorID()); //Sell: Issuer Included or Acceptor Excluded if ((isIssuer && contractItem.isIncluded()) || (isAcceptor && !contractItem.isIncluded())) { + //Note: Contract items are also filter for isOpen() in StockpileData.updateStockpileItems(Stockpile, boolean) if (contractItem.getContract().isOpen() && filter.isSellingContracts()) { if (add) { //Selling sellingContractsCountNow = sellingContractsCountNow + contractItem.getQuantity(); @@ -963,6 +970,7 @@ public int compare(StockpileFilter o1, StockpileFilter o2) { count = count + contractItem.getQuantity(); } found = true; + //Note: Contract items are also filter for isCompletedSuccessful() in StockpileData.updateStockpileItems(Stockpile, boolean) } else if (contractItem.getContract().isCompletedSuccessful() && filter.isSoldContracts()) { //Sold if ((isIssuer && contractItem.getContract().isIssuerAfterAssets()) || isAcceptor && contractItem.getContract().isAcceptorAfterAssets()) { @@ -977,6 +985,7 @@ public int compare(StockpileFilter o1, StockpileFilter o2) { } //Buy: Issuer Excluded or Acceptor Included if ((isIssuer && !contractItem.isIncluded()) || (isAcceptor && contractItem.isIncluded())) { + //Note: Contract items are also filter for isOpen() in StockpileData.updateStockpileItems(Stockpile, boolean) if (contractItem.getContract().isOpen() && filter.isBuyingContracts()) { if (add) { //Buying buyingContractsCountNow = buyingContractsCountNow + contractItem.getQuantity(); @@ -984,6 +993,7 @@ public int compare(StockpileFilter o1, StockpileFilter o2) { count = count + contractItem.getQuantity(); } found = true; + //Note: Contract items are also filter for isCompletedSuccessful() in StockpileData.updateStockpileItems(Stockpile, boolean) } else if (contractItem.getContract().isCompletedSuccessful() && filter.isBoughtContracts()) { //Bought if ((isIssuer && contractItem.getContract().isIssuerAfterAssets()) || isAcceptor && contractItem.getContract().isAcceptorAfterAssets()) { diff --git a/src/main/java/net/nikr/eve/jeveasset/gui/tabs/stockpile/StockpileData.java b/src/main/java/net/nikr/eve/jeveasset/gui/tabs/stockpile/StockpileData.java index 13575d6e6..68732c83e 100644 --- a/src/main/java/net/nikr/eve/jeveasset/gui/tabs/stockpile/StockpileData.java +++ b/src/main/java/net/nikr/eve/jeveasset/gui/tabs/stockpile/StockpileData.java @@ -164,6 +164,9 @@ private void updateStockpileItems(Stockpile stockpile, boolean updateClaims) { if (contractItem.getContract().isIgnoreContract()) { continue; } + if (!contractItem.getContract().isOpen() && !contractItem.getContract().isCompletedSuccessful() ) { + continue; //Only include open and successfully completed contracts + } Integer typeID = get(contractItem.getTypeID(), contractItem.isBPC()); //Ignore null and wrong typeID if (ignore(typeIDs, typeID)) { @@ -203,6 +206,9 @@ private void updateStockpileItems(Stockpile stockpile, boolean updateClaims) { //Market Orders if (stockpile.isBuyOrders() || stockpile.isSellOrders()) { for (MyMarketOrder marketOrder : profileData.getMarketOrdersList()) { + if (!marketOrder.isActive()) { + continue; //Only include active orders + } Integer typeID = marketOrder.getTypeID(); //Ignore null and wrong typeID if (ignore(typeIDs, typeID)) { @@ -215,6 +221,9 @@ private void updateStockpileItems(Stockpile stockpile, boolean updateClaims) { //Industry Jobs if (stockpile.isJobs()) { for (MyIndustryJob industryJob : profileData.getIndustryJobsList()) { + if (!industryJob.isNotDeliveredToAssets()) { + continue; //Only include industry jobs not delivered + } //Manufacturing Integer productTypeID = industryJob.getProductTypeID(); if (!ignore(typeIDs, productTypeID)) { //Ignore null and wrong typeID @@ -230,6 +239,9 @@ private void updateStockpileItems(Stockpile stockpile, boolean updateClaims) { //Transactions if (stockpile.isTransactions()) { for (MyTransaction transaction : profileData.getTransactionsList()) { + if (!transaction.isAfterAssets()) { + continue; //Only include transaction made after the last asset update + } Integer typeID = transaction.getTypeID(); //Ignore null and wrong typeID if (typeID == null || !typeIDs.contains(typeID)) { From 2812ab04e985666203f36cc413496bdefa1706c1 Mon Sep 17 00:00:00 2001 From: GoldenGnu Date: Sat, 26 Oct 2024 19:37:57 +0200 Subject: [PATCH 2/5] Bug Fix: Added contract locations to my stockpile locations --- .../gui/tabs/stockpile/StockpileDialog.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/main/java/net/nikr/eve/jeveasset/gui/tabs/stockpile/StockpileDialog.java b/src/main/java/net/nikr/eve/jeveasset/gui/tabs/stockpile/StockpileDialog.java index 3ff11118e..3f610de50 100644 --- a/src/main/java/net/nikr/eve/jeveasset/gui/tabs/stockpile/StockpileDialog.java +++ b/src/main/java/net/nikr/eve/jeveasset/gui/tabs/stockpile/StockpileDialog.java @@ -66,6 +66,7 @@ import net.nikr.eve.jeveasset.Program; import net.nikr.eve.jeveasset.data.api.accounts.OwnerType; import net.nikr.eve.jeveasset.data.api.my.MyAsset; +import net.nikr.eve.jeveasset.data.api.my.MyContract; import net.nikr.eve.jeveasset.data.api.my.MyIndustryJob; import net.nikr.eve.jeveasset.data.api.my.MyMarketOrder; import net.nikr.eve.jeveasset.data.sde.ItemFlag; @@ -571,6 +572,19 @@ void updateData() { myLocations.add(marketOrder.getLocation().getConstellation()); myLocations.add(marketOrder.getLocation().getRegion()); } + for (MyContract contract : program.getContractList()) { + if (!contract.isOpen()) { + continue; //Only include open contracts + } + myLocations.add(contract.getStartLocation().getLocation()); + myLocations.add(contract.getStartLocation().getSystem()); + myLocations.add(contract.getStartLocation().getConstellation()); + myLocations.add(contract.getStartLocation().getRegion()); + myLocations.add(contract.getEndLocation().getLocation()); + myLocations.add(contract.getEndLocation().getSystem()); + myLocations.add(contract.getEndLocation().getConstellation()); + myLocations.add(contract.getEndLocation().getRegion()); + } //Containers containers.clear(); containers.addAll(containerSet); From 5fa1ed4e00ffc7bd2c8c3899dccb9c600ec35bf9 Mon Sep 17 00:00:00 2001 From: GoldenGnu Date: Sat, 26 Oct 2024 19:39:46 +0200 Subject: [PATCH 3/5] Code: Reduced throughput for public market orders to 100 --- .../io/esi/EsiPublicMarketOrdersGetter.java | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/src/main/java/net/nikr/eve/jeveasset/io/esi/EsiPublicMarketOrdersGetter.java b/src/main/java/net/nikr/eve/jeveasset/io/esi/EsiPublicMarketOrdersGetter.java index 6b48d2898..59f4e469f 100644 --- a/src/main/java/net/nikr/eve/jeveasset/io/esi/EsiPublicMarketOrdersGetter.java +++ b/src/main/java/net/nikr/eve/jeveasset/io/esi/EsiPublicMarketOrdersGetter.java @@ -20,6 +20,7 @@ */ package net.nikr.eve.jeveasset.io.esi; +import java.util.ArrayList; import java.util.Date; import java.util.HashSet; import java.util.List; @@ -77,31 +78,30 @@ protected void update() throws ApiException { AtomicInteger count = new AtomicInteger(0); //Update public market orders publicMarketOrders = true; - List responses = updatePagedList(input.getRegionIDs(), new PagedListHandler() { - @Override - protected List get(Integer k) throws ApiException { - try { - return updatePages(DEFAULT_RETRIES, new EsiPagesHandler() { - @Override - public ApiResponse> get(Integer page) throws ApiException { - ApiResponse> response = getMarketApiOpen().getMarketsRegionIdOrdersWithHttpInfo("all", k, DATASOURCE, null, page, null); - String header = getHeader(response.getHeaders(), "last-modified"); - if (header != null) { - Date date = Formatter.parseExpireDate(header); - if (lastUpdate == null) { - lastUpdate = date; - } else if (!modified && !lastUpdate.equals(date)){ - modified = true; - } + List responses = new ArrayList<>(); + for (Integer k : input.getRegionIDs()) { + try { + List response = updatePages(DEFAULT_RETRIES, new EsiPagesHandler() { + @Override + public ApiResponse> get(Integer page) throws ApiException { + ApiResponse> response = getMarketApiOpen().getMarketsRegionIdOrdersWithHttpInfo("all", k, DATASOURCE, null, page, null); + String header = getHeader(response.getHeaders(), "last-modified"); + if (header != null) { + Date date = Formatter.parseExpireDate(header); + if (lastUpdate == null) { + lastUpdate = date; + } else if (!modified && !lastUpdate.equals(date)){ + modified = true; } - return response; } - }); - } finally { - setProgressAll(input.getRegionIDs().size(), count.incrementAndGet(), 0, 40); - } + return response; + } + }); + responses.addAll(response); + } finally { + setProgressAll(input.getRegionIDs().size(), count.incrementAndGet(), 0, 40); } - }); + } if (modified) { addWarning("last-modified changed while updating", "Cache expired while updating"); } From 89efbf07adbcc5352f75b6208943f2a7fd88c3d0 Mon Sep 17 00:00:00 2001 From: GoldenGnu Date: Sat, 26 Oct 2024 19:40:23 +0200 Subject: [PATCH 4/5] Code: Update logback to 1.2.13 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 21520cc97..6ec2acc1d 100644 --- a/pom.xml +++ b/pom.xml @@ -822,13 +822,13 @@ ch.qos.logback logback-classic - 1.2.11 + 1.2.13 ch.qos.logback logback-core - 1.2.11 + 1.2.13 From 935c2ce7c8066c86df00dfc5c0a275d39eb82a9c Mon Sep 17 00:00:00 2001 From: GoldenGnu Date: Sat, 26 Oct 2024 19:40:51 +0200 Subject: [PATCH 5/5] Code: Updated sqlite to 3.41.2.2 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6ec2acc1d..eb3d66600 100644 --- a/pom.xml +++ b/pom.xml @@ -846,7 +846,7 @@ org.xerial sqlite-jdbc - 3.36.0.3 + 3.41.2.2