Merge changes from hamusuke (#2)

This commit is contained in:
ハムスケ ハム 2023-08-22 23:56:11 -04:00 committed by KingRainbow44
parent 396f302eac
commit f20ac13914
No known key found for this signature in database
GPG Key ID: FC2CB64B00D257BE
7 changed files with 1135 additions and 1050 deletions

File diff suppressed because it is too large Load Diff

View File

@ -276,6 +276,9 @@ public final class GameData {
@Getter
private static final Int2ObjectMap<MapLayerData> mapLayerDataMap = new Int2ObjectOpenHashMap<>();
@Getter
private static final Int2ObjectMap<MapLayerFloorData> mapLayerFloorDataMap = new Int2ObjectOpenHashMap<>();
@Getter
private static final Int2ObjectMap<MapLayerGroupData> mapLayerGroupDataMap = new Int2ObjectOpenHashMap<>();

View File

@ -0,0 +1,31 @@
package emu.grasscutter.data.excels.scene;
import emu.grasscutter.data.GameResource;
import emu.grasscutter.data.ResourceType;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.experimental.FieldDefaults;
import java.util.List;
@ResourceType(name = "MapLayerFloorExcelConfigData.json")
@Getter
@FieldDefaults(level = AccessLevel.PRIVATE)
public final class MapLayerFloorData extends GameResource {
@Getter(onMethod_ = @Override)
int id;
int PJDGAAAGOPO;
int LCGNJBLMDHA;
long NDAGFKELEAP; // prob text map hash.
CKNDNKLCAHC CKNDNKLCAHC;
long BHEMLJCFHPI; // prob desc text map hash.
public static class CKNDNKLCAHC {
Unk_Type type;
List<Integer> paramList;
public enum Unk_Type {
MAP_FLOOR_NAME_CHANGE_QUEST
}
}
}

View File

@ -0,0 +1,18 @@
package emu.grasscutter.server.packet.recv;
import emu.grasscutter.Grasscutter;
import emu.grasscutter.net.packet.Opcodes;
import emu.grasscutter.net.packet.PacketHandler;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.BMODMHEPOFFOuterClass;
import emu.grasscutter.server.game.GameSession;
@Opcodes(PacketOpcodes.BMODMHEPOFF)
public class HandlerPlayerEnterChildMapLayerNotify extends PacketHandler {
@Override
public void handle(GameSession session, byte[] header, byte[] payload) throws Exception {
var fromClient = BMODMHEPOFFOuterClass.BMODMHEPOFF.parseFrom(payload);
// probably
Grasscutter.getLogger().info("player entered child map layer: id {}", fromClient.getHJMMAOMEHOL());
}
}

View File

@ -0,0 +1,18 @@
package emu.grasscutter.server.packet.recv;
import emu.grasscutter.Grasscutter;
import emu.grasscutter.net.packet.Opcodes;
import emu.grasscutter.net.packet.PacketHandler;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.ACDCLDJFDFKOuterClass;
import emu.grasscutter.server.game.GameSession;
@Opcodes(PacketOpcodes.ACDCLDJFDFK)
public class HandlerPlayerEnterMapLayerNotify extends PacketHandler {
@Override
public void handle(GameSession session, byte[] header, byte[] payload) throws Exception {
var fromClient = ACDCLDJFDFKOuterClass.ACDCLDJFDFK.parseFrom(payload);
Grasscutter.getLogger().info("[DEBUG] Player found new map layer: id {}", fromClient.getPPLHKCKDHEC());
}
}

View File

@ -4,6 +4,7 @@ import emu.grasscutter.data.GameData;
import emu.grasscutter.data.excels.scene.SceneTagData;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.MapLayerInfoOuterClass;
import emu.grasscutter.net.proto.PlayerWorldSceneInfoListNotifyOuterClass.PlayerWorldSceneInfoListNotify;
import emu.grasscutter.net.proto.PlayerWorldSceneInfoOuterClass.PlayerWorldSceneInfo;
@ -36,6 +37,11 @@ public class PacketPlayerWorldSceneInfoListNotify extends BasePacket {
.addSceneTagIdList(153) // 3.1 event
.addSceneTagIdList(1164) // Desert Arena (XMSM_CWLTop)
.addSceneTagIdList(1166) // Desert Pyramid (CWL_Trans_02)
.setMapLayerInfo(MapLayerInfoOuterClass.MapLayerInfo.newBuilder()
.addAllUnlockedMapLayerIdList(GameData.getMapLayerDataMap().keySet()) // MapLayer Ids
.addAllUnlockedMapLayerFloorIdList(GameData.getMapLayerFloorDataMap().keySet())
.addAllUnlockedMapLayerGroupIdList(GameData.getMapLayerGroupDataMap().keySet()) // will show MapLayer options when hovered over
.build()) //map layer test
.build())
.addInfoList(PlayerWorldSceneInfo.newBuilder()
.setSceneId(4)