Fix wrong data urls being set in QueryGateway

This commit is contained in:
Melledy
2023-11-01 13:26:28 -07:00
parent 3bfaf46e3b
commit 45320492d6
3 changed files with 14 additions and 9 deletions

View File

@@ -96,6 +96,7 @@ public class Config {
@Getter
public static class DownloadData {
public String mdkVersion = null;
public String assetBundleUrl = null;
public String exResourceUrl = null;
public String luaUrl = null;

View File

@@ -7,7 +7,6 @@ import emu.lunarcore.util.Position;
public class GameConstants {
public static String VERSION = "1.4.0";
public static String MDK_VERSION = "";
public static final ZoneOffset CURRENT_ZONEOFFSET = ZoneOffset.systemDefault().getRules().getOffset(Instant.now());
public static final int CURRENT_TIMEZONE = CURRENT_ZONEOFFSET.getTotalSeconds() / 3600;

View File

@@ -2,7 +2,6 @@ package emu.lunarcore.server.http.handlers;
import org.jetbrains.annotations.NotNull;
import emu.lunarcore.GameConstants;
import emu.lunarcore.LunarCore;
import emu.lunarcore.proto.GateserverOuterClass.Gateserver;
import emu.lunarcore.util.Utils;
@@ -17,6 +16,9 @@ public class QueryGatewayHandler implements Handler {
@Override
public void handle(@NotNull Context ctx) throws Exception {
// Get streaming data from config
var data = LunarCore.getConfig().getDownloadData();
// Build gateserver proto
Gateserver gateserver = Gateserver.newInstance()
.setRegionName(LunarCore.getConfig().getGameServer().getId())
@@ -24,23 +26,26 @@ public class QueryGatewayHandler implements Handler {
.setPort(LunarCore.getConfig().getGameServer().getPort())
.setUnk1(true)
.setUnk2(true)
.setUnk3(true)
.setMdkResVersion(GameConstants.MDK_VERSION);
.setUnk3(true);
// Set streaming data urls
var data = LunarCore.getConfig().getDownloadData();
// Set streaming data
if (data.mdkVersion != null) {
gateserver.setMdkResVersion(data.mdkVersion);
} else {
gateserver.setMdkResVersion("");
}
if (data.assetBundleUrl != null) {
gateserver.setAssetBundleUrl(data.assetBundleUrl);
}
if (data.exResourceUrl != null) {
gateserver.setAssetBundleUrl(data.exResourceUrl);
gateserver.setExResourceUrl(data.exResourceUrl);
}
if (data.luaUrl != null) {
gateserver.setAssetBundleUrl(data.luaUrl);
gateserver.setLuaUrl(data.luaUrl);
}
if (data.ifixUrl != null) {
gateserver.setAssetBundleUrl(data.ifixUrl);
gateserver.setIfixUrl(data.ifixUrl);
}
// Log