Fix leaving challenges

This commit is contained in:
Melledy
2023-12-28 17:25:10 -08:00
parent 490a34c6e4
commit 599cd04770
7 changed files with 14 additions and 6 deletions

View File

@@ -32,6 +32,11 @@ public class StageExcel extends GameResource {
@Override @Override
public void onLoad() { public void onLoad() {
// Safety check for future versions
if (this.StageType == null) {
this.StageType = emu.lunarcore.game.enums.StageType.Unknown;
}
// Cache monster list // Cache monster list
this.monsterWaves = new ArrayList<>(); this.monsterWaves = new ArrayList<>();

View File

@@ -255,7 +255,7 @@ public class BattleService extends BaseGameService {
case BATTLE_END_QUIT -> { case BATTLE_END_QUIT -> {
updateStatus = false; updateStatus = false;
// Only teleport back to anchor if stage is a random fight // Only teleport back to anchor if stage is a random fight
if (battle.getStage().getStageType().getVal() <= StageType.Maze.getVal()) { if (battle.getStage().getStageType() == StageType.Maze) {
teleportToAnchor = true; teleportToAnchor = true;
} }
} }

View File

@@ -68,6 +68,7 @@ public class ChallengeInstance {
this.currentExtraLineup = type.getNumber(); this.currentExtraLineup = type.getNumber();
} }
@SuppressWarnings("unused")
private int getRoundsElapsed() { private int getRoundsElapsed() {
return getExcel().getChallengeCountDown() - this.roundsLeft; return getExcel().getChallengeCountDown() - this.roundsLeft;
} }

View File

@@ -24,7 +24,9 @@ public enum StageType {
FantasticStory (18), FantasticStory (18),
BattleCollege (19), BattleCollege (19),
Heliobus (20), Heliobus (20),
RogueEndlessActivity (21); RogueEndlessActivity (21),
StrongChallengeActivity (22),
Challenge (23);
@Getter @Getter
private final int val; private final int val;

View File

@@ -11,6 +11,6 @@ public class HandlerGetDailyActiveInfoCsReq 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 PacketGetDailyActiveInfoScRsp(session.getPlayer())); //session.send(new PacketGetDailyActiveInfoScRsp(session.getPlayer()));
} }
} }

View File

@@ -11,7 +11,8 @@ public class HandlerGetRogueInfoCsReq 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 PacketGetRogueInfoScRsp(session.getPlayer())); session.send(CmdId.GetRogueInfoScRsp);
//session.send(new PacketGetRogueInfoScRsp(session.getPlayer()));
} }
} }

View File

@@ -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.server.packet.send.PacketBattlePassInfoNotify;
@Opcodes(CmdId.PlayerLoginFinishCsReq) @Opcodes(CmdId.PlayerLoginFinishCsReq)
public class HandlerPlayerLoginFinishCsReq extends PacketHandler { public class HandlerPlayerLoginFinishCsReq extends PacketHandler {
@@ -13,7 +12,7 @@ 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(CmdId.GetArchiveDataScRsp); session.send(CmdId.GetArchiveDataScRsp);
session.send(new PacketBattlePassInfoNotify()); //session.send(new PacketBattlePassInfoNotify());
} }
} }