From d70ed9360fbf45b646873e85bb84d598faa3d923 Mon Sep 17 00:00:00 2001 From: coanghel Date: Mon, 18 Nov 2024 10:31:08 -0500 Subject: [PATCH 1/3] fix: account for multiple accounts with same implants in same location --- .../net/nikr/eve/jeveasset/data/api/raw/RawAsset.java | 9 +++++++-- .../java/net/nikr/eve/jeveasset/io/esi/EsiConverter.java | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/main/java/net/nikr/eve/jeveasset/data/api/raw/RawAsset.java b/src/main/java/net/nikr/eve/jeveasset/data/api/raw/RawAsset.java index 66f8d71fe..29a77062b 100644 --- a/src/main/java/net/nikr/eve/jeveasset/data/api/raw/RawAsset.java +++ b/src/main/java/net/nikr/eve/jeveasset/data/api/raw/RawAsset.java @@ -21,6 +21,7 @@ package net.nikr.eve.jeveasset.data.api.raw; import java.util.Objects; +import net.nikr.eve.jeveasset.data.api.accounts.OwnerType; import net.nikr.eve.jeveasset.data.api.my.MyContractItem; import net.nikr.eve.jeveasset.data.api.my.MyIndustryJob; import net.nikr.eve.jeveasset.data.api.my.MyIndustryJob.IndustryActivity; @@ -229,10 +230,14 @@ public RawAsset(CorporationAssetsResponse asset) { * * @param implantType * @param implantLocation + * @param implantOwner */ - public RawAsset(Integer implantType, Long implantLocation) { + public RawAsset(Integer implantType, Long implantLocation, OwnerType implantOwner) { isSingleton = true; //Unpacked - itemId = Long.valueOf(implantType + "" + implantLocation); + long ownerId = implantOwner.getOwnerID(); + String combinedId = implantType + "" + implantLocation + "" + ownerId; + long hashedId = (long) combinedId.hashCode(); + itemId = hashedId; itemFlag = PLUGGED_IMPLANT_FLAG; locationId = implantLocation; quantity = 1; //Plugged in AKA always 1 diff --git a/src/main/java/net/nikr/eve/jeveasset/io/esi/EsiConverter.java b/src/main/java/net/nikr/eve/jeveasset/io/esi/EsiConverter.java index 2dd894740..1ce5c7b9a 100644 --- a/src/main/java/net/nikr/eve/jeveasset/io/esi/EsiConverter.java +++ b/src/main/java/net/nikr/eve/jeveasset/io/esi/EsiConverter.java @@ -134,7 +134,7 @@ public static MyAsset toAssetsShip(CharacterShipResponse shipType, CharacterLoca } public static MyAsset toAssetsImplant(Integer implantType, Long implantLocation, OwnerType owner) { - return toMyAsset(new RawAsset(implantType, implantLocation), owner, new ArrayList<>()); + return toMyAsset(new RawAsset(implantType, implantLocation, owner), owner, new ArrayList<>()); } public static MyAsset toAssetsPlanetaryInteraction(CharacterPlanetsResponse planet, PlanetPin pin, OwnerType owner) { From 42b88d00921182203e76b4f3195c2a0bfa920635 Mon Sep 17 00:00:00 2001 From: coanghel Date: Tue, 26 Nov 2024 09:40:23 -0500 Subject: [PATCH 2/3] feat: allow for setting ESI client ID through Maven properties --- pom.xml | 63 ++++++++++++++ ...kURL.java => EsiCallbackURL.java.template} | 86 +++++++++---------- 2 files changed, 106 insertions(+), 43 deletions(-) rename src/main/java/net/nikr/eve/jeveasset/io/esi/{EsiCallbackURL.java => EsiCallbackURL.java.template} (93%) diff --git a/pom.xml b/pom.xml index 162818f2d..127eb46d8 100644 --- a/pom.xml +++ b/pom.xml @@ -87,6 +87,9 @@ ${project.build.sourceVersion} ${project.build.sourceVersion} ${project.build.sourceEncoding} + + net/nikr/eve/jeveasset/io/esi/EsiCallbackURL.java + @@ -96,6 +99,34 @@ ${project.build.sourceEncoding} + + + + copy-and-filter-template + generate-sources + + copy-resources + + + ${project.build.directory}/generated-sources/java + + + src/main/java + + **/EsiCallbackURL.java.template + + true + + + + java + + + ${*} + + + + maven-antrun-plugin @@ -180,6 +211,19 @@ run + + + rename-template + generate-sources + + + + + + + run + + @@ -199,6 +243,25 @@ + + org.codehaus.mojo + build-helper-maven-plugin + 1.9.1 + + + add-source + generate-sources + + add-source + + + + ${project.build.directory}/generated-sources/java/ + + + + + org.apache.maven.plugins maven-dependency-plugin diff --git a/src/main/java/net/nikr/eve/jeveasset/io/esi/EsiCallbackURL.java b/src/main/java/net/nikr/eve/jeveasset/io/esi/EsiCallbackURL.java.template similarity index 93% rename from src/main/java/net/nikr/eve/jeveasset/io/esi/EsiCallbackURL.java rename to src/main/java/net/nikr/eve/jeveasset/io/esi/EsiCallbackURL.java.template index 749e24149..0ff425ca1 100644 --- a/src/main/java/net/nikr/eve/jeveasset/io/esi/EsiCallbackURL.java +++ b/src/main/java/net/nikr/eve/jeveasset/io/esi/EsiCallbackURL.java.template @@ -1,43 +1,43 @@ -/* - * Copyright 2009-2024 Contributors (see credits.txt) - * - * This file is part of jEveAssets. - * - * jEveAssets is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * jEveAssets is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jEveAssets; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ -package net.nikr.eve.jeveasset.io.esi; - - -public enum EsiCallbackURL { - LOCALHOST("http://localhost:2221", ""), - EVE_NIKR_NET("https://eve.nikr.net/jeveasset/auth", ""), - ; - private final String url; - private final String a; - - private EsiCallbackURL(String url, String a) { - this.url = url; - this.a = a; - } - - public String getUrl() { - return url; - } - - public String getA() { - return a; - } -} +/* + * Copyright 2009-2024 Contributors (see credits.txt) + * + * This file is part of jEveAssets. + * + * jEveAssets is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * jEveAssets is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jEveAssets; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ +package net.nikr.eve.jeveasset.io.esi; + + +public enum EsiCallbackURL { + LOCALHOST("http://localhost:2221", "${env.ESICLIENTID}"), + EVE_NIKR_NET("https://eve.nikr.net/jeveasset/auth", ""), + ; + private final String url; + private final String a; + + private EsiCallbackURL(String url, String a) { + this.url = url; + this.a = a; + } + + public String getUrl() { + return url; + } + + public String getA() { + return a; + } +} From 104ba545dbfa4f25ecdb2dd07787cfcce2ec8a02 Mon Sep 17 00:00:00 2001 From: GoldenGnu Date: Fri, 20 Dec 2024 15:26:26 +0100 Subject: [PATCH 3/3] Reverted EsiCallbackURL changes --- pom.xml | 63 -------------- ...kURL.java.template => EsiCallbackURL.java} | 86 +++++++++---------- 2 files changed, 43 insertions(+), 106 deletions(-) rename src/main/java/net/nikr/eve/jeveasset/io/esi/{EsiCallbackURL.java.template => EsiCallbackURL.java} (93%) diff --git a/pom.xml b/pom.xml index 127eb46d8..162818f2d 100644 --- a/pom.xml +++ b/pom.xml @@ -87,9 +87,6 @@ ${project.build.sourceVersion} ${project.build.sourceVersion} ${project.build.sourceEncoding} - - net/nikr/eve/jeveasset/io/esi/EsiCallbackURL.java - @@ -99,34 +96,6 @@ ${project.build.sourceEncoding} - - - - copy-and-filter-template - generate-sources - - copy-resources - - - ${project.build.directory}/generated-sources/java - - - src/main/java - - **/EsiCallbackURL.java.template - - true - - - - java - - - ${*} - - - - maven-antrun-plugin @@ -211,19 +180,6 @@ run - - - rename-template - generate-sources - - - - - - - run - - @@ -243,25 +199,6 @@ - - org.codehaus.mojo - build-helper-maven-plugin - 1.9.1 - - - add-source - generate-sources - - add-source - - - - ${project.build.directory}/generated-sources/java/ - - - - - org.apache.maven.plugins maven-dependency-plugin diff --git a/src/main/java/net/nikr/eve/jeveasset/io/esi/EsiCallbackURL.java.template b/src/main/java/net/nikr/eve/jeveasset/io/esi/EsiCallbackURL.java similarity index 93% rename from src/main/java/net/nikr/eve/jeveasset/io/esi/EsiCallbackURL.java.template rename to src/main/java/net/nikr/eve/jeveasset/io/esi/EsiCallbackURL.java index 0ff425ca1..749e24149 100644 --- a/src/main/java/net/nikr/eve/jeveasset/io/esi/EsiCallbackURL.java.template +++ b/src/main/java/net/nikr/eve/jeveasset/io/esi/EsiCallbackURL.java @@ -1,43 +1,43 @@ -/* - * Copyright 2009-2024 Contributors (see credits.txt) - * - * This file is part of jEveAssets. - * - * jEveAssets is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * jEveAssets is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jEveAssets; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ -package net.nikr.eve.jeveasset.io.esi; - - -public enum EsiCallbackURL { - LOCALHOST("http://localhost:2221", "${env.ESICLIENTID}"), - EVE_NIKR_NET("https://eve.nikr.net/jeveasset/auth", ""), - ; - private final String url; - private final String a; - - private EsiCallbackURL(String url, String a) { - this.url = url; - this.a = a; - } - - public String getUrl() { - return url; - } - - public String getA() { - return a; - } -} +/* + * Copyright 2009-2024 Contributors (see credits.txt) + * + * This file is part of jEveAssets. + * + * jEveAssets is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * jEveAssets is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jEveAssets; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ +package net.nikr.eve.jeveasset.io.esi; + + +public enum EsiCallbackURL { + LOCALHOST("http://localhost:2221", ""), + EVE_NIKR_NET("https://eve.nikr.net/jeveasset/auth", ""), + ; + private final String url; + private final String a; + + private EsiCallbackURL(String url, String a) { + this.url = url; + this.a = a; + } + + public String getUrl() { + return url; + } + + public String getA() { + return a; + } +}