Commit 47d63a12e1d9c884a5b61238277735fd76e2911a

Authored by Mumfrey
1 parent 7f3ee908

Add copyright to debug srcs, fix changes which were accidentally removed

src/debug/java/com/mumfrey/liteloader/debug/LoginManager.java
  1 +/*
  2 + * This file is part of LiteLoader.
  3 + * Copyright (C) 2012-16 Adam Mummery-Smith
  4 + * All Rights Reserved.
  5 + */
1 package com.mumfrey.liteloader.debug; 6 package com.mumfrey.liteloader.debug;
2 7
3 import java.io.File; 8 import java.io.File;
src/debug/java/com/mumfrey/liteloader/debug/LoginPanel.java
  1 +/*
  2 + * This file is part of LiteLoader.
  3 + * Copyright (C) 2012-16 Adam Mummery-Smith
  4 + * All Rights Reserved.
  5 + */
1 package com.mumfrey.liteloader.debug; 6 package com.mumfrey.liteloader.debug;
2 7
3 import static javax.swing.WindowConstants.*; 8 import static javax.swing.WindowConstants.*;
src/debug/java/com/mumfrey/liteloader/debug/Start.java
  1 +/*
  2 + * This file is part of LiteLoader.
  3 + * Copyright (C) 2012-16 Adam Mummery-Smith
  4 + * All Rights Reserved.
  5 + */
1 package com.mumfrey.liteloader.debug; 6 package com.mumfrey.liteloader.debug;
2 7
3 import java.io.File; 8 import java.io.File;
@@ -123,6 +128,7 @@ public abstract class Start @@ -123,6 +128,7 @@ public abstract class Start
123 128
124 File gameDir = new File(System.getProperty("user.dir")); 129 File gameDir = new File(System.getProperty("user.dir"));
125 File assetsDir = new File(gameDir, "assets"); 130 File assetsDir = new File(gameDir, "assets");
  131 + File assetIndexDir = new File(assetsDir, "indexes");
126 132
127 Start.addArg(qualifiedArgs, "--tweakClass", LiteLoaderTweaker.class.getName()); 133 Start.addArg(qualifiedArgs, "--tweakClass", LiteLoaderTweaker.class.getName());
128 Start.addArg(qualifiedArgs, "--username", loginManager.getProfileName()); 134 Start.addArg(qualifiedArgs, "--username", loginManager.getProfileName());
@@ -130,10 +136,10 @@ public abstract class Start @@ -130,10 +136,10 @@ public abstract class Start
130 Start.addArg(qualifiedArgs, "--accessToken", loginManager.getAuthenticatedToken()); 136 Start.addArg(qualifiedArgs, "--accessToken", loginManager.getAuthenticatedToken());
131 Start.addArg(qualifiedArgs, "--userType", loginManager.getUserType()); 137 Start.addArg(qualifiedArgs, "--userType", loginManager.getUserType());
132 Start.addArg(qualifiedArgs, "--userProperties", loginManager.getUserProperties()); 138 Start.addArg(qualifiedArgs, "--userProperties", loginManager.getUserProperties());
133 - Start.addArg(qualifiedArgs, "--version", "mcp");  
134 - Start.addArg(qualifiedArgs, "--gameDir", gameDir.getAbsolutePath());  
135 - Start.addArg(qualifiedArgs, "--assetIndex", LiteLoaderTweaker.VERSION);  
136 - Start.addArg(qualifiedArgs, "--assetsDir", assetsDir.getAbsolutePath()); 139 + Start.addArg(qualifiedArgs, "--version", "mcp", true);
  140 + Start.addArg(qualifiedArgs, "--gameDir", gameDir.getAbsolutePath(), true);
  141 + Start.addArg(qualifiedArgs, "--assetIndex", LiteLoaderTweaker.VERSION, true);
  142 + Start.addArg(qualifiedArgs, "--assetsDir", assetsDir.getAbsolutePath(), !assetIndexDir.exists());
137 } 143 }
138 144
139 private static void addRequiredArgsServer(String[] args, List<String> unqualifiedArgs, Map<String, Set<String>> qualifiedArgs) 145 private static void addRequiredArgsServer(String[] args, List<String> unqualifiedArgs, Map<String, Set<String>> qualifiedArgs)
@@ -162,13 +168,22 @@ public abstract class Start @@ -162,13 +168,22 @@ public abstract class Start
162 168
163 private static void addArg(Map<String, Set<String>> qualifiedArgs, String qualifier, String arg) 169 private static void addArg(Map<String, Set<String>> qualifiedArgs, String qualifier, String arg)
164 { 170 {
  171 + Start.addArg(qualifiedArgs, qualifier, arg, false);
  172 + }
  173 +
  174 + private static void addArg(Map<String, Set<String>> qualifiedArgs, String qualifier, String arg, boolean skipExisting)
  175 + {
165 Set<String> args = qualifiedArgs.get(qualifier); 176 Set<String> args = qualifiedArgs.get(qualifier);
166 - 177 +
167 if (args == null) 178 if (args == null)
168 { 179 {
169 args = new HashSet<String>(); 180 args = new HashSet<String>();
170 qualifiedArgs.put(qualifier, args); 181 qualifiedArgs.put(qualifier, args);
171 } 182 }
  183 + else if (skipExisting)
  184 + {
  185 + return;
  186 + }
172 187
173 if (!Start.MULTI_VALUE_ARGS.contains(qualifier)) 188 if (!Start.MULTI_VALUE_ARGS.contains(qualifier))
174 { 189 {