Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

Commit

Permalink
94 stays forever in updating updated updating (#138)
Browse files Browse the repository at this point in the history
* Added header for user-agent to get inara responses and increased minimum inara delay

Updated dependencies
Logs will generate again
Fixed 429 error label

* Updated version info
  • Loading branch information
Fi0x committed Jan 26, 2023
1 parent c12783e commit ecb80eb
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 12 deletions.
10 changes: 5 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<groupId>com.fi0x.edct</groupId>
<artifactId>EliteDangerousCarrierTrader</artifactId>
<!-- //TODO: update version -->
<version>2.2.0.0</version>
<version>2.2.0.1</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
Expand Down Expand Up @@ -139,17 +139,17 @@
<dependency>
<groupId>io.github.Fi0x</groupId>
<artifactId>JavaLogger</artifactId>
<version>1.1.10</version>
<version>1.1.11</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>19</version>
<version>19.0.2.1</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>19</version>
<version>19.0.2.1</version>
</dependency>
<dependency>
<groupId>org.jsoup</groupId>
Expand All @@ -164,7 +164,7 @@
<dependency>
<groupId>com.akathist.maven.plugins.launch4j</groupId>
<artifactId>launch4j-maven-plugin</artifactId>
<version>2.2.0</version>
<version>2.3.1</version>
</dependency>
<dependency>
<groupId>org.xerial</groupId>
Expand Down
2 changes: 1 addition & 1 deletion setup.iss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

; TODO: Update Version info
#define MyAppName "Elite Dangerous Carrier Trader"
#define MyAppVersion "2.2.0.0"
#define MyAppVersion "2.2.0.1"
#define MyAppPublisher "Fi0x"
#define MyAppURL "https://github.com/Fi0x/EDCT"
#define MyAppExeName "EDCT.exe"
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/fi0x/edct/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class Main
public static File reddit;
public static File discord;
//TODO: Update version information
public static final String version = "2.2.0.0";//All.GUI.Logic.Hotfix
public static final String version = "2.2.0.1";//All.GUI.Logic.Hotfix
public static final VersionType versionType = VersionType.INSTALLER;

public static void main(String[] args)
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/fi0x/edct/gui/controller/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ public static void loadSettings()
lowProfitBorder = Math.max(lowProfitBorder, 0);
highProfitBorder = Math.max(highProfitBorder, 0);
maxDataAge = Math.max(maxDataAge, 0);
inaraDelay = Math.max(inaraDelay, 5000);
inaraDelay = Math.max(inaraDelay, 15000);
if(shipCargoSpace < 0)
shipCargoSpace = 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,19 @@ public static String sendHTTPRequest(String endpoint, String requestType, Map<St
}
public static String sendHTTPRequest(String endpoint, String requestType, Map<String, String> parameters, boolean ignore429) throws IOException, InterruptedException, HtmlConnectionException
{
if(!canRequest(ignore429)) return null;
if(!canRequest(ignore429))
return null;

endpoint += getParamsString(parameters);
URL url = cleanUpUrl(endpoint);
HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setRequestMethod(requestType);
con.setRequestProperty("user-agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36");

con.setConnectTimeout(5000);
con.setReadTimeout(5000);

int status = 0;
int status;
try
{
status = con.getResponseCode();
Expand Down Expand Up @@ -67,9 +69,9 @@ public static String sendHTTPRequest(String endpoint, String requestType, Map<St
in.close();
}
else if(status == 429)
Logger.log("Received a 429 status code from a website", LogName.getError(492), null, 429);
Logger.log("Received a 429 status code from a website\n\tUrl was: " + url, LogName.getError(429), null, 429);
else if(status != 0)
Logger.log("Received a bad HTTP response: " + status, LogName.WARNING);
Logger.log("Received a bad HTTP response: " + status + "\n\tFor url: " + url, LogName.WARNING);

con.disconnect();

Expand Down

0 comments on commit ecb80eb

Please sign in to comment.