mirror of
https://github.com/Melledy/LunarCore.git
synced 2025-12-17 07:44:42 +01:00
Fix wrong data urls being set in QueryGateway
This commit is contained in:
@@ -96,6 +96,7 @@ public class Config {
|
|||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
public static class DownloadData {
|
public static class DownloadData {
|
||||||
|
public String mdkVersion = null;
|
||||||
public String assetBundleUrl = null;
|
public String assetBundleUrl = null;
|
||||||
public String exResourceUrl = null;
|
public String exResourceUrl = null;
|
||||||
public String luaUrl = null;
|
public String luaUrl = null;
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import emu.lunarcore.util.Position;
|
|||||||
|
|
||||||
public class GameConstants {
|
public class GameConstants {
|
||||||
public static String VERSION = "1.4.0";
|
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 ZoneOffset CURRENT_ZONEOFFSET = ZoneOffset.systemDefault().getRules().getOffset(Instant.now());
|
||||||
public static final int CURRENT_TIMEZONE = CURRENT_ZONEOFFSET.getTotalSeconds() / 3600;
|
public static final int CURRENT_TIMEZONE = CURRENT_ZONEOFFSET.getTotalSeconds() / 3600;
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package emu.lunarcore.server.http.handlers;
|
|||||||
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import emu.lunarcore.GameConstants;
|
|
||||||
import emu.lunarcore.LunarCore;
|
import emu.lunarcore.LunarCore;
|
||||||
import emu.lunarcore.proto.GateserverOuterClass.Gateserver;
|
import emu.lunarcore.proto.GateserverOuterClass.Gateserver;
|
||||||
import emu.lunarcore.util.Utils;
|
import emu.lunarcore.util.Utils;
|
||||||
@@ -17,6 +16,9 @@ public class QueryGatewayHandler implements Handler {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void handle(@NotNull Context ctx) throws Exception {
|
public void handle(@NotNull Context ctx) throws Exception {
|
||||||
|
// Get streaming data from config
|
||||||
|
var data = LunarCore.getConfig().getDownloadData();
|
||||||
|
|
||||||
// Build gateserver proto
|
// Build gateserver proto
|
||||||
Gateserver gateserver = Gateserver.newInstance()
|
Gateserver gateserver = Gateserver.newInstance()
|
||||||
.setRegionName(LunarCore.getConfig().getGameServer().getId())
|
.setRegionName(LunarCore.getConfig().getGameServer().getId())
|
||||||
@@ -24,23 +26,26 @@ public class QueryGatewayHandler implements Handler {
|
|||||||
.setPort(LunarCore.getConfig().getGameServer().getPort())
|
.setPort(LunarCore.getConfig().getGameServer().getPort())
|
||||||
.setUnk1(true)
|
.setUnk1(true)
|
||||||
.setUnk2(true)
|
.setUnk2(true)
|
||||||
.setUnk3(true)
|
.setUnk3(true);
|
||||||
.setMdkResVersion(GameConstants.MDK_VERSION);
|
|
||||||
|
|
||||||
// Set streaming data urls
|
// Set streaming data
|
||||||
var data = LunarCore.getConfig().getDownloadData();
|
if (data.mdkVersion != null) {
|
||||||
|
gateserver.setMdkResVersion(data.mdkVersion);
|
||||||
|
} else {
|
||||||
|
gateserver.setMdkResVersion("");
|
||||||
|
}
|
||||||
|
|
||||||
if (data.assetBundleUrl != null) {
|
if (data.assetBundleUrl != null) {
|
||||||
gateserver.setAssetBundleUrl(data.assetBundleUrl);
|
gateserver.setAssetBundleUrl(data.assetBundleUrl);
|
||||||
}
|
}
|
||||||
if (data.exResourceUrl != null) {
|
if (data.exResourceUrl != null) {
|
||||||
gateserver.setAssetBundleUrl(data.exResourceUrl);
|
gateserver.setExResourceUrl(data.exResourceUrl);
|
||||||
}
|
}
|
||||||
if (data.luaUrl != null) {
|
if (data.luaUrl != null) {
|
||||||
gateserver.setAssetBundleUrl(data.luaUrl);
|
gateserver.setLuaUrl(data.luaUrl);
|
||||||
}
|
}
|
||||||
if (data.ifixUrl != null) {
|
if (data.ifixUrl != null) {
|
||||||
gateserver.setAssetBundleUrl(data.ifixUrl);
|
gateserver.setIfixUrl(data.ifixUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Log
|
// Log
|
||||||
|
|||||||
Reference in New Issue
Block a user