Browse Source

Final preparations for indev keys

master
JellySquid 3 years ago
parent
commit
e8ab3bebc9

+ 6
- 4
launcher-aether/src/main/java/com/gildedgames/launcher/ui/LauncherLayout.java View File

@@ -25,7 +25,13 @@ public class LauncherLayout {
25 25
 	public void back() {
26 26
 		this.stack.pop();
27 27
 
28
+		JComponent panel = this.stack.peek();
29
+
28 30
 		this.setView(this.stack.peek());
31
+
32
+		if (panel instanceof IListeningView) {
33
+			((IListeningView) panel).reload();
34
+		}
29 35
 	}
30 36
 
31 37
 	public JPanel getRoot() {
@@ -37,10 +43,6 @@ public class LauncherLayout {
37 43
 			this.root.removeAll();
38 44
 			this.root.add(view, BorderLayout.CENTER);
39 45
 
40
-			if (view instanceof IListeningView) {
41
-				((IListeningView) view).reload();
42
-			}
43
-			
44 46
 			this.root.revalidate();
45 47
 			this.root.repaint();
46 48
 		});

+ 4
- 3
launcher-aether/src/main/java/com/gildedgames/launcher/ui/views/game/PlayView.java View File

@@ -381,13 +381,17 @@ public class PlayView extends JPanel implements IListeningView {
381 381
 		Futures.addCallback(refreshInstancesFuture, new FutureCallback<InstanceList>() {
382 382
 			@Override
383 383
 			public void onSuccess(@Nullable InstanceList result) {
384
+				PlayView.this.refreshNews(force);
384 385
 
386
+				PlayView.this.bannerPanel.close();
385 387
 			}
386 388
 
387 389
 			@Override
388 390
 			public void onFailure(Throwable t) {
389 391
 				PlayView.this.bannerPanel.update(LauncherIcons.WARN, "There was a problem checking for updates.", BannerPanel.BannerType.ERROR);
390 392
 				PlayView.this.bannerPanel.bindActionHandler(LauncherIcons.REFRESH, "Refresh", () -> PlayView.this.refresh(force));
393
+
394
+				PlayView.this.refreshNews(false);
391 395
 			}
392 396
 		});
393 397
 
@@ -399,8 +403,6 @@ public class PlayView extends JPanel implements IListeningView {
399 403
 			}
400 404
 
401 405
 			this.requestFocus();
402
-
403
-			this.refreshNews(force);
404 406
 		}, SwingExecutor.INSTANCE);
405 407
 	}
406 408
 
@@ -410,7 +412,6 @@ public class PlayView extends JPanel implements IListeningView {
410 412
 		Futures.addCallback(refreshNewsFuture, new FutureCallback<NewsFeedManager.NewsFeed>() {
411 413
 			@Override
412 414
 			public void onSuccess(@Nullable NewsFeedManager.NewsFeed result) {
413
-				PlayView.this.bannerPanel.close();
414 415
 				PlayView.this.layoutNewsTiles(result);
415 416
 			}
416 417
 

+ 1
- 1
launcher-aether/src/main/java/com/gildedgames/launcher/user/GameKeyManager.java View File

@@ -8,7 +8,7 @@ import com.skcraft.launcher.util.HttpRequest;
8 8
 import lombok.Getter;
9 9
 
10 10
 public class GameKeyManager {
11
-	private static final String VERIFY_URL = "http://localhost:8080/keys/verify/%s";
11
+	private static final String VERIFY_URL = "https://files.gildedgames.com/minecraft/launcher/v2/packages/keys/verify/%s";
12 12
 
13 13
 	private final Launcher launcher;
14 14
 

+ 4
- 2
launcher/src/main/java/com/skcraft/launcher/InstanceList.java View File

@@ -133,6 +133,8 @@ public class InstanceList {
133 133
             try {
134 134
                 URL packagesURL = launcher.getPackagesURL();
135 135
 
136
+                URL packagesRoot = launcher.getPackageRoot();
137
+
136 138
                 PackageList packages = HttpRequest
137 139
                         .get(packagesURL)
138 140
                         .execute()
@@ -153,7 +155,7 @@ public class InstanceList {
153 155
 
154 156
                             instance.setTitle(manifest.getTitle());
155 157
                             instance.setPriority(manifest.getPriority());
156
-                            URL url = concat(packagesURL, manifest.getLocation());
158
+                            URL url = concat(packagesRoot, manifest.getLocation());
157 159
                             instance.setManifestURL(url);
158 160
 
159 161
                             log.info("(" + instance.getName() + ").setManifestURL(" + url + ")");
@@ -178,7 +180,7 @@ public class InstanceList {
178 180
                         instance.setVersion(manifest.getVersion());
179 181
                         instance.setPriority(manifest.getPriority());
180 182
                         instance.setSelected(false);
181
-                        instance.setManifestURL(concat(packagesURL, manifest.getLocation()));
183
+                        instance.setManifestURL(concat(packagesRoot, manifest.getLocation()));
182 184
                         instance.setUpdatePending(true);
183 185
                         instance.setLocal(false);
184 186
                         remote.add(instance);

+ 9
- 0
launcher/src/main/java/com/skcraft/launcher/Launcher.java View File

@@ -344,6 +344,15 @@ public final class Launcher {
344 344
         }
345 345
     }
346 346
 
347
+    /**
348
+     * Get the packages URL.
349
+     *
350
+     * @return the packages URL
351
+     */
352
+    public URL getPackageRoot() {
353
+        return HttpRequest.url(getProperties().getProperty("packageRootUrl"));
354
+    }
355
+
347 356
     /**
348 357
      * Convenient method to fetch a property.
349 358
      *

+ 2
- 1
launcher/src/main/resources/com/skcraft/launcher/launcher.properties View File

@@ -17,5 +17,6 @@ yggdrasilAuthUrl=https://authserver.mojang.com
17 17
 resetPasswordUrl=https://minecraft.net/resetpassword
18 18
 
19 19
 newsUrl=http://update.skcraft.com/template/news.html?version=%s
20
-packageListUrl=https://files.gildedgames.com/minecraft/launcher/packages/packages.php?key=%s
20
+packageListUrl=https://files.gildedgames.com/minecraft/launcher/v2/packages/list/%s
21
+packageRootUrl=https://files.gildedgames.com/minecraft/launcher/v2/packages/
21 22
 selfUpdateUrl=https://files.gildedgames.com/minecraft/launcher/latest.json

Loading…
Cancel
Save