Format code [skip actions]

This commit is contained in:
github-actions 2023-10-17 05:42:17 +00:00
parent b7a9d28f02
commit bc8e7c21ce
7 changed files with 38 additions and 44 deletions

View File

@ -1,7 +1,7 @@
package emu.grasscutter.data.excels.dungeon; package emu.grasscutter.data.excels.dungeon;
import emu.grasscutter.game.dungeons.enums.*;
import emu.grasscutter.data.*; import emu.grasscutter.data.*;
import emu.grasscutter.game.dungeons.enums.*;
import java.util.List; import java.util.List;
import lombok.*; import lombok.*;
@ -39,7 +39,8 @@ public class DungeonEntryData extends GameResource {
public int getLevelCondition() { public int getLevelCondition() {
for (var cond : satisfiedCond) { for (var cond : satisfiedCond) {
if (cond.type != null && cond.type.equals(DungeonEntrySatisfiedConditionType.DUNGEON_ENTRY_CONDITION_LEVEL)) { if (cond.type != null
&& cond.type.equals(DungeonEntrySatisfiedConditionType.DUNGEON_ENTRY_CONDITION_LEVEL)) {
return cond.param1; return cond.param1;
} }
} }
@ -48,7 +49,8 @@ public class DungeonEntryData extends GameResource {
public int getQuestCondition() { public int getQuestCondition() {
for (var cond : satisfiedCond) { for (var cond : satisfiedCond) {
if (cond.type != null && cond.type.equals(DungeonEntrySatisfiedConditionType.DUNGEON_ENTRY_CONDITION_QUEST)) { if (cond.type != null
&& cond.type.equals(DungeonEntrySatisfiedConditionType.DUNGEON_ENTRY_CONDITION_QUEST)) {
return cond.param1; return cond.param1;
} }
} }

View File

@ -7,14 +7,10 @@ import emu.grasscutter.data.excels.dungeon.*;
import emu.grasscutter.game.dungeons.handlers.DungeonBaseHandler; import emu.grasscutter.game.dungeons.handlers.DungeonBaseHandler;
import emu.grasscutter.game.player.Player; import emu.grasscutter.game.player.Player;
import emu.grasscutter.game.props.SceneType; import emu.grasscutter.game.props.SceneType;
import emu.grasscutter.game.props.EnterReason;
import emu.grasscutter.game.world.*; import emu.grasscutter.game.world.*;
import emu.grasscutter.net.packet.*; import emu.grasscutter.net.packet.*;
import emu.grasscutter.server.game.*; import emu.grasscutter.server.game.*;
import emu.grasscutter.server.packet.send.PacketDungeonEntryInfoRsp; import emu.grasscutter.server.packet.send.PacketDungeonEntryInfoRsp;
import emu.grasscutter.game.world.data.TeleportProperties;
import emu.grasscutter.server.event.player.PlayerTeleportEvent.TeleportType;
import emu.grasscutter.net.proto.EnterTypeOuterClass.EnterType;
import it.unimi.dsi.fastutil.ints.*; import it.unimi.dsi.fastutil.ints.*;
import java.util.List; import java.util.List;
import lombok.val; import lombok.val;

View File

@ -1,8 +1,6 @@
package emu.grasscutter.server.packet.recv; package emu.grasscutter.server.packet.recv;
import emu.grasscutter.net.packet.*; import emu.grasscutter.net.packet.*;
import emu.grasscutter.net.proto.DungeonRestartReqOuterClass.DungeonRestartReq;
import emu.grasscutter.net.proto.DungeonRestartRspOuterClass.DungeonRestartRsp;
import emu.grasscutter.server.game.GameSession; import emu.grasscutter.server.game.GameSession;
@Opcodes(PacketOpcodes.DungeonRestartReq) @Opcodes(PacketOpcodes.DungeonRestartReq)

View File

@ -1,11 +1,9 @@
package emu.grasscutter.server.packet.recv; package emu.grasscutter.server.packet.recv;
import emu.grasscutter.Grasscutter;
import emu.grasscutter.net.packet.*; import emu.grasscutter.net.packet.*;
import emu.grasscutter.server.game.GameSession;
import emu.grasscutter.server.packet.send.PacketGetDungeonEntryExploreConditionRsp;
import emu.grasscutter.server.packet.send.PacketDungeonEntryToBeExploreNotify;
import emu.grasscutter.net.proto.GetDungeonEntryExploreConditionReqOuterClass.GetDungeonEntryExploreConditionReq; import emu.grasscutter.net.proto.GetDungeonEntryExploreConditionReqOuterClass.GetDungeonEntryExploreConditionReq;
import emu.grasscutter.server.game.GameSession;
import emu.grasscutter.server.packet.send.PacketDungeonEntryToBeExploreNotify;
@Opcodes(PacketOpcodes.GetDungeonEntryExploreConditionReq) @Opcodes(PacketOpcodes.GetDungeonEntryExploreConditionReq)
public class HandlerGetDungeonEntryExploreConditionReq extends PacketHandler { public class HandlerGetDungeonEntryExploreConditionReq extends PacketHandler {
@ -19,9 +17,8 @@ public class HandlerGetDungeonEntryExploreConditionReq extends PacketHandler {
// session.send(new PacketGetDungeonEntryExploreConditionRsp(req.getDungeonEntryConfigId())); // session.send(new PacketGetDungeonEntryExploreConditionRsp(req.getDungeonEntryConfigId()));
// For now, just unlock any domain the player touches. // For now, just unlock any domain the player touches.
session.send(new PacketDungeonEntryToBeExploreNotify( session.send(
req.getDungeonEntryScenePointId(), new PacketDungeonEntryToBeExploreNotify(
req.getSceneId(), req.getDungeonEntryScenePointId(), req.getSceneId(), req.getDungeonEntryConfigId()));
req.getDungeonEntryConfigId()));
} }
} }

View File

@ -6,15 +6,16 @@ import emu.grasscutter.net.proto.DungeonEntryToBeExploreNotifyOuterClass.Dungeon
public class PacketDungeonEntryToBeExploreNotify extends BasePacket { public class PacketDungeonEntryToBeExploreNotify extends BasePacket {
/** /**
* Marks the dungeon as pending exploration. * Marks the dungeon as pending exploration. This creates the "Unknown" text bubble above the
* This creates the "Unknown" text bubble above the dungeon entry in the world map. * dungeon entry in the world map.
*/ */
public PacketDungeonEntryToBeExploreNotify(int dungeonEntryScenePointId, int sceneId, int dungeonEntryConfigId) { public PacketDungeonEntryToBeExploreNotify(
int dungeonEntryScenePointId, int sceneId, int dungeonEntryConfigId) {
super(PacketOpcodes.DungeonEntryToBeExploreNotify); super(PacketOpcodes.DungeonEntryToBeExploreNotify);
this.setData(DungeonEntryToBeExploreNotify.newBuilder() this.setData(
DungeonEntryToBeExploreNotify.newBuilder()
.setDungeonEntryScenePointId(dungeonEntryScenePointId) .setDungeonEntryScenePointId(dungeonEntryScenePointId)
.setSceneId(sceneId) .setSceneId(sceneId)
.setDungeonEntryConfigId(dungeonEntryConfigId) .setDungeonEntryConfigId(dungeonEntryConfigId));
);
} }
} }

View File

@ -2,28 +2,31 @@ package emu.grasscutter.server.packet.send;
import emu.grasscutter.data.GameData; import emu.grasscutter.data.GameData;
import emu.grasscutter.net.packet.*; import emu.grasscutter.net.packet.*;
import emu.grasscutter.net.proto.GetDungeonEntryExploreConditionRspOuterClass.GetDungeonEntryExploreConditionRsp;
import emu.grasscutter.net.proto.DungeonEntryCondOuterClass.DungeonEntryCond;
import emu.grasscutter.net.proto.DungeonEntryBlockReasonOuterClass.DungeonEntryBlockReason; import emu.grasscutter.net.proto.DungeonEntryBlockReasonOuterClass.DungeonEntryBlockReason;
import emu.grasscutter.net.proto.DungeonEntryCondOuterClass.DungeonEntryCond;
import emu.grasscutter.net.proto.GetDungeonEntryExploreConditionRspOuterClass.GetDungeonEntryExploreConditionRsp;
public class PacketGetDungeonEntryExploreConditionRsp extends BasePacket { public class PacketGetDungeonEntryExploreConditionRsp extends BasePacket {
public PacketGetDungeonEntryExploreConditionRsp(int dungeonId) { public PacketGetDungeonEntryExploreConditionRsp(int dungeonId) {
super(PacketOpcodes.GetDungeonEntryExploreConditionRsp); super(PacketOpcodes.GetDungeonEntryExploreConditionRsp);
var data = GameData.getDungeonEntryDataMap().values().stream() var data =
GameData.getDungeonEntryDataMap().values().stream()
.filter(d -> d.getId() == dungeonId) .filter(d -> d.getId() == dungeonId)
.toList().get(0); .toList()
.get(0);
var level = data.getLevelCondition(); var level = data.getLevelCondition();
var quest = data.getQuestCondition(); var quest = data.getQuestCondition();
var proto = GetDungeonEntryExploreConditionRsp.newBuilder() var proto =
GetDungeonEntryExploreConditionRsp.newBuilder()
.setRetcode(0) .setRetcode(0)
.setDungeonEntryCond(DungeonEntryCond.newBuilder() .setDungeonEntryCond(
DungeonEntryCond.newBuilder()
// There is also a DUNGEON_ENTRY_REASON_MULIPLE but only one param1 // There is also a DUNGEON_ENTRY_REASON_MULIPLE but only one param1
// field to put values in. Only report the required level for now, then. // field to put values in. Only report the required level for now, then.
.setCondReason(DungeonEntryBlockReason.DUNGEON_ENTRY_REASON_LEVEL) .setCondReason(DungeonEntryBlockReason.DUNGEON_ENTRY_REASON_LEVEL)
.setParam1(level) .setParam1(level))
)
.build(); .build();
this.setData(proto); this.setData(proto);

View File

@ -6,9 +6,6 @@ import emu.grasscutter.net.proto.UnfreezeGroupLimitNotifyOuterClass.UnfreezeGrou
public class PacketUnfreezeGroupLimitNotify extends BasePacket { public class PacketUnfreezeGroupLimitNotify extends BasePacket {
public PacketUnfreezeGroupLimitNotify(int pointId, int sceneId) { public PacketUnfreezeGroupLimitNotify(int pointId, int sceneId) {
super(PacketOpcodes.UnfreezeGroupLimitNotify); super(PacketOpcodes.UnfreezeGroupLimitNotify);
this.setData(UnfreezeGroupLimitNotify.newBuilder() this.setData(UnfreezeGroupLimitNotify.newBuilder().setPointId(pointId).setSceneId(sceneId));
.setPointId(pointId)
.setSceneId(sceneId)
);
} }
} }