From b6e7d699498ba3db24082408e6b268f0835682dc Mon Sep 17 00:00:00 2001 From: Nazrin Date: Mon, 25 Sep 2023 16:30:33 -0700 Subject: [PATCH] Send QUEST_COND_NONE on every login (#2386) For players that enabled questing late --- src/main/java/emu/grasscutter/game/player/Player.java | 8 -------- .../java/emu/grasscutter/game/quest/QuestManager.java | 5 +---- .../server/packet/recv/HandlerSetPlayerBornDataReq.java | 1 - 3 files changed, 1 insertion(+), 13 deletions(-) diff --git a/src/main/java/emu/grasscutter/game/player/Player.java b/src/main/java/emu/grasscutter/game/player/Player.java index 25b1f66f0..e7b50c46f 100644 --- a/src/main/java/emu/grasscutter/game/player/Player.java +++ b/src/main/java/emu/grasscutter/game/player/Player.java @@ -1378,14 +1378,6 @@ public class Player implements PlayerHook, FieldFetch { this.getPlayerProgress().setPlayer(this); // Add reference to the player. } - /** - * Invoked when the player selects their avatar. - */ - public void onPlayerBorn() { - Grasscutter.getThreadPool().submit( - this.getQuestManager()::onPlayerBorn); - } - public void onLogin() { // Quest - Commented out because a problem is caused if you log out while this quest is active /* diff --git a/src/main/java/emu/grasscutter/game/quest/QuestManager.java b/src/main/java/emu/grasscutter/game/quest/QuestManager.java index 5cf0e02f7..0e9ae04a5 100644 --- a/src/main/java/emu/grasscutter/game/quest/QuestManager.java +++ b/src/main/java/emu/grasscutter/game/quest/QuestManager.java @@ -221,14 +221,11 @@ public final class QuestManager extends BasePlayerManager { this.player.sendPacket(new PacketGivingRecordNotify(this.getGivingRecords())); } - public void onPlayerBorn() { + public void onLogin() { if (this.isQuestingEnabled()) { this.enableQuests(); this.sendGivingRecords(); } - } - - public void onLogin() { List activeQuests = getActiveMainQuests(); List activeSubs = new ArrayList<>(activeQuests.size()); diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerSetPlayerBornDataReq.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerSetPlayerBornDataReq.java index 1ce2e20eb..19e0852cd 100644 --- a/src/main/java/emu/grasscutter/server/packet/recv/HandlerSetPlayerBornDataReq.java +++ b/src/main/java/emu/grasscutter/server/packet/recv/HandlerSetPlayerBornDataReq.java @@ -69,7 +69,6 @@ public class HandlerSetPlayerBornDataReq extends PacketHandler { // Login done session.getPlayer().onLogin(); - session.getPlayer().onPlayerBorn(); // Born resp packet session.send(new BasePacket(PacketOpcodes.SetPlayerBornDataRsp));