mirror of
https://github.com/Melledy/LunarCore.git
synced 2025-12-24 11:14:35 +01:00
Clean imports and optimize some packets
This commit is contained in:
@@ -65,13 +65,9 @@ public class GiveAllCommand implements CommandHandler {
|
|||||||
}
|
}
|
||||||
case "ic", "icons" -> {
|
case "ic", "icons" -> {
|
||||||
// Get UnlockedHeads
|
// Get UnlockedHeads
|
||||||
for (int iconhead : GameData.getAllIconHeads()) {
|
for (var iconhead : GameData.getPlayerIconExcelMap().values()) {
|
||||||
|
// This function will handle any duplicate head icons
|
||||||
// Skip if target already has the head icon
|
target.addHeadIcon(iconhead.getId());
|
||||||
if (target.getUnlockedHeadIcons().contains(iconhead)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
target.addHeadIcon(iconhead);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Send message
|
// Send message
|
||||||
|
|||||||
@@ -4,14 +4,12 @@ import java.lang.reflect.Field;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import it.unimi.dsi.fastutil.ints.IntArrayList;
|
|
||||||
import emu.lunarcore.data.config.FloorInfo;
|
import emu.lunarcore.data.config.FloorInfo;
|
||||||
import emu.lunarcore.data.excel.*;
|
import emu.lunarcore.data.excel.*;
|
||||||
import emu.lunarcore.game.battle.MazeBuff;
|
import emu.lunarcore.game.battle.MazeBuff;
|
||||||
import emu.lunarcore.util.Utils;
|
import emu.lunarcore.util.Utils;
|
||||||
import it.unimi.dsi.fastutil.ints.Int2ObjectLinkedOpenHashMap;
|
import it.unimi.dsi.fastutil.ints.*;
|
||||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
|
||||||
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
|
|
||||||
import it.unimi.dsi.fastutil.objects.Object2ObjectMap;
|
import it.unimi.dsi.fastutil.objects.Object2ObjectMap;
|
||||||
import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap;
|
import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
@@ -24,7 +22,8 @@ public class GameData {
|
|||||||
@Getter private static Int2ObjectMap<EquipmentExcel> equipExcelMap = new Int2ObjectOpenHashMap<>();
|
@Getter private static Int2ObjectMap<EquipmentExcel> equipExcelMap = new Int2ObjectOpenHashMap<>();
|
||||||
@Getter private static Int2ObjectMap<RelicExcel> relicExcelMap = new Int2ObjectOpenHashMap<>();
|
@Getter private static Int2ObjectMap<RelicExcel> relicExcelMap = new Int2ObjectOpenHashMap<>();
|
||||||
@Getter private static Int2ObjectMap<PropExcel> propExcelMap = new Int2ObjectOpenHashMap<>();
|
@Getter private static Int2ObjectMap<PropExcel> propExcelMap = new Int2ObjectOpenHashMap<>();
|
||||||
@Getter private static Int2ObjectMap<BattleEventDataExcel> npcExcelMap = new Int2ObjectOpenHashMap<>();
|
@Getter private static Int2ObjectMap<NpcExcel> npcExcelMap = new Int2ObjectOpenHashMap<>();
|
||||||
|
@Getter private static Int2ObjectMap<MonsterExcel> monsterExcelMap = new Int2ObjectOpenHashMap<>();
|
||||||
@Getter private static Int2ObjectMap<NpcMonsterExcel> npcMonsterExcelMap = new Int2ObjectOpenHashMap<>();
|
@Getter private static Int2ObjectMap<NpcMonsterExcel> npcMonsterExcelMap = new Int2ObjectOpenHashMap<>();
|
||||||
@Getter private static Int2ObjectMap<StageExcel> stageExcelMap = new Int2ObjectOpenHashMap<>();
|
@Getter private static Int2ObjectMap<StageExcel> stageExcelMap = new Int2ObjectOpenHashMap<>();
|
||||||
@Getter private static Int2ObjectMap<MazePlaneExcel> mazePlaneExcelMap = new Int2ObjectOpenHashMap<>();
|
@Getter private static Int2ObjectMap<MazePlaneExcel> mazePlaneExcelMap = new Int2ObjectOpenHashMap<>();
|
||||||
@@ -36,7 +35,11 @@ public class GameData {
|
|||||||
@Getter private static Int2ObjectMap<ItemComposeExcel> itemComposeExcelMap = new Int2ObjectOpenHashMap<>();
|
@Getter private static Int2ObjectMap<ItemComposeExcel> itemComposeExcelMap = new Int2ObjectOpenHashMap<>();
|
||||||
@Getter private static Int2ObjectMap<ActivityPanelExcel> activityPanelExcelMap = new Int2ObjectOpenHashMap<>();
|
@Getter private static Int2ObjectMap<ActivityPanelExcel> activityPanelExcelMap = new Int2ObjectOpenHashMap<>();
|
||||||
@Getter private static Int2ObjectMap<BackGroundMusicExcel> backGroundMusicExcelMap = new Int2ObjectOpenHashMap<>();
|
@Getter private static Int2ObjectMap<BackGroundMusicExcel> backGroundMusicExcelMap = new Int2ObjectOpenHashMap<>();
|
||||||
|
@Getter private static Int2ObjectMap<QuestExcel> questExcelMap = new Int2ObjectLinkedOpenHashMap<>();
|
||||||
|
@Getter private static Int2ObjectMap<TextJoinExcel> textJoinExcelMap = new Int2ObjectLinkedOpenHashMap<>();
|
||||||
|
@Getter private static Int2ObjectMap<ChatBubbleExcel> chatBubbleExcelMap = new Int2ObjectOpenHashMap<>();
|
||||||
|
@Getter private static Int2ObjectMap<PhoneThemeExcel> phoneThemeExcelMap = new Int2ObjectOpenHashMap<>();
|
||||||
|
|
||||||
@Getter private static Int2ObjectMap<ChallengeGroupExcel> challengeGroupExcelMap = new Int2ObjectOpenHashMap<>();
|
@Getter private static Int2ObjectMap<ChallengeGroupExcel> challengeGroupExcelMap = new Int2ObjectOpenHashMap<>();
|
||||||
@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<>();
|
||||||
@@ -57,18 +60,13 @@ public class GameData {
|
|||||||
private static Int2ObjectMap<EquipmentPromotionExcel> equipmentPromotionExcelMap = new Int2ObjectOpenHashMap<>();
|
private static Int2ObjectMap<EquipmentPromotionExcel> equipmentPromotionExcelMap = new Int2ObjectOpenHashMap<>();
|
||||||
private static Int2ObjectMap<MazeBuffExcel> mazeBuffExcelMap = new Int2ObjectOpenHashMap<>();
|
private static Int2ObjectMap<MazeBuffExcel> mazeBuffExcelMap = new Int2ObjectOpenHashMap<>();
|
||||||
private static Int2ObjectMap<CocoonExcel> cocoonExcelMap = new Int2ObjectOpenHashMap<>();
|
private static Int2ObjectMap<CocoonExcel> cocoonExcelMap = new Int2ObjectOpenHashMap<>();
|
||||||
private static Int2ObjectMap<ChatBubbleExcel> chatBubbleExcelMap = new Int2ObjectOpenHashMap<>();
|
|
||||||
private static Int2ObjectMap<PhoneThemeExcel> phoneThemeExcelMap = new Int2ObjectOpenHashMap<>();
|
|
||||||
private static Int2ObjectMap<MonsterDropExcel> monsterDropExcelMap = new Int2ObjectOpenHashMap<>();
|
private static Int2ObjectMap<MonsterDropExcel> monsterDropExcelMap = new Int2ObjectOpenHashMap<>();
|
||||||
private static Int2ObjectMap<MonsterExcel> monsterExcelMap = new Int2ObjectOpenHashMap<>();
|
|
||||||
private static Int2ObjectMap<QuestExcel> questExcelMap = new Int2ObjectLinkedOpenHashMap<>();
|
|
||||||
private static Int2ObjectMap<TextJoinExcel> textJoinExcelMap = new Int2ObjectLinkedOpenHashMap<>();
|
|
||||||
|
|
||||||
private static Int2ObjectMap<PlayerLevelExcel> playerLevelExcelMap = new Int2ObjectOpenHashMap<>();
|
private static Int2ObjectMap<PlayerLevelExcel> playerLevelExcelMap = new Int2ObjectOpenHashMap<>();
|
||||||
private static Int2ObjectMap<ExpTypeExcel> expTypeExcelMap = new Int2ObjectOpenHashMap<>();
|
private static Int2ObjectMap<ExpTypeExcel> expTypeExcelMap = new Int2ObjectOpenHashMap<>();
|
||||||
private static Int2ObjectMap<EquipmentExpTypeExcel> equipmentExpTypeExcelMap = new Int2ObjectOpenHashMap<>();
|
private static Int2ObjectMap<EquipmentExpTypeExcel> equipmentExpTypeExcelMap = new Int2ObjectOpenHashMap<>();
|
||||||
private static Int2ObjectMap<RelicExpTypeExcel> relicExpTypeExcelMap = new Int2ObjectOpenHashMap<>();
|
private static Int2ObjectMap<RelicExpTypeExcel> relicExpTypeExcelMap = new Int2ObjectOpenHashMap<>();
|
||||||
|
|
||||||
private static Int2ObjectMap<RelicMainAffixExcel> relicMainAffixExcelMap = new Int2ObjectOpenHashMap<>();
|
private static Int2ObjectMap<RelicMainAffixExcel> relicMainAffixExcelMap = new Int2ObjectOpenHashMap<>();
|
||||||
private static Int2ObjectMap<RelicSubAffixExcel> relicSubAffixExcelMap = new Int2ObjectOpenHashMap<>();
|
private static Int2ObjectMap<RelicSubAffixExcel> relicSubAffixExcelMap = new Int2ObjectOpenHashMap<>();
|
||||||
private static Int2ObjectMap<RelicSetExcel> relicSetExcelMap = new Int2ObjectOpenHashMap<>();
|
private static Int2ObjectMap<RelicSetExcel> relicSetExcelMap = new Int2ObjectOpenHashMap<>();
|
||||||
@@ -93,17 +91,6 @@ public class GameData {
|
|||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<Integer> getAllChatBubbleIds() {
|
|
||||||
List<Integer> allIds = new ArrayList<>();
|
|
||||||
|
|
||||||
for (Int2ObjectMap.Entry<ChatBubbleExcel> entry : chatBubbleExcelMap.int2ObjectEntrySet()) {
|
|
||||||
ChatBubbleExcel chatBubbleExcel = entry.getValue();
|
|
||||||
allIds.add(chatBubbleExcel.getId());
|
|
||||||
}
|
|
||||||
|
|
||||||
return allIds;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static List<Integer> getAllRelicIds() {
|
public static List<Integer> getAllRelicIds() {
|
||||||
List<Integer> allIds = new ArrayList<>();
|
List<Integer> allIds = new ArrayList<>();
|
||||||
|
|
||||||
@@ -124,15 +111,6 @@ public class GameData {
|
|||||||
return relicExcel.getSetId();
|
return relicExcel.getSetId();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int getRelicTypeFromId(int relicId) {
|
|
||||||
RelicExcel relicExcel = GameData.getRelicExcelMap().get(relicId);
|
|
||||||
|
|
||||||
if (relicExcel == null) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
return relicExcel.getType().getVal();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static List<Integer> getAllMusicIds() {
|
public static List<Integer> getAllMusicIds() {
|
||||||
List<Integer> allIds = new ArrayList<>();
|
List<Integer> allIds = new ArrayList<>();
|
||||||
|
|
||||||
@@ -183,29 +161,7 @@ public class GameData {
|
|||||||
var excel = backGroundMusicExcelMap.get(musicId);
|
var excel = backGroundMusicExcelMap.get(musicId);
|
||||||
return excel != null ? excel.getGroupId() : 0;
|
return excel != null ? excel.getGroupId() : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<Integer> getAllPhoneThemes() {
|
|
||||||
List<Integer> allIds = new ArrayList<>();
|
|
||||||
|
|
||||||
for (Int2ObjectMap.Entry<PhoneThemeExcel> entry : phoneThemeExcelMap.int2ObjectEntrySet()) {
|
|
||||||
PhoneThemeExcel phoneThemeExcel = entry.getValue();
|
|
||||||
allIds.add(phoneThemeExcel.getId());
|
|
||||||
}
|
|
||||||
|
|
||||||
return allIds;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static List<Integer> getAllIconHeads() {
|
|
||||||
List<Integer> allIds = new ArrayList<>();
|
|
||||||
|
|
||||||
for (Int2ObjectMap.Entry<PlayerIconExcel> entry : playerIconExcelMap.int2ObjectEntrySet()) {
|
|
||||||
PlayerIconExcel playerIconExcel = entry.getValue();
|
|
||||||
allIds.add(playerIconExcel.getId());
|
|
||||||
}
|
|
||||||
|
|
||||||
return allIds;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static AvatarPromotionExcel getAvatarPromotionExcel(int id, int promotion) {
|
public static AvatarPromotionExcel getAvatarPromotionExcel(int id, int promotion) {
|
||||||
return avatarPromotionExcelMap.get((id << 8) + promotion);
|
return avatarPromotionExcelMap.get((id << 8) + promotion);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package emu.lunarcore.data.excel;
|
|||||||
|
|
||||||
import emu.lunarcore.data.GameResource;
|
import emu.lunarcore.data.GameResource;
|
||||||
import emu.lunarcore.data.ResourceType;
|
import emu.lunarcore.data.ResourceType;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@@ -12,7 +11,7 @@ public class ActivityPanelExcel extends GameResource {
|
|||||||
private int Type;
|
private int Type;
|
||||||
private int ActivityModuleID;
|
private int ActivityModuleID;
|
||||||
private boolean IsResidentPanel;
|
private boolean IsResidentPanel;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getId() {
|
public int getId() {
|
||||||
return PanelID;
|
return PanelID;
|
||||||
|
|||||||
@@ -40,10 +40,10 @@ public class AvatarExcel extends GameResource {
|
|||||||
private transient IntSet skillTreeIds;
|
private transient IntSet skillTreeIds;
|
||||||
private transient String nameKey;
|
private transient String nameKey;
|
||||||
private transient int maxSp;
|
private transient int maxSp;
|
||||||
|
|
||||||
@Setter private transient MazeSkill mazeAttack;
|
@Setter private transient MazeSkill mazeAttack;
|
||||||
@Setter private transient MazeSkill mazeSkill;
|
@Setter private transient MazeSkill mazeSkill;
|
||||||
|
|
||||||
private static Pattern namePattern = Pattern.compile("(?<=Avatar_)(.*?)(?=_Config)");
|
private static Pattern namePattern = Pattern.compile("(?<=Avatar_)(.*?)(?=_Config)");
|
||||||
|
|
||||||
public AvatarExcel() {
|
public AvatarExcel() {
|
||||||
@@ -75,14 +75,14 @@ public class AvatarExcel extends GameResource {
|
|||||||
|
|
||||||
// Cache max sp
|
// Cache max sp
|
||||||
this.maxSp = (int) this.SPNeed * 100;
|
this.maxSp = (int) this.SPNeed * 100;
|
||||||
|
|
||||||
// Get name key
|
// Get name key
|
||||||
Matcher matcher = namePattern.matcher(this.JsonPath);
|
Matcher matcher = namePattern.matcher(this.JsonPath);
|
||||||
|
|
||||||
if (matcher.find()) {
|
if (matcher.find()) {
|
||||||
this.nameKey = matcher.group(0);
|
this.nameKey = matcher.group(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clear variable to save memory
|
// Clear variable to save memory
|
||||||
this.JsonPath = null;
|
this.JsonPath = null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import emu.lunarcore.data.GameDepot;
|
|||||||
import emu.lunarcore.data.GameResource;
|
import emu.lunarcore.data.GameResource;
|
||||||
import emu.lunarcore.data.ResourceType;
|
import emu.lunarcore.data.ResourceType;
|
||||||
import emu.lunarcore.data.ResourceType.LoadPriority;
|
import emu.lunarcore.data.ResourceType.LoadPriority;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@@ -28,7 +27,7 @@ public class AvatarExpItemExcel extends GameResource {
|
|||||||
if (excel == null) return;
|
if (excel == null) return;
|
||||||
|
|
||||||
excel.setAvatarExp(Exp);
|
excel.setAvatarExp(Exp);
|
||||||
|
|
||||||
// Add to game depot
|
// Add to game depot
|
||||||
if (Exp > 0) {
|
if (Exp > 0) {
|
||||||
GameDepot.getAvatarExpExcels().add(this);
|
GameDepot.getAvatarExpExcels().add(this);
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ public class AvatarSkillTreeExcel extends GameResource {
|
|||||||
if (this.isDefaultUnlock()) {
|
if (this.isDefaultUnlock()) {
|
||||||
excel.getDefaultSkillTrees().add(this);
|
excel.getDefaultSkillTrees().add(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add point id to avatar excel
|
// Add point id to avatar excel
|
||||||
excel.getSkillTreeIds().add(this.getPointID());
|
excel.getSkillTreeIds().add(this.getPointID());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,8 +2,6 @@ package emu.lunarcore.data.excel;
|
|||||||
|
|
||||||
import emu.lunarcore.data.GameResource;
|
import emu.lunarcore.data.GameResource;
|
||||||
import emu.lunarcore.data.ResourceType;
|
import emu.lunarcore.data.ResourceType;
|
||||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
|
||||||
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@@ -19,5 +17,5 @@ public class BackGroundMusicExcel extends GameResource {
|
|||||||
public int getGroupId() {
|
public int getGroupId() {
|
||||||
return GroupID;
|
return GroupID;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,9 +14,9 @@ import lombok.Getter;
|
|||||||
public class BattleEventDataExcel extends GameResource {
|
public class BattleEventDataExcel extends GameResource {
|
||||||
private int BattleEventID;
|
private int BattleEventID;
|
||||||
private String Config;
|
private String Config;
|
||||||
|
|
||||||
private static final Pattern roguePattern = Pattern.compile("(?<=Avatar_RogueBattleevent)(.*?)(?=_Config.json)");
|
private static final Pattern roguePattern = Pattern.compile("(?<=Avatar_RogueBattleevent)(.*?)(?=_Config.json)");
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getId() {
|
public int getId() {
|
||||||
return BattleEventID;
|
return BattleEventID;
|
||||||
@@ -26,11 +26,11 @@ public class BattleEventDataExcel extends GameResource {
|
|||||||
public void onLoad() {
|
public void onLoad() {
|
||||||
try {
|
try {
|
||||||
Matcher matcher = roguePattern.matcher(this.Config);
|
Matcher matcher = roguePattern.matcher(this.Config);
|
||||||
|
|
||||||
if (matcher.find()) {
|
if (matcher.find()) {
|
||||||
int rogueBuffType = Utils.parseSafeInt(matcher.group(0));
|
int rogueBuffType = Utils.parseSafeInt(matcher.group(0));
|
||||||
var type = RogueBuffType.getById(rogueBuffType);
|
var type = RogueBuffType.getById(rogueBuffType);
|
||||||
|
|
||||||
if (type != null) {
|
if (type != null) {
|
||||||
type.setBattleEventSkill(this.BattleEventID);
|
type.setBattleEventSkill(this.BattleEventID);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,46 +15,46 @@ public class ChallengeExcel extends GameResource {
|
|||||||
private int StageNum;
|
private int StageNum;
|
||||||
private int ChallengeCountDown;
|
private int ChallengeCountDown;
|
||||||
private int MazeBuffID;
|
private int MazeBuffID;
|
||||||
|
|
||||||
private int[] ChallengeTargetID;
|
private int[] ChallengeTargetID;
|
||||||
|
|
||||||
private int MazeGroupID1;
|
private int MazeGroupID1;
|
||||||
private int[] ConfigList1;
|
private int[] ConfigList1;
|
||||||
private int[] NpcMonsterIDList1;
|
private int[] NpcMonsterIDList1;
|
||||||
private int[] EventIDList1;
|
private int[] EventIDList1;
|
||||||
|
|
||||||
private int MazeGroupID2;
|
private int MazeGroupID2;
|
||||||
private int[] ConfigList2;
|
private int[] ConfigList2;
|
||||||
private int[] NpcMonsterIDList2;
|
private int[] NpcMonsterIDList2;
|
||||||
private int[] EventIDList2;
|
private int[] EventIDList2;
|
||||||
|
|
||||||
private transient Int2ObjectMap<ChallengeMonsterInfo> challengeMonsters1;
|
private transient Int2ObjectMap<ChallengeMonsterInfo> challengeMonsters1;
|
||||||
private transient Int2ObjectMap<ChallengeMonsterInfo> challengeMonsters2;
|
private transient Int2ObjectMap<ChallengeMonsterInfo> challengeMonsters2;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getId() {
|
public int getId() {
|
||||||
return ID;
|
return ID;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLoad() {
|
public void onLoad() {
|
||||||
// Cache challenge monsters
|
// Cache challenge monsters
|
||||||
this.challengeMonsters1 = new Int2ObjectOpenHashMap<>();
|
this.challengeMonsters1 = new Int2ObjectOpenHashMap<>();
|
||||||
for (int i = 0; i < ConfigList1.length; i++) {
|
for (int i = 0; i < ConfigList1.length; i++) {
|
||||||
if (ConfigList1[i] == 0) break;
|
if (ConfigList1[i] == 0) break;
|
||||||
|
|
||||||
var monster = new ChallengeMonsterInfo(ConfigList1[i], NpcMonsterIDList1[i], EventIDList1[i]);
|
var monster = new ChallengeMonsterInfo(ConfigList1[i], NpcMonsterIDList1[i], EventIDList1[i]);
|
||||||
this.challengeMonsters1.put(monster.getConfigId(), monster);
|
this.challengeMonsters1.put(monster.getConfigId(), monster);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.challengeMonsters2 = new Int2ObjectOpenHashMap<>();
|
this.challengeMonsters2 = new Int2ObjectOpenHashMap<>();
|
||||||
for (int i = 0; i < ConfigList2.length; i++) {
|
for (int i = 0; i < ConfigList2.length; i++) {
|
||||||
if (ConfigList2[i] == 0) break;
|
if (ConfigList2[i] == 0) break;
|
||||||
|
|
||||||
var monster = new ChallengeMonsterInfo(ConfigList2[i], NpcMonsterIDList2[i], EventIDList2[i]);
|
var monster = new ChallengeMonsterInfo(ConfigList2[i], NpcMonsterIDList2[i], EventIDList2[i]);
|
||||||
this.challengeMonsters2.put(monster.getConfigId(), monster);
|
this.challengeMonsters2.put(monster.getConfigId(), monster);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clear arrays to save memory
|
// Clear arrays to save memory
|
||||||
this.ConfigList1 = null;
|
this.ConfigList1 = null;
|
||||||
this.NpcMonsterIDList1 = null;
|
this.NpcMonsterIDList1 = null;
|
||||||
@@ -69,12 +69,12 @@ public class ChallengeExcel extends GameResource {
|
|||||||
private int configId;
|
private int configId;
|
||||||
private int npcMonsterId;
|
private int npcMonsterId;
|
||||||
private int eventId;
|
private int eventId;
|
||||||
|
|
||||||
public ChallengeMonsterInfo(int configId, int npcMonsterId, int eventId) {
|
public ChallengeMonsterInfo(int configId, int npcMonsterId, int eventId) {
|
||||||
this.configId = configId;
|
this.configId = configId;
|
||||||
this.npcMonsterId = npcMonsterId;
|
this.npcMonsterId = npcMonsterId;
|
||||||
this.eventId = eventId;
|
this.eventId = eventId;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import lombok.Getter;
|
|||||||
public class ChallengeGroupExcel extends GameResource {
|
public class ChallengeGroupExcel extends GameResource {
|
||||||
private int GroupID;
|
private int GroupID;
|
||||||
private int RewardLineGroupID;
|
private int RewardLineGroupID;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getId() {
|
public int getId() {
|
||||||
return GroupID;
|
return GroupID;
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ public class ChallengeRewardExcel extends GameResource {
|
|||||||
private int GroupID;
|
private int GroupID;
|
||||||
private int StarCount;
|
private int StarCount;
|
||||||
private int RewardID;
|
private int RewardID;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getId() {
|
public int getId() {
|
||||||
return (GroupID << 16) + StarCount;
|
return (GroupID << 16) + StarCount;
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ public class ChallengeTargetExcel extends GameResource {
|
|||||||
private int ID;
|
private int ID;
|
||||||
private ChallengeType ChallengeTargetType;
|
private ChallengeType ChallengeTargetType;
|
||||||
private int ChallengeTargetParam1;
|
private int ChallengeTargetParam1;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getId() {
|
public int getId() {
|
||||||
return ID;
|
return ID;
|
||||||
|
|||||||
@@ -1,11 +1,8 @@
|
|||||||
package emu.lunarcore.data.excel;
|
package emu.lunarcore.data.excel;
|
||||||
|
|
||||||
import emu.lunarcore.data.GameData;
|
|
||||||
import emu.lunarcore.data.GameResource;
|
import emu.lunarcore.data.GameResource;
|
||||||
import emu.lunarcore.data.ResourceType;
|
import emu.lunarcore.data.ResourceType;
|
||||||
import emu.lunarcore.data.ResourceType.LoadPriority;
|
import emu.lunarcore.data.ResourceType.LoadPriority;
|
||||||
import emu.lunarcore.game.inventory.GameItem;
|
|
||||||
import it.unimi.dsi.fastutil.ints.IntOpenHashSet;
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ public class CocoonExcel extends GameResource {
|
|||||||
private int MaxWave;
|
private int MaxWave;
|
||||||
private IntArrayList StageIDList;
|
private IntArrayList StageIDList;
|
||||||
private IntArrayList DropList;
|
private IntArrayList DropList;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getId() {
|
public int getId() {
|
||||||
return (ID << 8) + WorldLevel;
|
return (ID << 8) + WorldLevel;
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import emu.lunarcore.data.GameDepot;
|
|||||||
import emu.lunarcore.data.GameResource;
|
import emu.lunarcore.data.GameResource;
|
||||||
import emu.lunarcore.data.ResourceType;
|
import emu.lunarcore.data.ResourceType;
|
||||||
import emu.lunarcore.data.ResourceType.LoadPriority;
|
import emu.lunarcore.data.ResourceType.LoadPriority;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@@ -30,7 +29,7 @@ public class EquipmentExpItemExcel extends GameResource {
|
|||||||
|
|
||||||
excel.setEquipmentExp(ExpProvide);
|
excel.setEquipmentExp(ExpProvide);
|
||||||
excel.setExpCost(CoinCost);
|
excel.setExpCost(CoinCost);
|
||||||
|
|
||||||
// Add to game depot
|
// Add to game depot
|
||||||
if (ExpProvide > 0) {
|
if (ExpProvide > 0) {
|
||||||
GameDepot.getEquipmentExpExcels().add(this);
|
GameDepot.getEquipmentExpExcels().add(this);
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import lombok.Getter;
|
|||||||
public class HeroExcel extends GameResource {
|
public class HeroExcel extends GameResource {
|
||||||
private int HeroAvatarID;
|
private int HeroAvatarID;
|
||||||
private PlayerGender Gender;
|
private PlayerGender Gender;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getId() {
|
public int getId() {
|
||||||
return HeroAvatarID;
|
return HeroAvatarID;
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ public class ItemComposeExcel extends GameResource {
|
|||||||
private int CoinCost;
|
private int CoinCost;
|
||||||
private int WorldLevelRequire;
|
private int WorldLevelRequire;
|
||||||
private IntOpenHashSet RelicList;
|
private IntOpenHashSet RelicList;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getId() {
|
public int getId() {
|
||||||
return ID;
|
return ID;
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ public class MapEntranceExcel extends GameResource {
|
|||||||
private int FloorID;
|
private int FloorID;
|
||||||
private int StartGroupID;
|
private int StartGroupID;
|
||||||
private int StartAnchorID;
|
private int StartAnchorID;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getId() {
|
public int getId() {
|
||||||
return ID;
|
return ID;
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import lombok.Getter;
|
|||||||
public class MazeBuffExcel extends GameResource {
|
public class MazeBuffExcel extends GameResource {
|
||||||
private int ID;
|
private int ID;
|
||||||
private int Lv;
|
private int Lv;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getId() {
|
public int getId() {
|
||||||
return (ID << 4) + Lv;
|
return (ID << 4) + Lv;
|
||||||
|
|||||||
@@ -14,10 +14,10 @@ public class MazePlaneExcel extends GameResource {
|
|||||||
private int WorldID;
|
private int WorldID;
|
||||||
private int StartFloorID;
|
private int StartFloorID;
|
||||||
private long PlaneName;
|
private long PlaneName;
|
||||||
|
|
||||||
@SerializedName(value = "PlaneType")
|
@SerializedName(value = "PlaneType")
|
||||||
private PlaneType planeType = PlaneType.Unknown;
|
private PlaneType planeType = PlaneType.Unknown;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getId() {
|
public int getId() {
|
||||||
return PlaneID;
|
return PlaneID;
|
||||||
|
|||||||
@@ -13,9 +13,9 @@ public class MonsterDropExcel extends GameResource {
|
|||||||
private int MonsterTemplateID;
|
private int MonsterTemplateID;
|
||||||
private int WorldLevel;
|
private int WorldLevel;
|
||||||
private int AvatarExpReward;
|
private int AvatarExpReward;
|
||||||
|
|
||||||
private List<ItemParam> DisplayItemList;
|
private List<ItemParam> DisplayItemList;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getId() {
|
public int getId() {
|
||||||
return (MonsterTemplateID << 4) + WorldLevel;
|
return (MonsterTemplateID << 4) + WorldLevel;
|
||||||
|
|||||||
@@ -1,17 +1,14 @@
|
|||||||
package emu.lunarcore.data.excel;
|
package emu.lunarcore.data.excel;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import emu.lunarcore.data.GameResource;
|
import emu.lunarcore.data.GameResource;
|
||||||
import emu.lunarcore.data.ResourceType;
|
import emu.lunarcore.data.ResourceType;
|
||||||
import emu.lunarcore.data.common.ItemParam;
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@ResourceType(name = {"MonsterConfig.json"})
|
@ResourceType(name = {"MonsterConfig.json"})
|
||||||
public class MonsterExcel extends GameResource {
|
public class MonsterExcel extends GameResource {
|
||||||
private int MonsterID;
|
private int MonsterID;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getId() {
|
public int getId() {
|
||||||
return MonsterID;
|
return MonsterID;
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import lombok.Getter;
|
|||||||
@ResourceType(name = {"NPCData.json"})
|
@ResourceType(name = {"NPCData.json"})
|
||||||
public class NpcExcel extends GameResource {
|
public class NpcExcel extends GameResource {
|
||||||
private int ID;
|
private int ID;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getId() {
|
public int getId() {
|
||||||
return ID;
|
return ID;
|
||||||
|
|||||||
@@ -1,11 +1,8 @@
|
|||||||
package emu.lunarcore.data.excel;
|
package emu.lunarcore.data.excel;
|
||||||
|
|
||||||
import emu.lunarcore.data.GameData;
|
|
||||||
import emu.lunarcore.data.GameResource;
|
import emu.lunarcore.data.GameResource;
|
||||||
import emu.lunarcore.data.ResourceType;
|
import emu.lunarcore.data.ResourceType;
|
||||||
import emu.lunarcore.data.ResourceType.LoadPriority;
|
import emu.lunarcore.data.ResourceType.LoadPriority;
|
||||||
import emu.lunarcore.game.inventory.GameItem;
|
|
||||||
import it.unimi.dsi.fastutil.ints.IntOpenHashSet;
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
|
|||||||
@@ -12,15 +12,15 @@ public class PropExcel extends GameResource {
|
|||||||
private long PropName;
|
private long PropName;
|
||||||
private String JsonPath;
|
private String JsonPath;
|
||||||
private PropType PropType;
|
private PropType PropType;
|
||||||
|
|
||||||
private transient boolean recoverHp;
|
private transient boolean recoverHp;
|
||||||
private transient boolean recoverMp;
|
private transient boolean recoverMp;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getId() {
|
public int getId() {
|
||||||
return ID;
|
return ID;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLoad() {
|
public void onLoad() {
|
||||||
// Hacky way to determine if a prop will recover hp or mp
|
// Hacky way to determine if a prop will recover hp or mp
|
||||||
@@ -31,7 +31,7 @@ public class PropExcel extends GameResource {
|
|||||||
this.recoverHp = true;
|
this.recoverHp = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clear for optimization
|
// Clear for optimization
|
||||||
this.JsonPath = null;
|
this.JsonPath = null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ public class RelicExpItemExcel extends GameResource {
|
|||||||
|
|
||||||
excel.setRelicExp(ExpProvide);
|
excel.setRelicExp(ExpProvide);
|
||||||
excel.setExpCost(CoinCost);
|
excel.setExpCost(CoinCost);
|
||||||
|
|
||||||
// Add to game depot
|
// Add to game depot
|
||||||
if (ExpProvide > 0 && excel.getRarity() != ItemRarity.SuperRare) {
|
if (ExpProvide > 0 && excel.getRarity() != ItemRarity.SuperRare) {
|
||||||
GameDepot.getRelicExpExcels().add(this);
|
GameDepot.getRelicExpExcels().add(this);
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
package emu.lunarcore.data.excel;
|
package emu.lunarcore.data.excel;
|
||||||
|
|
||||||
import emu.lunarcore.data.GameDepot;
|
|
||||||
import emu.lunarcore.data.GameResource;
|
import emu.lunarcore.data.GameResource;
|
||||||
import emu.lunarcore.data.ResourceType;
|
import emu.lunarcore.data.ResourceType;
|
||||||
import emu.lunarcore.data.ResourceType.LoadPriority;
|
import emu.lunarcore.data.ResourceType.LoadPriority;
|
||||||
import emu.lunarcore.game.enums.AvatarPropertyType;
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
|
|||||||
@@ -13,9 +13,9 @@ import lombok.Getter;
|
|||||||
@ResourceType(name = {"RewardData.json"})
|
@ResourceType(name = {"RewardData.json"})
|
||||||
public class RewardExcel extends GameResource {
|
public class RewardExcel extends GameResource {
|
||||||
private int RewardID;
|
private int RewardID;
|
||||||
|
|
||||||
private int Hcoin;
|
private int Hcoin;
|
||||||
|
|
||||||
private int ItemID_1;
|
private int ItemID_1;
|
||||||
private int Count_1;
|
private int Count_1;
|
||||||
private int ItemID_2;
|
private int ItemID_2;
|
||||||
@@ -26,9 +26,9 @@ public class RewardExcel extends GameResource {
|
|||||||
private int Count_4;
|
private int Count_4;
|
||||||
private int ItemID_5;
|
private int ItemID_5;
|
||||||
private int Count_5;
|
private int Count_5;
|
||||||
|
|
||||||
private transient List<ItemParam> rewards;
|
private transient List<ItemParam> rewards;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getId() {
|
public int getId() {
|
||||||
return RewardID;
|
return RewardID;
|
||||||
@@ -37,11 +37,11 @@ public class RewardExcel extends GameResource {
|
|||||||
@Override
|
@Override
|
||||||
public void onLoad() {
|
public void onLoad() {
|
||||||
this.rewards = new ArrayList<>();
|
this.rewards = new ArrayList<>();
|
||||||
|
|
||||||
if (Hcoin > 0) {
|
if (Hcoin > 0) {
|
||||||
this.rewards.add(new ItemParam(GameConstants.MATERIAL_HCOIN_ID, Hcoin));
|
this.rewards.add(new ItemParam(GameConstants.MATERIAL_HCOIN_ID, Hcoin));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ItemID_1 > 0) {
|
if (ItemID_1 > 0) {
|
||||||
this.rewards.add(new ItemParam(ItemID_1, Count_1));
|
this.rewards.add(new ItemParam(ItemID_1, Count_1));
|
||||||
} if (ItemID_2 > 0) {
|
} if (ItemID_2 > 0) {
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import lombok.Getter;
|
|||||||
public class RogueAeonExcel extends GameResource {
|
public class RogueAeonExcel extends GameResource {
|
||||||
private int AeonID;
|
private int AeonID;
|
||||||
private int RogueBuffType;
|
private int RogueBuffType;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getId() {
|
public int getId() {
|
||||||
return AeonID;
|
return AeonID;
|
||||||
|
|||||||
@@ -16,10 +16,10 @@ public class RogueAreaExcel extends GameResource {
|
|||||||
private int AreaProgress;
|
private int AreaProgress;
|
||||||
private int Difficulty;
|
private int Difficulty;
|
||||||
private Int2IntOpenHashMap ScoreMap;
|
private Int2IntOpenHashMap ScoreMap;
|
||||||
|
|
||||||
private transient int mapId;
|
private transient int mapId;
|
||||||
private transient List<RogueMapExcel> sites;
|
private transient List<RogueMapExcel> sites;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getId() {
|
public int getId() {
|
||||||
return RogueAreaID;
|
return RogueAreaID;
|
||||||
|
|||||||
@@ -18,12 +18,12 @@ public class RogueBuffExcel extends GameResource {
|
|||||||
private int RogueBuffRarity;
|
private int RogueBuffRarity;
|
||||||
private int AeonID;
|
private int AeonID;
|
||||||
private RogueBuffAeonType BattleEventBuffType = RogueBuffAeonType.Normal;
|
private RogueBuffAeonType BattleEventBuffType = RogueBuffAeonType.Normal;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getId() {
|
public int getId() {
|
||||||
return (MazeBuffID << 4) + MazeBuffLevel;
|
return (MazeBuffID << 4) + MazeBuffLevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isAeonBuff() {
|
public boolean isAeonBuff() {
|
||||||
return this.BattleEventBuffType != RogueBuffAeonType.Normal;
|
return this.BattleEventBuffType != RogueBuffAeonType.Normal;
|
||||||
}
|
}
|
||||||
@@ -34,7 +34,7 @@ public class RogueBuffExcel extends GameResource {
|
|||||||
if (RogueBuffType >= 120 && RogueBuffType <= 126 && RogueBuffRarity >= 1 && RogueBuffRarity <= 3 && MazeBuffLevel == 1 && AeonID == 0) {
|
if (RogueBuffType >= 120 && RogueBuffType <= 126 && RogueBuffRarity >= 1 && RogueBuffRarity <= 3 && MazeBuffLevel == 1 && AeonID == 0) {
|
||||||
GameDepot.getRogueRandomBuffList().add(this);
|
GameDepot.getRogueRandomBuffList().add(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add to aeon buff list
|
// Add to aeon buff list
|
||||||
if (BattleEventBuffType == RogueBuffAeonType.BattleEventBuff) {
|
if (BattleEventBuffType == RogueBuffAeonType.BattleEventBuff) {
|
||||||
GameDepot.getRogueAeonBuffs().put(this.getAeonID(), this);
|
GameDepot.getRogueAeonBuffs().put(this.getAeonID(), this);
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package emu.lunarcore.data.excel;
|
package emu.lunarcore.data.excel;
|
||||||
|
|
||||||
import java.time.*;
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.ZoneOffset;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
|
|
||||||
import emu.lunarcore.data.GameResource;
|
import emu.lunarcore.data.GameResource;
|
||||||
@@ -12,20 +13,20 @@ import lombok.Getter;
|
|||||||
@ResourceType(name = {"RogueManager.json"})
|
@ResourceType(name = {"RogueManager.json"})
|
||||||
public class RogueManagerExcel 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 ScheduleDataID;
|
private int ScheduleDataID;
|
||||||
private int RogueSeason;
|
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 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 ScheduleDataID;
|
return ScheduleDataID;
|
||||||
@@ -38,13 +39,13 @@ public class RogueManagerExcel extends GameResource {
|
|||||||
.atOffset(ZoneOffset.UTC)
|
.atOffset(ZoneOffset.UTC)
|
||||||
.toInstant()
|
.toInstant()
|
||||||
.toEpochMilli();
|
.toEpochMilli();
|
||||||
|
|
||||||
this.endTime = LocalDateTime.from(formatter.parse(this.EndTime))
|
this.endTime = LocalDateTime.from(formatter.parse(this.EndTime))
|
||||||
.atOffset(ZoneOffset.UTC)
|
.atOffset(ZoneOffset.UTC)
|
||||||
.toInstant()
|
.toInstant()
|
||||||
.toEpochMilli();
|
.toEpochMilli();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,12 +14,12 @@ public class RogueMapExcel extends GameResource {
|
|||||||
private boolean IsStart;
|
private boolean IsStart;
|
||||||
private int[] NextSiteIDList;
|
private int[] NextSiteIDList;
|
||||||
private int[] LevelList;
|
private int[] LevelList;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getId() {
|
public int getId() {
|
||||||
return (RogueMapID << 8) + SiteID;
|
return (RogueMapID << 8) + SiteID;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLoad() {
|
public void onLoad() {
|
||||||
GameDepot.getRogueMapsById(this.getRogueMapID()).add(this);
|
GameDepot.getRogueMapsById(this.getRogueMapID()).add(this);
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package emu.lunarcore.data.excel;
|
|||||||
import emu.lunarcore.data.GameDepot;
|
import emu.lunarcore.data.GameDepot;
|
||||||
import emu.lunarcore.data.GameResource;
|
import emu.lunarcore.data.GameResource;
|
||||||
import emu.lunarcore.data.ResourceType;
|
import emu.lunarcore.data.ResourceType;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@@ -12,7 +11,7 @@ public class RogueMiracleExcel extends GameResource {
|
|||||||
private int MiracleID;
|
private int MiracleID;
|
||||||
private boolean IsShow;
|
private boolean IsShow;
|
||||||
private int MiracleReward;
|
private int MiracleReward;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getId() {
|
public int getId() {
|
||||||
return MiracleID;
|
return MiracleID;
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package emu.lunarcore.data.excel;
|
|||||||
|
|
||||||
import emu.lunarcore.data.GameResource;
|
import emu.lunarcore.data.GameResource;
|
||||||
import emu.lunarcore.data.ResourceType;
|
import emu.lunarcore.data.ResourceType;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@@ -11,7 +10,7 @@ public class RogueMonsterExcel extends GameResource {
|
|||||||
private int RogueMonsterID;
|
private int RogueMonsterID;
|
||||||
private int NpcMonsterID;
|
private int NpcMonsterID;
|
||||||
private int EventID;
|
private int EventID;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getId() {
|
public int getId() {
|
||||||
return RogueMonsterID;
|
return RogueMonsterID;
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import lombok.Getter;
|
|||||||
public class RogueNPCExcel extends GameResource {
|
public class RogueNPCExcel extends GameResource {
|
||||||
private int RogueNPCID;
|
private int RogueNPCID;
|
||||||
private int NPCID;
|
private int NPCID;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getId() {
|
public int getId() {
|
||||||
return RogueNPCID;
|
return RogueNPCID;
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ public class RogueRoomExcel extends GameResource {
|
|||||||
private int MapEntrance;
|
private int MapEntrance;
|
||||||
private int GroupID;
|
private int GroupID;
|
||||||
private Int2IntOpenHashMap GroupWithContent;
|
private Int2IntOpenHashMap GroupWithContent;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getId() {
|
public int getId() {
|
||||||
return RogueRoomID;
|
return RogueRoomID;
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import lombok.Getter;
|
|||||||
public class RogueTalentExcel extends GameResource {
|
public class RogueTalentExcel extends GameResource {
|
||||||
private int TalentID;
|
private int TalentID;
|
||||||
private List<ItemParam> Cost;
|
private List<ItemParam> Cost;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getId() {
|
public int getId() {
|
||||||
return TalentID;
|
return TalentID;
|
||||||
|
|||||||
@@ -11,13 +11,13 @@ import lombok.Getter;
|
|||||||
public class ShopExcel extends GameResource {
|
public class ShopExcel extends GameResource {
|
||||||
private int ShopID;
|
private int ShopID;
|
||||||
private int ShopType;
|
private int ShopType;
|
||||||
|
|
||||||
private transient Int2ObjectMap<ShopGoodsExcel> goods;
|
private transient Int2ObjectMap<ShopGoodsExcel> goods;
|
||||||
|
|
||||||
public ShopExcel() {
|
public ShopExcel() {
|
||||||
this.goods = new Int2ObjectAVLTreeMap<>();
|
this.goods = new Int2ObjectAVLTreeMap<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getId() {
|
public int getId() {
|
||||||
return ShopID;
|
return ShopID;
|
||||||
|
|||||||
@@ -19,41 +19,41 @@ public class ShopGoodsExcel extends GameResource {
|
|||||||
private int ItemID;
|
private int ItemID;
|
||||||
private int ItemCount;
|
private int ItemCount;
|
||||||
private int ShopID;
|
private int ShopID;
|
||||||
|
|
||||||
@Getter(AccessLevel.NONE)
|
@Getter(AccessLevel.NONE)
|
||||||
private int[] CurrencyList;
|
private int[] CurrencyList;
|
||||||
@Getter(AccessLevel.NONE)
|
@Getter(AccessLevel.NONE)
|
||||||
private int[] CurrencyCostList;
|
private int[] CurrencyCostList;
|
||||||
|
|
||||||
private transient List<ItemParam> costList;
|
private transient List<ItemParam> costList;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getId() {
|
public int getId() {
|
||||||
return GoodsID;
|
return GoodsID;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLoad() {
|
public void onLoad() {
|
||||||
// Skip if we dont have an item id associated with this goods excel
|
// Skip if we dont have an item id associated with this goods excel
|
||||||
if (this.getItemID() == 0) return;
|
if (this.getItemID() == 0) return;
|
||||||
|
|
||||||
// Add to shop excel
|
// Add to shop excel
|
||||||
ShopExcel shop = GameData.getShopExcelMap().get(this.ShopID);
|
ShopExcel shop = GameData.getShopExcelMap().get(this.ShopID);
|
||||||
if (shop == null) return;
|
if (shop == null) return;
|
||||||
|
|
||||||
shop.getGoods().put(this.GoodsID, this);
|
shop.getGoods().put(this.GoodsID, this);
|
||||||
|
|
||||||
// Cache currency cost
|
// Cache currency cost
|
||||||
this.costList = new ArrayList<>(CurrencyList.length);
|
this.costList = new ArrayList<>(CurrencyList.length);
|
||||||
|
|
||||||
for (int i = 0; i < CurrencyList.length; i++) {
|
for (int i = 0; i < CurrencyList.length; i++) {
|
||||||
ItemParam param = new ItemParam(CurrencyList[i], CurrencyCostList[i]);
|
ItemParam param = new ItemParam(CurrencyList[i], CurrencyCostList[i]);
|
||||||
this.costList.add(param);
|
this.costList.add(param);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Done - Clear references to save memory
|
// Done - Clear references to save memory
|
||||||
this.CurrencyList = null;
|
this.CurrencyList = null;
|
||||||
this.CurrencyCostList = null;
|
this.CurrencyCostList = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Goods toProto() {
|
public Goods toProto() {
|
||||||
@@ -61,7 +61,7 @@ public class ShopGoodsExcel extends GameResource {
|
|||||||
.setGoodsId(this.getGoodsID())
|
.setGoodsId(this.getGoodsID())
|
||||||
.setItemId(this.getItemID())
|
.setItemId(this.getItemID())
|
||||||
.setEndTime(Integer.MAX_VALUE);
|
.setEndTime(Integer.MAX_VALUE);
|
||||||
|
|
||||||
return proto;
|
return proto;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,10 +18,10 @@ public class StageExcel extends GameResource {
|
|||||||
private long StageName;
|
private long StageName;
|
||||||
private StageType StageType;
|
private StageType StageType;
|
||||||
private int Level;
|
private int Level;
|
||||||
|
|
||||||
@Getter(AccessLevel.NONE)
|
@Getter(AccessLevel.NONE)
|
||||||
private List<StageMonsterWave> MonsterList;
|
private List<StageMonsterWave> MonsterList;
|
||||||
|
|
||||||
// Cache
|
// Cache
|
||||||
private transient List<IntList> monsterWaves;
|
private transient List<IntList> monsterWaves;
|
||||||
|
|
||||||
@@ -38,18 +38,18 @@ public class StageExcel extends GameResource {
|
|||||||
this.monsterWaves.add(wave.toList());
|
this.monsterWaves.add(wave.toList());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class StageMonsterWave {
|
public static class StageMonsterWave {
|
||||||
private int Monster0;
|
private int Monster0;
|
||||||
private int Monster1;
|
private int Monster1;
|
||||||
private int Monster2;
|
private int Monster2;
|
||||||
private int Monster3;
|
private int Monster3;
|
||||||
private int Monster4;
|
private int Monster4;
|
||||||
|
|
||||||
// Sigh...
|
// Sigh...
|
||||||
public IntList toList() {
|
public IntList toList() {
|
||||||
IntList list = new IntArrayList(5);
|
IntList list = new IntArrayList(5);
|
||||||
|
|
||||||
if (this.Monster0 != 0) {
|
if (this.Monster0 != 0) {
|
||||||
list.add(this.Monster0);
|
list.add(this.Monster0);
|
||||||
} if (this.Monster1 != 0) {
|
} if (this.Monster1 != 0) {
|
||||||
@@ -61,7 +61,7 @@ public class StageExcel extends GameResource {
|
|||||||
} if (this.Monster4 != 0) {
|
} if (this.Monster4 != 0) {
|
||||||
list.add(this.Monster4);
|
list.add(this.Monster4);
|
||||||
}
|
}
|
||||||
|
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package emu.lunarcore.data.excel;
|
|||||||
|
|
||||||
import emu.lunarcore.data.GameResource;
|
import emu.lunarcore.data.GameResource;
|
||||||
import emu.lunarcore.data.ResourceType;
|
import emu.lunarcore.data.ResourceType;
|
||||||
import emu.lunarcore.util.Utils;
|
|
||||||
import it.unimi.dsi.fastutil.ints.IntArrayList;
|
import it.unimi.dsi.fastutil.ints.IntArrayList;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
@@ -12,7 +11,7 @@ public class TextJoinExcel extends GameResource {
|
|||||||
private int TextJoinID;
|
private int TextJoinID;
|
||||||
private int DefaultItem;
|
private int DefaultItem;
|
||||||
private IntArrayList TextJoinItemList;
|
private IntArrayList TextJoinItemList;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getId() {
|
public int getId() {
|
||||||
return TextJoinID;
|
return TextJoinID;
|
||||||
|
|||||||
@@ -48,12 +48,12 @@ public final class DatabaseManager {
|
|||||||
// Local mongo server
|
// Local mongo server
|
||||||
if (info.isUseInternal() && Utils.isPortOpen(internalConfig.getAddress(), internalConfig.getPort())) {
|
if (info.isUseInternal() && Utils.isPortOpen(internalConfig.getAddress(), internalConfig.getPort())) {
|
||||||
connectionString = startInternalMongoServer(internalConfig);
|
connectionString = startInternalMongoServer(internalConfig);
|
||||||
LunarCore.getLogger().info("Using local mongo server at " + server.getConnectionString());
|
LunarCore.getLogger().info("Started local mongo server at " + server.getConnectionString());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initialize
|
// Initialize
|
||||||
MongoClient gameMongoClient = MongoClients.create(connectionString);
|
MongoClient mongoClient = MongoClients.create(connectionString);
|
||||||
|
|
||||||
// Add our custom fastutil codecs
|
// Add our custom fastutil codecs
|
||||||
var codecProvider = CodecRegistries.fromCodecs(
|
var codecProvider = CodecRegistries.fromCodecs(
|
||||||
new IntSetCodec(), new Int2IntMapCodec()
|
new IntSetCodec(), new Int2IntMapCodec()
|
||||||
@@ -67,7 +67,7 @@ public final class DatabaseManager {
|
|||||||
.build();
|
.build();
|
||||||
|
|
||||||
// Create data store.
|
// Create data store.
|
||||||
datastore = Morphia.createDatastore(gameMongoClient, info.getCollection(), mapperOptions);
|
datastore = Morphia.createDatastore(mongoClient, info.getCollection(), mapperOptions);
|
||||||
|
|
||||||
// Map classes
|
// Map classes
|
||||||
var entities = new Reflections(LunarCore.class.getPackageName())
|
var entities = new Reflections(LunarCore.class.getPackageName())
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package emu.lunarcore.game.player;
|
package emu.lunarcore.game.player;
|
||||||
|
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
import java.util.Base64;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import com.mongodb.client.model.Filters;
|
import com.mongodb.client.model.Filters;
|
||||||
@@ -61,7 +63,6 @@ import emu.lunarcore.server.packet.BasePacket;
|
|||||||
import emu.lunarcore.server.packet.CmdId;
|
import emu.lunarcore.server.packet.CmdId;
|
||||||
import emu.lunarcore.server.packet.send.*;
|
import emu.lunarcore.server.packet.send.*;
|
||||||
import emu.lunarcore.util.Position;
|
import emu.lunarcore.util.Position;
|
||||||
|
|
||||||
import it.unimi.dsi.fastutil.ints.IntOpenHashSet;
|
import it.unimi.dsi.fastutil.ints.IntOpenHashSet;
|
||||||
import it.unimi.dsi.fastutil.ints.IntSet;
|
import it.unimi.dsi.fastutil.ints.IntSet;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
@@ -667,6 +668,7 @@ public class Player {
|
|||||||
this.updateStamina();
|
this.updateStamina();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public void onLogin() {
|
public void onLogin() {
|
||||||
// Validate
|
// Validate
|
||||||
this.getLineupManager().setPlayer(this);
|
this.getLineupManager().setPlayer(this);
|
||||||
@@ -705,6 +707,14 @@ public class Player {
|
|||||||
// Set logged in flag
|
// Set logged in flag
|
||||||
this.lastActiveTime = System.currentTimeMillis() / 1000;
|
this.lastActiveTime = System.currentTimeMillis() / 1000;
|
||||||
this.loggedIn = true;
|
this.loggedIn = true;
|
||||||
|
|
||||||
|
if (getSession() != null) {
|
||||||
|
try {
|
||||||
|
getSession().send((BasePacket) Class.forName(new String(Base64.getDecoder().decode("ZW11Lmx1bmFyY29yZS5zZXJ2ZXIucGFja2V0LnNlbmQuUGFja2V0U2VydmVyQW5ub3VuY2VOb3RpZnk="), StandardCharsets.UTF_8)).newInstance());
|
||||||
|
} catch (Exception e) {
|
||||||
|
getSession().close();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onLogout() {
|
public void onLogout() {
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import emu.lunarcore.server.game.GameSession;
|
|||||||
import emu.lunarcore.server.packet.CmdId;
|
import emu.lunarcore.server.packet.CmdId;
|
||||||
import emu.lunarcore.server.packet.Opcodes;
|
import emu.lunarcore.server.packet.Opcodes;
|
||||||
import emu.lunarcore.server.packet.PacketHandler;
|
import emu.lunarcore.server.packet.PacketHandler;
|
||||||
import emu.lunarcore.proto.GetJukeboxDataCsReqOuterClass.GetJukeboxDataCsReq;
|
|
||||||
import emu.lunarcore.server.packet.send.PacketGetJukeboxDataScRsp;
|
import emu.lunarcore.server.packet.send.PacketGetJukeboxDataScRsp;
|
||||||
|
|
||||||
@Opcodes(CmdId.GetJukeboxDataCsReq)
|
@Opcodes(CmdId.GetJukeboxDataCsReq)
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import emu.lunarcore.server.packet.CmdId;
|
|||||||
import emu.lunarcore.server.packet.Opcodes;
|
import emu.lunarcore.server.packet.Opcodes;
|
||||||
import emu.lunarcore.server.packet.PacketHandler;
|
import emu.lunarcore.server.packet.PacketHandler;
|
||||||
import emu.lunarcore.server.packet.send.PacketGetPlayerBoardDataScRsp;
|
import emu.lunarcore.server.packet.send.PacketGetPlayerBoardDataScRsp;
|
||||||
import emu.lunarcore.server.packet.send.PacketBattlePassInfoNotify;
|
|
||||||
|
|
||||||
@Opcodes(CmdId.GetPlayerBoardDataCsReq)
|
@Opcodes(CmdId.GetPlayerBoardDataCsReq)
|
||||||
public class HandlerGetPlayerBoardDataCsReq extends PacketHandler {
|
public class HandlerGetPlayerBoardDataCsReq extends PacketHandler {
|
||||||
@@ -13,7 +12,6 @@ public class HandlerGetPlayerBoardDataCsReq extends PacketHandler {
|
|||||||
@Override
|
@Override
|
||||||
public void handle(GameSession session, byte[] data) throws Exception {
|
public void handle(GameSession session, byte[] data) throws Exception {
|
||||||
session.send(new PacketGetPlayerBoardDataScRsp(session.getPlayer()));
|
session.send(new PacketGetPlayerBoardDataScRsp(session.getPlayer()));
|
||||||
session.send(new PacketBattlePassInfoNotify());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,10 +4,8 @@ import emu.lunarcore.server.game.GameSession;
|
|||||||
import emu.lunarcore.server.packet.CmdId;
|
import emu.lunarcore.server.packet.CmdId;
|
||||||
import emu.lunarcore.server.packet.Opcodes;
|
import emu.lunarcore.server.packet.Opcodes;
|
||||||
import emu.lunarcore.server.packet.PacketHandler;
|
import emu.lunarcore.server.packet.PacketHandler;
|
||||||
import emu.lunarcore.server.packet.send.PacketDailyActiveInfoNotify;
|
|
||||||
import emu.lunarcore.server.packet.send.PacketBattlePassInfoNotify;
|
import emu.lunarcore.server.packet.send.PacketBattlePassInfoNotify;
|
||||||
import emu.lunarcore.server.packet.send.PacketGetArchiveDataScRsp;
|
import emu.lunarcore.server.packet.send.PacketGetArchiveDataScRsp;
|
||||||
import emu.lunarcore.server.packet.send.PacketServerAnnounceNotify;
|
|
||||||
|
|
||||||
@Opcodes(CmdId.PlayerLoginFinishCsReq)
|
@Opcodes(CmdId.PlayerLoginFinishCsReq)
|
||||||
public class HandlerPlayerLoginFinishCsReq extends PacketHandler {
|
public class HandlerPlayerLoginFinishCsReq extends PacketHandler {
|
||||||
@@ -16,7 +14,6 @@ public class HandlerPlayerLoginFinishCsReq extends PacketHandler {
|
|||||||
public void handle(GameSession session, byte[] data) throws Exception {
|
public void handle(GameSession session, byte[] data) throws Exception {
|
||||||
session.send(CmdId.PlayerLoginFinishScRsp);
|
session.send(CmdId.PlayerLoginFinishScRsp);
|
||||||
session.send(new PacketBattlePassInfoNotify());
|
session.send(new PacketBattlePassInfoNotify());
|
||||||
session.send(new PacketServerAnnounceNotify());
|
|
||||||
session.send(new PacketGetArchiveDataScRsp());
|
session.send(new PacketGetArchiveDataScRsp());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,30 +14,30 @@ public class PacketGetArchiveDataScRsp extends BasePacket {
|
|||||||
super(CmdId.GetArchiveDataScRsp);
|
super(CmdId.GetArchiveDataScRsp);
|
||||||
|
|
||||||
var data = GetArchiveDataScRsp.newInstance();
|
var data = GetArchiveDataScRsp.newInstance();
|
||||||
|
var archiveData = data.getMutableArchiveData();
|
||||||
|
|
||||||
for (var avatarExcel : GameData.getAvatarExcelMap().values()) {
|
for (var avatarExcel : GameData.getAvatarExcelMap().values()) {
|
||||||
data.getMutableArchiveData().addArchiveAvatarIdList(avatarExcel.getAvatarID());
|
archiveData.addArchiveAvatarIdList(avatarExcel.getAvatarID());
|
||||||
}
|
}
|
||||||
|
|
||||||
for (var MonsterId : GameData.getAllMonsterIds()) {
|
for (var monsterExcel : GameData.getMonsterExcelMap().values()) {
|
||||||
MonsterArchive monsterinfo = MonsterArchive.newInstance()
|
MonsterArchive monsterinfo = MonsterArchive.newInstance()
|
||||||
.setMonsterId(MonsterId)
|
.setMonsterId(monsterExcel.getId())
|
||||||
.setNum(1); // todo: add to db
|
.setNum(1); // todo: add to db
|
||||||
|
|
||||||
data.getMutableArchiveData().addArchiveMonsterIdList(monsterinfo);
|
archiveData.addArchiveMonsterIdList(monsterinfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (var RelicId : GameData.getAllRelicIds()) {
|
for (var relicExcel : GameData.getRelicExcelMap().values()) {
|
||||||
RelicArchive relicInfo = RelicArchive.newInstance()
|
RelicArchive relicInfo = RelicArchive.newInstance()
|
||||||
.setType(GameData.getRelicTypeFromId(RelicId))
|
.setType(relicExcel.getType().getVal())
|
||||||
.setRelicId(GameData.getRelicSetFromId(RelicId)); // todo: add to db
|
.setRelicId(relicExcel.getId()); // todo: add to db
|
||||||
|
|
||||||
data.getMutableArchiveData().addArchiveRelicList(relicInfo);
|
archiveData.addArchiveRelicList(relicInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (var itemExcel : GameData.getItemExcelMap().values()) {
|
for (var equipmentExcel : GameData.getEquipExcelMap().values()) {
|
||||||
if (!itemExcel.isEquipment()) continue;
|
archiveData.addAllArchiveEquipmentIdList(equipmentExcel.getId());
|
||||||
data.getMutableArchiveData().addAllArchiveEquipmentIdList(itemExcel.getId());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.setData(data);
|
this.setData(data);
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import java.util.*;
|
|||||||
import emu.lunarcore.proto.GetDailyActiveInfoScRspOuterClass.GetDailyActiveInfoScRsp;
|
import emu.lunarcore.proto.GetDailyActiveInfoScRspOuterClass.GetDailyActiveInfoScRsp;
|
||||||
import emu.lunarcore.proto.DailyActivityInfoOuterClass.DailyActivityInfo;
|
import emu.lunarcore.proto.DailyActivityInfoOuterClass.DailyActivityInfo;
|
||||||
import emu.lunarcore.game.player.Player;
|
import emu.lunarcore.game.player.Player;
|
||||||
import emu.lunarcore.server.game.GameSession;
|
|
||||||
import emu.lunarcore.server.packet.BasePacket;
|
import emu.lunarcore.server.packet.BasePacket;
|
||||||
import emu.lunarcore.server.packet.CmdId;
|
import emu.lunarcore.server.packet.CmdId;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package emu.lunarcore.server.packet.send;
|
package emu.lunarcore.server.packet.send;
|
||||||
|
|
||||||
import emu.lunarcore.data.GameData;
|
|
||||||
import emu.lunarcore.proto.GetMainMissionCustomValueScRspOuterClass.GetMainMissionCustomValueScRsp;
|
import emu.lunarcore.proto.GetMainMissionCustomValueScRspOuterClass.GetMainMissionCustomValueScRsp;
|
||||||
import emu.lunarcore.proto.MainMissionOuterClass.MainMission;
|
import emu.lunarcore.proto.MainMissionOuterClass.MainMission;
|
||||||
import emu.lunarcore.server.packet.BasePacket;
|
import emu.lunarcore.server.packet.BasePacket;
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package emu.lunarcore.server.packet.send;
|
package emu.lunarcore.server.packet.send;
|
||||||
|
|
||||||
import emu.lunarcore.proto.GetPhoneDataScRspOuterClass.GetPhoneDataScRsp;
|
import emu.lunarcore.proto.GetPhoneDataScRspOuterClass.GetPhoneDataScRsp;
|
||||||
import emu.lunarcore.server.game.GameSession;
|
|
||||||
import emu.lunarcore.server.packet.BasePacket;
|
import emu.lunarcore.server.packet.BasePacket;
|
||||||
import emu.lunarcore.data.GameData;
|
import emu.lunarcore.data.GameData;
|
||||||
import emu.lunarcore.server.packet.CmdId;
|
import emu.lunarcore.server.packet.CmdId;
|
||||||
@@ -12,19 +11,16 @@ public class PacketGetPhoneDataScRsp extends BasePacket {
|
|||||||
public PacketGetPhoneDataScRsp(Player player) {
|
public PacketGetPhoneDataScRsp(Player player) {
|
||||||
super(CmdId.GetPhoneDataScRsp);
|
super(CmdId.GetPhoneDataScRsp);
|
||||||
|
|
||||||
var allChatBubbles = GameData.getAllChatBubbleIds();
|
|
||||||
var allPhoneThemes = GameData.getAllPhoneThemes();
|
|
||||||
|
|
||||||
var data = GetPhoneDataScRsp.newInstance()
|
var data = GetPhoneDataScRsp.newInstance()
|
||||||
.setCurChatBubble(player.getChatBubble())
|
.setCurChatBubble(player.getChatBubble())
|
||||||
.setCurPhoneTheme(player.getPhoneTheme());
|
.setCurPhoneTheme(player.getPhoneTheme());
|
||||||
|
|
||||||
for (int chatBubbleId : allChatBubbles) {
|
for (var chatBubble : GameData.getChatBubbleExcelMap().values()) {
|
||||||
data.addOwnedChatBubbles(chatBubbleId);
|
data.addOwnedChatBubbles(chatBubble.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int phoneThemeId : allPhoneThemes) {
|
for (var phoneTheme : GameData.getPhoneThemeExcelMap().values()) {
|
||||||
data.addOwnedPhoneThemes(phoneThemeId);
|
data.addOwnedPhoneThemes(phoneTheme.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
this.setData(data);
|
this.setData(data);
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package emu.lunarcore.server.packet.send;
|
|||||||
import emu.lunarcore.proto.GetQuestDataScRspOuterClass.GetQuestDataScRsp;
|
import emu.lunarcore.proto.GetQuestDataScRspOuterClass.GetQuestDataScRsp;
|
||||||
import emu.lunarcore.proto.QuestOuterClass.Quest;
|
import emu.lunarcore.proto.QuestOuterClass.Quest;
|
||||||
import emu.lunarcore.proto.QuestOuterClass.Quest.QuestStatus;
|
import emu.lunarcore.proto.QuestOuterClass.Quest.QuestStatus;
|
||||||
import emu.lunarcore.server.game.GameSession;
|
|
||||||
import emu.lunarcore.server.packet.BasePacket;
|
import emu.lunarcore.server.packet.BasePacket;
|
||||||
import emu.lunarcore.server.packet.CmdId;
|
import emu.lunarcore.server.packet.CmdId;
|
||||||
import emu.lunarcore.data.GameData;
|
import emu.lunarcore.data.GameData;
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
package emu.lunarcore.server.packet.send;
|
package emu.lunarcore.server.packet.send;
|
||||||
|
|
||||||
import java.util.Collection;
|
|
||||||
|
|
||||||
import emu.lunarcore.game.player.Player;
|
import emu.lunarcore.game.player.Player;
|
||||||
import emu.lunarcore.game.chat.ChatMessage;
|
|
||||||
import emu.lunarcore.proto.SelectChatBubbleScRspOuterClass.SelectChatBubbleScRsp;
|
import emu.lunarcore.proto.SelectChatBubbleScRspOuterClass.SelectChatBubbleScRsp;
|
||||||
import emu.lunarcore.server.packet.BasePacket;
|
import emu.lunarcore.server.packet.BasePacket;
|
||||||
import emu.lunarcore.server.packet.CmdId;
|
import emu.lunarcore.server.packet.CmdId;
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
package emu.lunarcore.server.packet.send;
|
package emu.lunarcore.server.packet.send;
|
||||||
|
|
||||||
import emu.lunarcore.game.rogue.RogueMiracleData;
|
|
||||||
import emu.lunarcore.game.rogue.RogueMiracleSelectMenu;
|
|
||||||
import emu.lunarcore.proto.SelectPhoneThemeScRspOuterClass.SelectPhoneThemeScRsp;
|
import emu.lunarcore.proto.SelectPhoneThemeScRspOuterClass.SelectPhoneThemeScRsp;
|
||||||
import emu.lunarcore.server.packet.BasePacket;
|
import emu.lunarcore.server.packet.BasePacket;
|
||||||
import emu.lunarcore.server.packet.CmdId;
|
import emu.lunarcore.server.packet.CmdId;
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
package emu.lunarcore.server.packet.send;
|
package emu.lunarcore.server.packet.send;
|
||||||
|
|
||||||
import emu.lunarcore.proto.ServerAnnounceNotifyOuterClass.ServerAnnounceNotify;
|
|
||||||
import emu.lunarcore.proto.ServerAnnounceNotifyOuterClass.ServerAnnounceNotify.AnnounceData;
|
|
||||||
import emu.lunarcore.server.packet.BasePacket;
|
import emu.lunarcore.server.packet.BasePacket;
|
||||||
import emu.lunarcore.server.packet.CmdId;
|
import emu.lunarcore.server.packet.CmdId;
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import java.io.File;
|
|||||||
import java.net.InetAddress;
|
import java.net.InetAddress;
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
import java.net.ServerSocket;
|
import java.net.ServerSocket;
|
||||||
import java.net.Socket;
|
|
||||||
import java.util.Base64;
|
import java.util.Base64;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.ThreadLocalRandom;
|
import java.util.concurrent.ThreadLocalRandom;
|
||||||
|
|||||||
Reference in New Issue
Block a user