Skip to content

Commit

Permalink
More aggressive logging for Get/SetPriorityQuestHandler, per @pacampbell
Browse files Browse the repository at this point in the history
.
  • Loading branch information
RyanYappert committed Dec 4, 2024
1 parent a1446eb commit a6bb65b
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 2 deletions.
17 changes: 17 additions & 0 deletions Arrowgene.Ddon.GameServer/Handler/QuestGetPriorityQuestHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,25 @@ public override S2CQuestGetPriorityQuestRes Handle(GameClient client, C2SQuestGe
}

var quest = QuestManager.GetQuestByScheduleId(questScheduleId);
if (quest == null)
{
Logger.Error(client, $"No quest object exists for ${questScheduleId}");
continue;
}

var questStateManager = QuestManager.GetQuestStateManager(client, quest);
if (questStateManager == null)
{
Logger.Error(client, $"Unable to fetch the quest state manager for ${questScheduleId}");
continue;
}

var questState = questStateManager.GetQuestState(questScheduleId);
if (questState == null)
{
Logger.Error(client, $"Failed to find quest state for ${questScheduleId}");
continue;
}

setting.PriorityQuestList.Add(quest.ToCDataPriorityQuest(questState?.Step ?? 0));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using Arrowgene.Ddon.GameServer.Characters;
using Arrowgene.Ddon.Server;
using Arrowgene.Ddon.Shared.Entity.PacketStructure;
using Arrowgene.Ddon.Shared.Network;
using Arrowgene.Logging;

namespace Arrowgene.Ddon.GameServer.Handler
Expand Down Expand Up @@ -33,8 +32,25 @@ public override S2CQuestSetPriorityQuestRes Handle(GameClient client, C2SQuestSe
continue;
}
var quest = QuestManager.GetQuestByScheduleId(questScheduleId);
if (quest == null)
{
Logger.Error(client, $"No quest object exists for ${questScheduleId}");
continue;
}

var questStateManager = QuestManager.GetQuestStateManager(client, quest);
if (questStateManager == null)
{
Logger.Error(client, $"Unable to fetch the quest state manager for ${questScheduleId}");
continue;
}

var questState = questStateManager.GetQuestState(questScheduleId);
if (questState == null)
{
Logger.Error(client, $"Failed to find quest state for ${questScheduleId}");
continue;
}
ntc.PriorityQuestList.Add(quest.ToCDataPriorityQuest(questState?.Step ?? 0));
}

Expand Down
2 changes: 1 addition & 1 deletion Arrowgene.Ddon.GameServer/Handler/WarpWarpStartHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public WarpWarpStartHandler(DdonGameServer server) : base(server)

public override void Handle(GameClient client, StructurePacket<C2SWarpWarpStartNtc> packet)
{
if(client.LastWarpPointId != 0 && (client.Party?.GetPlayerPartyMember(client).IsLeader ?? false))
if(client.LastWarpPointId != 0 && (client.Party?.GetPlayerPartyMember(client)?.IsLeader ?? false))
{
S2CWarpLeaderWarpNtc ntc = new S2CWarpLeaderWarpNtc()
{
Expand Down

0 comments on commit a6bb65b

Please sign in to comment.