This commit is contained in:
Anuken
2019-09-07 16:03:20 -04:00
parent 4fb7430fb7
commit 8653e7bbb1
3 changed files with 14 additions and 14 deletions

View File

@@ -21,7 +21,7 @@ allprojects{
ext{ ext{
versionNumber = '4' versionNumber = '4'
versionModifier = 'release' if(!project.hasProperty("versionModifier")) versionModifier = 'release'
if(!project.hasProperty("versionType")) versionType = 'official' if(!project.hasProperty("versionType")) versionType = 'official'
appName = 'Mindustry' appName = 'Mindustry'
gdxVersion = '1.9.10' gdxVersion = '1.9.10'

View File

@@ -1,12 +1,12 @@
package io.anuke.mindustry.game; package io.anuke.mindustry.game;
import io.anuke.arc.Core; import io.anuke.arc.Files.*;
import io.anuke.arc.collection.ObjectMap; import io.anuke.arc.collection.*;
import io.anuke.arc.files.FileHandle; import io.anuke.arc.files.*;
import io.anuke.arc.util.Strings; import io.anuke.arc.util.*;
import io.anuke.arc.util.io.PropertiesUtils; import io.anuke.arc.util.io.*;
import java.io.IOException; import java.io.*;
public class Version{ public class Version{
/** Build type. 'official' for official releases; 'custom' or 'bleeding edge' are also used. */ /** Build type. 'official' for official releases; 'custom' or 'bleeding edge' are also used. */
@@ -26,7 +26,7 @@ public class Version{
if(!enabled) return; if(!enabled) return;
try{ try{
FileHandle file = Core.files.internal("version.properties"); FileHandle file = new FileHandle("version.properties", FileType.Internal);
ObjectMap<String, String> map = new ObjectMap<>(); ObjectMap<String, String> map = new ObjectMap<>();
PropertiesUtils.load(map, file.reader()); PropertiesUtils.load(map, file.reader());

View File

@@ -18,6 +18,7 @@ import io.anuke.mindustry.*;
import io.anuke.mindustry.core.GameState.*; import io.anuke.mindustry.core.GameState.*;
import io.anuke.mindustry.desktop.steam.*; import io.anuke.mindustry.desktop.steam.*;
import io.anuke.mindustry.game.EventType.*; import io.anuke.mindustry.game.EventType.*;
import io.anuke.mindustry.game.Version;
import io.anuke.mindustry.net.*; import io.anuke.mindustry.net.*;
import io.anuke.mindustry.net.Net.*; import io.anuke.mindustry.net.Net.*;
@@ -30,7 +31,7 @@ import static io.anuke.mindustry.Vars.*;
public class DesktopLauncher extends ClientLauncher{ public class DesktopLauncher extends ClientLauncher{
private final static String applicationId = "610508934456934412"; private final static String applicationId = "610508934456934412";
boolean useDiscord = OS.is64Bit, useSteam = true, showConsole = true; boolean useDiscord = OS.is64Bit, showConsole = true;
SteamCoreNetImpl steamCore; SteamCoreNetImpl steamCore;
public static void main(String[] arg){ public static void main(String[] arg){
@@ -50,6 +51,8 @@ public class DesktopLauncher extends ClientLauncher{
} }
public DesktopLauncher(String[] args){ public DesktopLauncher(String[] args){
Version.init();
boolean useSteam = Version.modifier.equals("steam");
testMobile = Array.with(args).contains("-testMobile"); testMobile = Array.with(args).contains("-testMobile");
if(useDiscord){ if(useDiscord){
@@ -105,9 +108,10 @@ public class DesktopLauncher extends ClientLauncher{
try{ try{
SteamAPI.loadLibraries(); SteamAPI.loadLibraries();
if(!SteamAPI.init()){ if(!SteamAPI.init()){
Log.info("Steam client not running. Make sure Steam is running!"); Log.err("Steam client not running.");
}else{ }else{
Vars.steam = true; Vars.steam = true;
steamCore = new SteamCoreNetImpl(new ArcNetImpl());
Events.on(ClientLoadEvent.class, event -> { Events.on(ClientLoadEvent.class, event -> {
Core.settings.defaults("name", steamCore.friends.getPersonaName()); Core.settings.defaults("name", steamCore.friends.getPersonaName());
//update callbacks //update callbacks
@@ -128,10 +132,6 @@ public class DesktopLauncher extends ClientLauncher{
e.printStackTrace(); e.printStackTrace();
} }
} }
if(steam){
SteamCoreNetImpl net = steamCore = new SteamCoreNetImpl(new ArcNetImpl());
}
} }
static void handleCrash(Throwable e){ static void handleCrash(Throwable e){