This commit is contained in:
Anuken
2019-10-24 18:52:42 -04:00
parent 5d7f14c21f
commit f971061ef4
3 changed files with 17 additions and 11 deletions

View File

@@ -142,7 +142,7 @@ public class DesktopLauncher extends ClientLauncher{
try{
SteamAPI.loadLibraries();
}catch(Throwable t){
Log.err(t);
logSteamError(t);
fallbackSteam();
}
@@ -155,11 +155,21 @@ public class DesktopLauncher extends ClientLauncher{
}catch(Throwable e){
steam = false;
Log.err("Failed to load Steam native libraries.");
Log.err(e);
logSteamError(e);
}
}
}
void logSteamError(Throwable e){
Log.err(e);
try(OutputStream s = new FileOutputStream(new File("steam-error-log-" + System.nanoTime() + ".txt"))){
String log = Strings.parseException(e, true);
s.write(log.getBytes());
}catch(Exception e2){
Log.err(e2);
}
}
void fallbackSteam(){
try{
String name = "steam_api";
@@ -169,7 +179,7 @@ public class DesktopLauncher extends ClientLauncher{
Streams.copyStream(getClass().getResourceAsStream(name), new FileOutputStream(name));
System.loadLibrary(new File(name).getAbsolutePath());
}catch(Throwable e){
Log.err(e);
logSteamError(e);
}
}