add debug information.

This commit is contained in:
huanghongxun
2015-11-22 17:50:00 +08:00
parent 2dede7dea1
commit c76b0e0ffb
9 changed files with 36 additions and 12 deletions

View File

@@ -124,16 +124,16 @@ public final class Launcher {
final String advice = MinecraftCrashAdvicer.getAdvice(trace);
MessageBox.Show(C.i18n("crash.minecraft") + ": " + advice);
LogWindow.instance.setExit(TrueFunction.instance);
System.err.println(C.i18n("crash.minecraft"));
System.err.println(advice);
System.err.println(trace);
LogWindow.instance.setExit(TrueFunction.instance);
LogWindow.instance.setVisible(true);
flag = 1;
}
println("*** Game Exited ***");
System.exit(flag);
Utils.shutdownForcely(1);
}
static Object getShutdownHaltLock() {

View File

@@ -72,6 +72,7 @@ public class GameLauncher {
}
public IMinecraftLoader makeLaunchCommand() {
HMCLog.log("Logging in...");
IMinecraftLoader loader;
try {
if (info != null)
@@ -98,10 +99,13 @@ public class GameLauncher {
if (file != null)
FileUtils.cleanDirectoryQuietly(file);
HMCLog.log("Detecting libraries...");
if (!downloadLibrariesEvent.execute(provider.getDownloadLibraries(downloadType))) {
failEvent.execute(C.i18n("launch.failed"));
return null;
}
HMCLog.log("Unpacking natives...");
if (!decompressNativesEvent.execute(provider.getDecompressLibraries())) {
failEvent.execute(C.i18n("launch.failed"));
return null;
@@ -152,6 +156,7 @@ public class GameLauncher {
* @throws java.io.IOException write contents failed.
*/
public File makeLauncher(String launcherName, List str) throws IOException {
HMCLog.log("Making shell launcher...");
provider.onLaunch();
boolean isWin = OS.os() == OS.WINDOWS;
File f = new File(launcherName + (isWin ? ".bat" : ".sh"));

View File

@@ -12,6 +12,7 @@ import java.util.List;
import java.util.Map;
import java.util.UUID;
import org.jackhuang.hellominecraft.C;
import org.jackhuang.hellominecraft.HMCLog;
import org.jackhuang.hellominecraft.utils.NetUtils;
import org.jackhuang.hellominecraft.utils.StrUtils;
@@ -122,8 +123,13 @@ public class YggdrasilAuthentication {
String jsonResult = input == null ? NetUtils.get(url) : NetUtils.post(url, GSON.toJson(input), "application/json", proxy);
Response response = (Response) GSON.fromJson(jsonResult, Response.class);
if (StrUtils.isNotBlank(response.error))
if (StrUtils.isNotBlank(response.error)) {
HMCLog.err("Failed to log in, the auth server returned an error: " + response.error + ", message: " + response.errorMessage + ", cause: " + response.cause);
if (response.errorMessage.contains("Invalid token")) {
response.errorMessage = C.i18n("login.invalid_token");
}
throw new AuthenticationException("Request error: " + response.errorMessage);
}
if (!clientToken.equals(response.clientToken))
throw new AuthenticationException(C.i18n("login.changed_client_token"));