Skip to content

Commit

Permalink
Fix leaving challenges
Browse files Browse the repository at this point in the history
  • Loading branch information
Melledy committed Dec 29, 2023
1 parent 490a34c commit 599cd04
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 6 deletions.
5 changes: 5 additions & 0 deletions src/main/java/emu/lunarcore/data/excel/StageExcel.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ public int getId() {

@Override
public void onLoad() {
// Safety check for future versions
if (this.StageType == null) {
this.StageType = emu.lunarcore.game.enums.StageType.Unknown;
}

// Cache monster list
this.monsterWaves = new ArrayList<>();

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/emu/lunarcore/game/battle/BattleService.java
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ public Battle finishBattle(Player player, BattleEndStatus result, BattleStatisti
case BATTLE_END_QUIT -> {
updateStatus = false;
// 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;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ private void setCurrentExtraLineup(ExtraLineupType type) {
this.currentExtraLineup = type.getNumber();
}

@SuppressWarnings("unused")
private int getRoundsElapsed() {
return getExcel().getChallengeCountDown() - this.roundsLeft;
}
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/emu/lunarcore/game/enums/StageType.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ public enum StageType {
FantasticStory (18),
BattleCollege (19),
Heliobus (20),
RogueEndlessActivity (21);
RogueEndlessActivity (21),
StrongChallengeActivity (22),
Challenge (23);

@Getter
private final int val;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ public class HandlerGetDailyActiveInfoCsReq extends PacketHandler {

@Override
public void handle(GameSession session, byte[] data) throws Exception {
session.send(new PacketGetDailyActiveInfoScRsp(session.getPlayer()));
//session.send(new PacketGetDailyActiveInfoScRsp(session.getPlayer()));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ public class HandlerGetRogueInfoCsReq extends PacketHandler {

@Override
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()));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import emu.lunarcore.server.packet.CmdId;
import emu.lunarcore.server.packet.Opcodes;
import emu.lunarcore.server.packet.PacketHandler;
import emu.lunarcore.server.packet.send.PacketBattlePassInfoNotify;

@Opcodes(CmdId.PlayerLoginFinishCsReq)
public class HandlerPlayerLoginFinishCsReq extends PacketHandler {
Expand All @@ -13,7 +12,7 @@ public class HandlerPlayerLoginFinishCsReq extends PacketHandler {
public void handle(GameSession session, byte[] data) throws Exception {
session.send(CmdId.PlayerLoginFinishScRsp);
session.send(CmdId.GetArchiveDataScRsp);
session.send(new PacketBattlePassInfoNotify());
//session.send(new PacketBattlePassInfoNotify());
}

}

0 comments on commit 599cd04

Please sign in to comment.