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 {
public void back() {
this.stack.pop();

JComponent panel = this.stack.peek();

this.setView(this.stack.peek());

if (panel instanceof IListeningView) {
((IListeningView) panel).reload();
}
}

public JPanel getRoot() {
@@ -37,10 +43,6 @@ public class LauncherLayout {
this.root.removeAll();
this.root.add(view, BorderLayout.CENTER);

if (view instanceof IListeningView) {
((IListeningView) view).reload();
}
this.root.revalidate();
this.root.repaint();
});

+ 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 {
Futures.addCallback(refreshInstancesFuture, new FutureCallback<InstanceList>() {
@Override
public void onSuccess(@Nullable InstanceList result) {
PlayView.this.refreshNews(force);

PlayView.this.bannerPanel.close();
}

@Override
public void onFailure(Throwable t) {
PlayView.this.bannerPanel.update(LauncherIcons.WARN, "There was a problem checking for updates.", BannerPanel.BannerType.ERROR);
PlayView.this.bannerPanel.bindActionHandler(LauncherIcons.REFRESH, "Refresh", () -> PlayView.this.refresh(force));

PlayView.this.refreshNews(false);
}
});

@@ -399,8 +403,6 @@ public class PlayView extends JPanel implements IListeningView {
}

this.requestFocus();

this.refreshNews(force);
}, SwingExecutor.INSTANCE);
}

@@ -410,7 +412,6 @@ public class PlayView extends JPanel implements IListeningView {
Futures.addCallback(refreshNewsFuture, new FutureCallback<NewsFeedManager.NewsFeed>() {
@Override
public void onSuccess(@Nullable NewsFeedManager.NewsFeed result) {
PlayView.this.bannerPanel.close();
PlayView.this.layoutNewsTiles(result);
}


+ 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;
import lombok.Getter;

public class GameKeyManager {
private static final String VERIFY_URL = "http://localhost:8080/keys/verify/%s";
private static final String VERIFY_URL = "https://files.gildedgames.com/minecraft/launcher/v2/packages/keys/verify/%s";

private final Launcher launcher;


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

@@ -133,6 +133,8 @@ public class InstanceList {
try {
URL packagesURL = launcher.getPackagesURL();

URL packagesRoot = launcher.getPackageRoot();

PackageList packages = HttpRequest
.get(packagesURL)
.execute()
@@ -153,7 +155,7 @@ public class InstanceList {

instance.setTitle(manifest.getTitle());
instance.setPriority(manifest.getPriority());
URL url = concat(packagesURL, manifest.getLocation());
URL url = concat(packagesRoot, manifest.getLocation());
instance.setManifestURL(url);

log.info("(" + instance.getName() + ").setManifestURL(" + url + ")");
@@ -178,7 +180,7 @@ public class InstanceList {
instance.setVersion(manifest.getVersion());
instance.setPriority(manifest.getPriority());
instance.setSelected(false);
instance.setManifestURL(concat(packagesURL, manifest.getLocation()));
instance.setManifestURL(concat(packagesRoot, manifest.getLocation()));
instance.setUpdatePending(true);
instance.setLocal(false);
remote.add(instance);

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

@@ -344,6 +344,15 @@ public final class Launcher {
}
}

/**
* Get the packages URL.
*
* @return the packages URL
*/
public URL getPackageRoot() {
return HttpRequest.url(getProperties().getProperty("packageRootUrl"));
}

/**
* Convenient method to fetch a property.
*

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

@@ -17,5 +17,6 @@ yggdrasilAuthUrl=https://authserver.mojang.com
resetPasswordUrl=https://minecraft.net/resetpassword

newsUrl=http://update.skcraft.com/template/news.html?version=%s
packageListUrl=https://files.gildedgames.com/minecraft/launcher/packages/packages.php?key=%s
packageListUrl=https://files.gildedgames.com/minecraft/launcher/v2/packages/list/%s
packageRootUrl=https://files.gildedgames.com/minecraft/launcher/v2/packages/
selfUpdateUrl=https://files.gildedgames.com/minecraft/launcher/latest.json

Loading…
Cancel
Save