Use rogue manager excel instead of schedule data

This commit is contained in:
Melledy
2023-10-22 18:27:53 -07:00
parent 87c5b678f2
commit c897b9035c
5 changed files with 33 additions and 22 deletions

View File

@@ -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";

View File

@@ -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<>();

View File

@@ -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;
} }

View File

@@ -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

View File

@@ -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;