Skip to content

Commit

Permalink
fix version parsing for 1.30 and logging in W3Utils
Browse files Browse the repository at this point in the history
  • Loading branch information
Frotty committed Aug 8, 2018
1 parent 49244c3 commit 84299bf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion de.peeeq.wurstscript/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ dependencies {
compile group: 'net.sourceforge.jchardet', name: 'jchardet', version: '1.0'

// Water's wc3 libs including Crigges' jmpq
compile 'com.github.inwc3:wc3libs:981af726bf'
compile 'com.github.inwc3:wc3libs:b0db329598'

// The setup tool for wurst.build handling
compile 'com.github.wurstscript:wurstsetup:cc208dcc86'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
package de.peeeq.wurstio.utils;

import de.peeeq.wurstscript.WLogger;
import net.moonlightflower.wc3libs.bin.GameExe;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.File;
import java.io.IOException;
import java.util.Objects;

public class W3Utils {
private static final Logger log = LoggerFactory.getLogger(W3Utils.class.getName());
private static GameExe gameExe;
private static GameExe.Version version = null;

Expand All @@ -26,7 +24,7 @@ public static GameExe.Version getWc3PatchVersion() {
}
if (version == null && gameExe != null) {
try {
log.info("Parsed game version: " + gameExe.getVersion());
WLogger.info("Parsed game version: " + gameExe.getVersion());
version = gameExe.getVersion();
} catch (IOException e) {
e.printStackTrace();
Expand All @@ -43,12 +41,13 @@ public static GameExe.Version getWc3PatchVersion() {
public static GameExe.Version parsePatchVersion(File wc3Path) {
try {
gameExe = GameExe.fromDir(wc3Path);
WLogger.info("Game Executable: " + gameExe);
if (gameExe != null) {
W3Utils.version = gameExe.getVersion();
log.info("Parsed game version: " + version);
WLogger.info("Parsed game version: " + version);
}
} catch (IOException e) {
e.printStackTrace();
WLogger.severe(e);
}
return version;
}
Expand Down

0 comments on commit 84299bf

Please sign in to comment.