mirror of
https://github.com/Melledy/LunarCore.git
synced 2025-12-14 06:14:45 +01:00
Use rogue manager excel instead of schedule data
This commit is contained in:
@@ -9,7 +9,8 @@ public class GameConstants {
|
|||||||
public static String VERSION = "1.4.0";
|
public static String VERSION = "1.4.0";
|
||||||
public static String MDK_VERSION = "";
|
public static String MDK_VERSION = "";
|
||||||
|
|
||||||
public static final int CURRENT_TIMEZONE = ZoneOffset.systemDefault().getRules().getOffset(Instant.now()).getTotalSeconds() / 3600;
|
public static final ZoneOffset CURRENT_ZONEOFFSET = ZoneOffset.systemDefault().getRules().getOffset(Instant.now());
|
||||||
|
public static final int CURRENT_TIMEZONE = CURRENT_ZONEOFFSET.getTotalSeconds() / 3600;
|
||||||
|
|
||||||
// Game
|
// Game
|
||||||
public static final String DEFAULT_NAME = "Trailblazer";
|
public static final String DEFAULT_NAME = "Trailblazer";
|
||||||
|
|||||||
@@ -33,8 +33,8 @@ public class GameData {
|
|||||||
@Getter private static Int2ObjectMap<ChallengeExcel> challengeExcelMap = new Int2ObjectOpenHashMap<>();
|
@Getter private static Int2ObjectMap<ChallengeExcel> challengeExcelMap = new Int2ObjectOpenHashMap<>();
|
||||||
@Getter private static Int2ObjectMap<ChallengeTargetExcel> challengeTargetExcelMap = new Int2ObjectOpenHashMap<>();
|
@Getter private static Int2ObjectMap<ChallengeTargetExcel> challengeTargetExcelMap = new Int2ObjectOpenHashMap<>();
|
||||||
|
|
||||||
@Getter private static Int2ObjectMap<RogueAreaExcel> rogueAreaExcelMap = new Int2ObjectLinkedOpenHashMap<>();
|
@Getter private static Int2ObjectMap<RogueAreaExcel> rogueAreaExcelMap = new Int2ObjectOpenHashMap<>();
|
||||||
@Getter private static Int2ObjectMap<RogueScheduleExcel> rogueScheduleExcelMap = new Int2ObjectOpenHashMap<>();
|
@Getter private static Int2ObjectMap<RogueManagerExcel> rogueManagerExcelMap = new Int2ObjectOpenHashMap<>();
|
||||||
@Getter private static Int2ObjectMap<RogueRoomExcel> rogueRoomExcelMap = new Int2ObjectOpenHashMap<>();
|
@Getter private static Int2ObjectMap<RogueRoomExcel> rogueRoomExcelMap = new Int2ObjectOpenHashMap<>();
|
||||||
|
|
||||||
private static Int2ObjectMap<AvatarPromotionExcel> avatarPromotionExcelMap = new Int2ObjectOpenHashMap<>();
|
private static Int2ObjectMap<AvatarPromotionExcel> avatarPromotionExcelMap = new Int2ObjectOpenHashMap<>();
|
||||||
|
|||||||
@@ -3,10 +3,11 @@ package emu.lunarcore.data;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import emu.lunarcore.GameConstants;
|
||||||
import emu.lunarcore.data.excel.RelicMainAffixExcel;
|
import emu.lunarcore.data.excel.RelicMainAffixExcel;
|
||||||
import emu.lunarcore.data.excel.RelicSubAffixExcel;
|
import emu.lunarcore.data.excel.RelicSubAffixExcel;
|
||||||
import emu.lunarcore.data.excel.RogueMapExcel;
|
import emu.lunarcore.data.excel.RogueMapExcel;
|
||||||
import emu.lunarcore.data.excel.RogueScheduleExcel;
|
import emu.lunarcore.data.excel.RogueManagerExcel;
|
||||||
import emu.lunarcore.util.Utils;
|
import emu.lunarcore.util.Utils;
|
||||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||||
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
|
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
|
||||||
@@ -43,10 +44,10 @@ public class GameDepot {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO cache this so we dont have to run this function everytime we get the schedule
|
// TODO cache this so we dont have to run this function everytime we get the schedule
|
||||||
public static RogueScheduleExcel getCurrentRogueSchedule() {
|
public static RogueManagerExcel getCurrentRogueSchedule() {
|
||||||
long time = System.currentTimeMillis();
|
long time = System.currentTimeMillis();
|
||||||
|
|
||||||
for (var schedule : GameData.getRogueScheduleExcelMap().values()) {
|
for (var schedule : GameData.getRogueManagerExcelMap().values()) {
|
||||||
if (time >= schedule.getBeginTime() && time < schedule.getEndTime()) {
|
if (time >= schedule.getBeginTime() && time < schedule.getEndTime()) {
|
||||||
return schedule;
|
return schedule;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,29 +3,33 @@ package emu.lunarcore.data.excel;
|
|||||||
import java.time.*;
|
import java.time.*;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
|
|
||||||
|
import emu.lunarcore.GameConstants;
|
||||||
import emu.lunarcore.data.GameResource;
|
import emu.lunarcore.data.GameResource;
|
||||||
import emu.lunarcore.data.ResourceType;
|
import emu.lunarcore.data.ResourceType;
|
||||||
import lombok.AccessLevel;
|
import lombok.AccessLevel;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@ResourceType(name = {"ScheduleDataRogue.json"})
|
@ResourceType(name = {"RogueManager.json"})
|
||||||
public class RogueScheduleExcel extends GameResource {
|
public class RogueManagerExcel extends GameResource {
|
||||||
private static final DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
private static final DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||||
|
|
||||||
private int ID;
|
private int ScheduleDataID;
|
||||||
|
private int RogueSeason;
|
||||||
|
|
||||||
@Getter(AccessLevel.NONE)
|
@Getter(AccessLevel.NONE)
|
||||||
private String BeginTime;
|
private String BeginTime;
|
||||||
@Getter(AccessLevel.NONE)
|
@Getter(AccessLevel.NONE)
|
||||||
private String EndTime;
|
private String EndTime;
|
||||||
|
|
||||||
|
private int[] RogueAreaIDList;
|
||||||
|
|
||||||
private transient long beginTime;
|
private transient long beginTime;
|
||||||
private transient long endTime;
|
private transient long endTime;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getId() {
|
public int getId() {
|
||||||
return ID;
|
return ScheduleDataID;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -109,7 +109,7 @@ public class RogueManager extends BasePlayerManager {
|
|||||||
long endTime = beginTime + TimeUnit.DAYS.toSeconds(8);
|
long endTime = beginTime + TimeUnit.DAYS.toSeconds(8);
|
||||||
|
|
||||||
if (schedule != null) {
|
if (schedule != null) {
|
||||||
seasonId = 68; //schedule.getId() % 100000;
|
seasonId = schedule.getRogueSeason();
|
||||||
}
|
}
|
||||||
|
|
||||||
var score = RogueScoreRewardInfo.newInstance()
|
var score = RogueScoreRewardInfo.newInstance()
|
||||||
@@ -146,18 +146,23 @@ public class RogueManager extends BasePlayerManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Add areas
|
// Add areas
|
||||||
for (var excel : GameData.getRogueAreaExcelMap().values()) {
|
if (schedule != null) {
|
||||||
var area = RogueArea.newInstance()
|
for (int i = 0; i < schedule.getRogueAreaIDList().length; i++) {
|
||||||
.setAreaId(excel.getRogueAreaID())
|
var excel = GameData.getRogueAreaExcelMap().get(schedule.getRogueAreaIDList()[i]);
|
||||||
.setRogueAreaStatus(RogueAreaStatus.ROGUE_AREA_STATUS_FIRST_PASS);
|
if (excel == null) continue;
|
||||||
|
|
||||||
if (curRogue != null && excel == curRogue.getExcel()) {
|
var area = RogueArea.newInstance()
|
||||||
area.setMapId(curRogue.getExcel().getMapId());
|
.setAreaId(excel.getRogueAreaID())
|
||||||
area.setCurReachRoomNum(curRogue.getCurrentRoomProgress());
|
.setRogueAreaStatus(RogueAreaStatus.ROGUE_AREA_STATUS_FIRST_PASS);
|
||||||
area.setRogueStatus(curRogue.getStatus());
|
|
||||||
|
if (curRogue != null && excel == curRogue.getExcel()) {
|
||||||
|
area.setMapId(curRogue.getExcel().getMapId());
|
||||||
|
area.setCurReachRoomNum(curRogue.getCurrentRoomProgress());
|
||||||
|
area.setRogueStatus(curRogue.getStatus());
|
||||||
|
}
|
||||||
|
|
||||||
|
proto.addRogueAreaList(area);
|
||||||
}
|
}
|
||||||
|
|
||||||
proto.addRogueAreaList(area);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return proto;
|
return proto;
|
||||||
|
|||||||
Reference in New Issue
Block a user