diff --git a/src/main/java/net/silentclient/client/Client.java b/src/main/java/net/silentclient/client/Client.java index 717e3b9..33a7982 100644 --- a/src/main/java/net/silentclient/client/Client.java +++ b/src/main/java/net/silentclient/client/Client.java @@ -56,7 +56,7 @@ public class Client { } private BuildData buildData = new BuildData(); - private UserData userData = new UserData(SilentClientTweaker.TOKEN); + private UserData userData = new UserData(); public File dir; private SettingsManager settingsManager; public ConfigManager configManager; @@ -111,6 +111,29 @@ public class Client { in.close(); } catch (Exception e1) { Client.logger.catching(e1); + } + try { + InputStream in = new FileInputStream(new File(Minecraft.getMinecraft().mcDataDir, "silent_account.json")); + BufferedReader reader = new BufferedReader(new InputStreamReader(in)); + StringBuffer content = new StringBuffer(); + String inputLine; + while ((inputLine = reader.readLine()) != null) { + content.append(inputLine); + } + GsonBuilder builder = new GsonBuilder(); + Gson gson = builder.create(); + + userData = gson.fromJson(content.toString(), UserData.class); + in.close(); + if(!ClientUtils.isDevelopment()) { + try { + new File(Minecraft.getMinecraft().mcDataDir, "silent_account.json").delete(); + } catch (Exception err) { + + } + } + } catch (Exception err) { + } logger.info("---------[ Silent Client Initialising ]---------"); logger.info("MC Version: 1.8.9"); diff --git a/src/main/java/net/silentclient/client/mixin/SilentClientTweaker.java b/src/main/java/net/silentclient/client/mixin/SilentClientTweaker.java index aafaf0d..2894b8e 100644 --- a/src/main/java/net/silentclient/client/mixin/SilentClientTweaker.java +++ b/src/main/java/net/silentclient/client/mixin/SilentClientTweaker.java @@ -13,19 +13,11 @@ import java.util.List; public class SilentClientTweaker implements ITweaker { private List launchArgs = new ArrayList<>(); public static boolean hasOptifine = false; - public static String TOKEN = ""; @Override public final void acceptOptions(List args, File gameDir, File assetsDir, String profile) { Client.logger.info("Silent Client Tweak Loader: Options"); - if (args.contains("--sctoken")) { - final int index = args.indexOf("--sctoken"); - try { - SilentClientTweaker.TOKEN = (String)args.get(index + 1); - } - catch (final Exception ex) {} - } try { Class.forName("optifine.OptiFineTweaker"); hasOptifine = true;