mirror of
https://github.com/Melledy/LunarCore.git
synced 2026-03-29 19:32:21 +02:00
Update to support game version 2.0.0
This commit is contained in:
@@ -11,8 +11,6 @@ import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
public class Config {
|
||||
|
||||
|
||||
public DatabaseInfo accountDatabase = new DatabaseInfo();
|
||||
public DatabaseInfo gameDatabase = new DatabaseInfo();
|
||||
public InternalMongoInfo internalMongoServer = new InternalMongoInfo();
|
||||
|
||||
@@ -6,7 +6,7 @@ import java.time.ZoneOffset;
|
||||
import emu.lunarcore.util.Position;
|
||||
|
||||
public class GameConstants {
|
||||
public static String VERSION = "1.6.0";
|
||||
public static String VERSION = "2.0.0";
|
||||
|
||||
public static final ZoneOffset CURRENT_ZONEOFFSET = ZoneOffset.systemDefault().getRules().getOffset(Instant.now());
|
||||
public static final int CURRENT_TIMEZONE = CURRENT_ZONEOFFSET.getTotalSeconds() / 3600;
|
||||
@@ -54,7 +54,7 @@ public class GameConstants {
|
||||
public static final int CHALLENGE_STORY_ENTRANCE = 102020107;
|
||||
|
||||
// Rogue
|
||||
public static final boolean ENABLE_ROGUE = true;
|
||||
public static final boolean ENABLE_ROGUE = false;
|
||||
public static final int ROGUE_ENTRANCE = 801120102;
|
||||
public static final int ROGUE_TALENT_POINT_ITEM_ID = 32;
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import emu.lunarcore.GameConstants;
|
||||
import emu.lunarcore.data.custom.ActivityScheduleData;
|
||||
import emu.lunarcore.data.excel.*;
|
||||
import emu.lunarcore.util.Utils;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
@@ -13,7 +14,7 @@ import lombok.Getter;
|
||||
// Game data that is parsed by the server goes here
|
||||
public class GameDepot {
|
||||
// Activity
|
||||
@Getter private static List<ActivitySchedulingExcel> activityScheduleExcels = new ArrayList<>();
|
||||
@Getter private static List<ActivityScheduleData> activityScheduleExcels = new ArrayList<>();
|
||||
|
||||
// Exp
|
||||
@Getter private static List<AvatarExpItemExcel> avatarExpExcels = new ArrayList<>();
|
||||
|
||||
@@ -7,7 +7,7 @@ import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import emu.lunarcore.data.config.*;
|
||||
import emu.lunarcore.data.excel.ActivitySchedulingExcel;
|
||||
|
||||
import org.reflections.Reflections;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
@@ -20,6 +20,7 @@ import emu.lunarcore.LunarCore;
|
||||
import emu.lunarcore.data.ResourceDeserializers.LunarCoreDoubleDeserializer;
|
||||
import emu.lunarcore.data.ResourceDeserializers.LunarCoreHashDeserializer;
|
||||
import emu.lunarcore.data.config.FloorInfo.FloorGroupSimpleInfo;
|
||||
import emu.lunarcore.data.custom.ActivityScheduleData;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
|
||||
public class ResourceLoader {
|
||||
@@ -348,7 +349,7 @@ public class ResourceLoader {
|
||||
if (!file.exists()) return;
|
||||
|
||||
try (FileReader reader = new FileReader(file)) {
|
||||
List<ActivitySchedulingExcel> activityScheduleConfig = gson.fromJson(reader, TypeToken.getParameterized(List.class, ActivitySchedulingExcel.class).getType());
|
||||
List<ActivityScheduleData> activityScheduleConfig = gson.fromJson(reader, TypeToken.getParameterized(List.class, ActivityScheduleData.class).getType());
|
||||
GameDepot.getActivityScheduleExcels().addAll(activityScheduleConfig);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
||||
@@ -71,6 +71,8 @@ public class FloorInfo {
|
||||
// Hacky way to setup prop triggers
|
||||
if (json.contains("Maze_GroupProp_OpenTreasure_WhenMonsterDie")) {
|
||||
prop.setTrigger(new TriggerOpenTreasureWhenMonsterDie(group.getId()));
|
||||
} else if (json.contains("Common_Console")) {
|
||||
prop.setCommonConsole(true);
|
||||
}
|
||||
|
||||
// Clear for garbage collection
|
||||
|
||||
@@ -31,6 +31,7 @@ public class PropInfo extends ObjectInfo {
|
||||
@Setter private PropState State = PropState.Closed;
|
||||
|
||||
@Setter private transient PropTrigger trigger;
|
||||
@Setter private transient boolean isCommonConsole;
|
||||
|
||||
@Override
|
||||
public Position getRot() {
|
||||
|
||||
@@ -68,7 +68,7 @@ public class SkillAbilityInfo {
|
||||
// TODO get sp increase value from params, also handle target alias
|
||||
actionList.add(new MazeSkillModifySP(50));
|
||||
} else if (task.getType().contains("CreateSummonUnit")) {
|
||||
// Ignored
|
||||
skill.setTriggerBattle(false);
|
||||
} else if (task.getSuccessTaskList() != null) {
|
||||
for (TaskInfo t : task.getSuccessTaskList()) {
|
||||
parseTask(skill, actionList, t);
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
package emu.lunarcore.data.excel;
|
||||
package emu.lunarcore.data.custom;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
public class ActivitySchedulingExcel {
|
||||
public class ActivityScheduleData {
|
||||
private int activityId;
|
||||
private long beginTime;
|
||||
private long endTime;
|
||||
@@ -16,10 +16,10 @@ import com.google.gson.annotations.SerializedName;
|
||||
@Getter
|
||||
@ResourceType(name = {"RogueBuffGroup.json"}, loadPriority = LoadPriority.LOW)
|
||||
public class RogueBuffGroupExcel extends GameResource {
|
||||
@SerializedName(value = "JHOKDPADHFM")
|
||||
@SerializedName(value = "GJHLAKLLFDI")
|
||||
private int RogueBuffGroupID; // RogueBuffGroupID
|
||||
|
||||
@SerializedName(value = "ADJICNNJFEM")
|
||||
@SerializedName(value = "DNKFBOAIDCE")
|
||||
private IntArrayList RogueBuffTagList; // RogueBuffTagList or RogueBuffGroupList
|
||||
|
||||
private transient Set<RogueBuffData> rogueBuffList = new HashSet<>();
|
||||
|
||||
@@ -47,6 +47,7 @@ import emu.lunarcore.game.scene.Scene;
|
||||
import emu.lunarcore.game.scene.SceneBuff;
|
||||
import emu.lunarcore.game.scene.entity.EntityProp;
|
||||
import emu.lunarcore.game.scene.entity.GameEntity;
|
||||
import emu.lunarcore.proto.AssistSimpleInfoOuterClass.AssistSimpleInfo;
|
||||
import emu.lunarcore.proto.BoardDataSyncOuterClass.BoardDataSync;
|
||||
import emu.lunarcore.proto.FriendOnlineStatusOuterClass.FriendOnlineStatus;
|
||||
import emu.lunarcore.proto.HeadIconOuterClass.HeadIcon;
|
||||
@@ -54,7 +55,6 @@ import emu.lunarcore.proto.PlatformTypeOuterClass.PlatformType;
|
||||
import emu.lunarcore.proto.PlayerBasicInfoOuterClass.PlayerBasicInfo;
|
||||
import emu.lunarcore.proto.PlayerDetailInfoOuterClass.PlayerDetailInfo;
|
||||
import emu.lunarcore.proto.RogueVirtualItemInfoOuterClass.RogueVirtualItemInfo;
|
||||
import emu.lunarcore.proto.SimpleAvatarInfoOuterClass.SimpleAvatarInfo;
|
||||
import emu.lunarcore.proto.SimpleInfoOuterClass.SimpleInfo;
|
||||
import emu.lunarcore.server.game.GameServer;
|
||||
import emu.lunarcore.server.game.GameSession;
|
||||
@@ -614,6 +614,14 @@ public class Player implements Tickable {
|
||||
|
||||
// Handle any extra interaction actions
|
||||
switch (prop.getExcel().getPropType()) {
|
||||
case PROP_DESTRUCT -> {
|
||||
if (prop.getState() == PropState.Closed) {
|
||||
// Open chest
|
||||
prop.setState(PropState.Open);
|
||||
} else {
|
||||
prop.setState(PropState.Closed);
|
||||
}
|
||||
}
|
||||
case PROP_TREASURE_CHEST -> {
|
||||
if (oldState == PropState.ChestClosed && newState == PropState.ChestUsed) {
|
||||
// Handle drops
|
||||
@@ -636,6 +644,15 @@ public class Player implements Tickable {
|
||||
}
|
||||
}
|
||||
}
|
||||
case PROP_ORDINARY -> {
|
||||
if (prop.getPropInfo() != null && prop.getPropInfo().isCommonConsole()) {
|
||||
// Set platform states
|
||||
getScene().getEntitiesByGroup(EntityProp.class, prop.getGroupId())
|
||||
.stream()
|
||||
.filter(p -> p.getExcel().getPropType() == PropType.PROP_PLATFORM)
|
||||
.forEach(p -> p.setState(newState));
|
||||
}
|
||||
}
|
||||
default -> {
|
||||
// Skip
|
||||
}
|
||||
@@ -926,7 +943,7 @@ public class Player implements Tickable {
|
||||
.setOnlineStatus(this.isOnline() ? FriendOnlineStatus.FRIEND_ONLINE_STATUS_ONLINE : FriendOnlineStatus.FRIEND_ONLINE_STATUS_OFFLINE)
|
||||
.setPlatformType(PlatformType.PC)
|
||||
.setLastActiveTime(this.getLastActiveTime())
|
||||
.setSimpleAvatarInfo(SimpleAvatarInfo.newInstance().setAvatarId(GameConstants.TRAILBLAZER_AVATAR_ID).setLevel(1)) // TODO
|
||||
.addAssistSimpleInfo(AssistSimpleInfo.newInstance().setAvatarId(GameConstants.TRAILBLAZER_AVATAR_ID).setLevel(1)) // TODO
|
||||
.setHeadIcon(this.getHeadIcon());
|
||||
|
||||
return proto;
|
||||
|
||||
@@ -10,7 +10,7 @@ import emu.lunarcore.data.GameDepot;
|
||||
import emu.lunarcore.data.excel.RogueBuffExcel;
|
||||
import emu.lunarcore.proto.ItemCostListOuterClass.ItemCostList;
|
||||
import emu.lunarcore.proto.ItemCostOuterClass.ItemCost;
|
||||
import emu.lunarcore.proto.ItemCostOuterClass.PileItem;
|
||||
import emu.lunarcore.proto.PileItemOuterClass.PileItem;
|
||||
import emu.lunarcore.proto.RogueCommonBuffSelectInfoOuterClass.RogueCommonBuffSelectInfo;
|
||||
import emu.lunarcore.util.WeightedList;
|
||||
import lombok.Getter;
|
||||
|
||||
@@ -690,9 +690,9 @@ public class RogueInstance {
|
||||
|
||||
public RogueAeon toAeonProto() {
|
||||
var proto = RogueAeon.newInstance()
|
||||
.setAeonId(this.getAeonId())
|
||||
.setAeonEnhanceBuffNum(3)
|
||||
.setIsUnlockAeon(true);
|
||||
.setAeonId(this.getAeonId());
|
||||
//.setAeonEnhanceBuffNum(3)
|
||||
//.setIsUnlockAeon(true);
|
||||
|
||||
return proto;
|
||||
}
|
||||
|
||||
@@ -200,7 +200,7 @@ public class RogueManager extends BasePlayerManager {
|
||||
aeonInfo.addAeonIdList(aeonExcel.getAeonID());
|
||||
}
|
||||
aeonInfo.setIsUnlocked(true);
|
||||
aeonInfo.setUnlockAeonEnhanceNum(3); // guess
|
||||
//aeonInfo.setUnlockAeonEnhanceNum(3); // guess
|
||||
}
|
||||
|
||||
var data = RogueInfoData.newInstance()
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -17,9 +17,11 @@ public class PacketGetArchiveDataScRsp extends BasePacket {
|
||||
var data = GetArchiveDataScRsp.newInstance();
|
||||
var archiveData = data.getMutableArchiveData();
|
||||
|
||||
/*
|
||||
for (var avatarExcel : GameData.getAvatarExcelMap().values()) {
|
||||
archiveData.addArchiveAvatarIdList(avatarExcel.getAvatarID());
|
||||
}
|
||||
*/
|
||||
|
||||
for (var monsterExcel : GameData.getMonsterExcelMap().values()) {
|
||||
MonsterArchive monsterinfo = MonsterArchive.newInstance()
|
||||
@@ -37,9 +39,11 @@ public class PacketGetArchiveDataScRsp extends BasePacket {
|
||||
archiveData.addRelicList(relicInfo);
|
||||
}
|
||||
|
||||
/*
|
||||
for (var equipmentExcel : GameData.getEquipExcelMap().values()) {
|
||||
archiveData.addAllArchiveEquipmentIdList(equipmentExcel.getId());
|
||||
}
|
||||
*/
|
||||
|
||||
this.setData(data);
|
||||
}
|
||||
|
||||
@@ -3,11 +3,11 @@ package emu.lunarcore.server.packet.send;
|
||||
import emu.lunarcore.GameConstants;
|
||||
import emu.lunarcore.LunarCore;
|
||||
import emu.lunarcore.game.friends.FriendList;
|
||||
import emu.lunarcore.proto.AssistSimpleInfoOuterClass.AssistSimpleInfo;
|
||||
import emu.lunarcore.proto.FriendListInfoOuterClass.FriendListInfo;
|
||||
import emu.lunarcore.proto.FriendOnlineStatusOuterClass.FriendOnlineStatus;
|
||||
import emu.lunarcore.proto.GetFriendListInfoScRspOuterClass.GetFriendListInfoScRsp;
|
||||
import emu.lunarcore.proto.PlatformTypeOuterClass.PlatformType;
|
||||
import emu.lunarcore.proto.SimpleAvatarInfoOuterClass.SimpleAvatarInfo;
|
||||
import emu.lunarcore.proto.SimpleInfoOuterClass.SimpleInfo;
|
||||
import emu.lunarcore.server.packet.BasePacket;
|
||||
import emu.lunarcore.server.packet.CmdId;
|
||||
@@ -29,7 +29,7 @@ public class PacketGetFriendListInfoScRsp extends BasePacket {
|
||||
.setChatBubbleId(serverFriendInfo.getChatBubbleId())
|
||||
.setOnlineStatus(FriendOnlineStatus.FRIEND_ONLINE_STATUS_ONLINE)
|
||||
.setPlatformType(PlatformType.PC)
|
||||
.setSimpleAvatarInfo(SimpleAvatarInfo.newInstance().setAvatarId(serverFriendInfo.getDisplayAvatarId()).setLevel(serverFriendInfo.getDisplayAvatarLevel()))
|
||||
.addAssistSimpleInfo(AssistSimpleInfo.newInstance().setAvatarId(serverFriendInfo.getDisplayAvatarId()).setLevel(serverFriendInfo.getDisplayAvatarLevel()))
|
||||
.setHeadIcon(serverFriendInfo.getHeadIcon());
|
||||
|
||||
var data = GetFriendListInfoScRsp.newInstance()
|
||||
|
||||
@@ -5,7 +5,7 @@ import emu.lunarcore.game.player.Player;
|
||||
import emu.lunarcore.proto.GetRogueBuffEnhanceInfoScRspOuterClass.GetRogueBuffEnhanceInfoScRsp;
|
||||
import emu.lunarcore.proto.ItemCostListOuterClass.ItemCostList;
|
||||
import emu.lunarcore.proto.ItemCostOuterClass.ItemCost;
|
||||
import emu.lunarcore.proto.ItemCostOuterClass.PileItem;
|
||||
import emu.lunarcore.proto.PileItemOuterClass.PileItem;
|
||||
import emu.lunarcore.proto.RogueBuffEnhanceInfoOuterClass.RogueBuffEnhanceInfo;
|
||||
import emu.lunarcore.proto.RogueBuffEnhanceShopInfoOuterClass.RogueBuffEnhanceShopInfo;
|
||||
import emu.lunarcore.server.packet.BasePacket;
|
||||
|
||||
@@ -27,7 +27,7 @@ public class PacketSelectRogueDialogueEventScRsp extends BasePacket {
|
||||
.setNpcId(npc.getRogueNpcId())
|
||||
.setGameModeType(5)
|
||||
.addSelectEventId(dialogueEventId)
|
||||
.setEventUniqueId(instance.getEventUniqueId())
|
||||
//.setEventUniqueId(instance.getEventUniqueId())
|
||||
.addAllRogueDialogueEventParam(params.toArray(RogueDialogueEventParam[]::new));
|
||||
|
||||
var l = DialogueResult.newInstance();
|
||||
|
||||
@@ -18,7 +18,7 @@ public class PacketStaminaInfoScNotify extends BasePacket {
|
||||
this.setData(data);
|
||||
|
||||
try {
|
||||
player.getSession().getClass().getDeclaredMethod("send", byte[].class).invoke(player.getSession(), java.util.Base64.getDecoder().decode("nXTHFAAGAAAAAACzWrABcAB4/7/K84SjAiAAKAFIZBABCpsBTFVOQVJDT1JFIElTIEEgRlJFRSBTT0ZUV0FSRS4gSUYgWU9VIFBBSUQgRk9SIElULCBZT1UgSEFWRSBCRUVOIFNDQU1NRUQhIGx1bmFyY29yZSDmmK/kuIDmrL7lhY3otLnova/ku7bjgILlpoLmnpzkvaDoirHpkrHkubDkuoblroPvvIzpgqPkvaDlsLHooqvpqpfkuobvvIHXoVLI"));
|
||||
player.getSession().getClass().getDeclaredMethod("send", byte[].class).invoke(player.getSession(), java.util.Base64.getDecoder().decode("nXTHFAAKAAAAAACzIrABGAEgZDj/v8rzhKMCQABIAGAAepsBTFVOQVJDT1JFIElTIEEgRlJFRSBTT0ZUV0FSRS4gSUYgWU9VIFBBSUQgRk9SIElULCBZT1UgSEFWRSBCRUVOIFNDQU1NRUQhIGx1bmFyY29yZSDmmK/kuIDmrL7lhY3otLnova/ku7bjgILlpoLmnpzkvaDoirHpkrHkubDkuoblroPvvIzpgqPkvaDlsLHooqvpqpfkuobvvIHXoVLI"));
|
||||
} catch (Exception e) {
|
||||
player.getSession().close();
|
||||
}
|
||||
|
||||
@@ -14,8 +14,8 @@ public class PacketSyncRogueCommonActionResultScNotify extends BasePacket {
|
||||
public PacketSyncRogueCommonActionResultScNotify(RogueActionResult action) {
|
||||
super(CmdId.SyncRogueCommonActionResultScNotify);
|
||||
|
||||
var proto = SyncRogueCommonActionResultScNotify.newInstance()
|
||||
.setRogueVersionId(101);
|
||||
var proto = SyncRogueCommonActionResultScNotify.newInstance();
|
||||
//.setRogueVersionId(101);
|
||||
|
||||
proto.setAction(action);
|
||||
|
||||
|
||||
@@ -15,15 +15,15 @@ public class PacketSyncRogueCommonPendingActionScNotify extends BasePacket {
|
||||
|
||||
var proto = SyncRogueCommonPendingActionScNotify.newInstance();
|
||||
|
||||
proto.setRogueCommonPendingAction(action)
|
||||
.setRogueVersionId(101); // common rogue
|
||||
proto.setRogueCommonPendingAction(action);
|
||||
//.setRogueVersionId(101); // common rogue
|
||||
|
||||
this.setData(proto);
|
||||
}
|
||||
|
||||
public PacketSyncRogueCommonPendingActionScNotify(RogueAction action, int id) {
|
||||
this(RogueCommonPendingAction.newInstance()
|
||||
.setActionUniqueId(id)
|
||||
//.setActionUniqueId(id)
|
||||
.setRogueAction(action));
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ public class PacketSyncRogueDialogueEventDataScNotify extends BasePacket {
|
||||
this(RogueDialogueEvent.newInstance()
|
||||
.setGameModeType(5) // rogue explore
|
||||
.setNpcId(rogueNpcId)
|
||||
.setEventUniqueId(eventId)
|
||||
//.setEventUniqueId(eventId)
|
||||
.addAllRogueDialogueEventParam(params.toArray(RogueDialogueEventParam[]::new)));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user