mirror of
https://github.com/sebastian-heinz/Arrowgene.DragonsDogmaOnline
synced 2026-08-03 11:12:41 -04:00
* Fix bug where appraising certain items in BBM while you had a copy of that item in your regular character's storage chest would throw an error. Fix bugs where SQLite would occasionally have a DB lock conflict due to poor connection management. * Be more aggressive when clearing out invalid priority quests. * Fix bug where the Beauty Shop would sometimes complain about PRICE_NO_MATCH when trying to pay with Silver Tickets. * Fix bugs where pawn search wouldn't display craft levels, and didn't support filtering by craft level. * Migrate 58 > 59. Store character_id in the connections table so we can use it for player tracking. Adjust player tracking to be driven by the DB. * Fix bugs where bazaar processes could sometimes delete items if the storage was full. * Add feature where you can sell special items (like PP crystals) to consume them, instead of having to spam use them. * Fix bug where deleting pawns would badly mangle the equipment entries of other pawns owned by the same character. * Add support for LightQuestRepeatsPerDay, limiting the number of times a board quest can be offered to a single player per day. * Research for EquipStatId. * Maybe fix bug where base game augments were secretly applying even in BBM? Maybe fix bug where certain alt-pallet skills wouldn't work in multiplayer due to missing context information. * Update database migration version. * Automatically promote localhost players to admin when running in debug mode. Adjust /finishquesttype to clear progress when finishing quests. * Fix bug where hired pawns wearing job emblems weren't benefiting from the stats on them. Hired pawns now reflect the hiring character's job emblems entirely.
73 lines
3.3 KiB
C#
73 lines
3.3 KiB
C#
using Arrowgene.Ddon.GameServer.Characters;
|
|
using Arrowgene.Ddon.Server;
|
|
using Arrowgene.Ddon.Shared.Entity.PacketStructure;
|
|
using Arrowgene.Ddon.Shared.Entity.Structure;
|
|
using Arrowgene.Ddon.Shared.Model;
|
|
using Arrowgene.Logging;
|
|
|
|
namespace Arrowgene.Ddon.GameServer.Handler
|
|
{
|
|
public class QuestGetPriorityQuestHandler : GameRequestPacketHandler<C2SQuestGetPriorityQuestReq, S2CQuestGetPriorityQuestRes>
|
|
{
|
|
private static readonly ServerLogger Logger = LogProvider.Logger<ServerLogger>(typeof(QuestGetPriorityQuestHandler));
|
|
|
|
|
|
public QuestGetPriorityQuestHandler(DdonGameServer server) : base(server)
|
|
{
|
|
}
|
|
|
|
public override S2CQuestGetPriorityQuestRes Handle(GameClient client, C2SQuestGetPriorityQuestReq request)
|
|
{
|
|
S2CQuestGetPriorityQuestRes res = new S2CQuestGetPriorityQuestRes();
|
|
|
|
Character partyLeader = client.Party.Leader?.Client.Character ?? client.Character;
|
|
CDataPriorityQuestSetting setting = new CDataPriorityQuestSetting();
|
|
setting.CharacterId = partyLeader.CharacterId;
|
|
|
|
Server.Database.ExecuteInTransaction(connection =>
|
|
{
|
|
var priorityQuestScheduleIds = Server.Database.GetPriorityQuestScheduleIds(partyLeader.CommonId, connection);
|
|
foreach (var questScheduleId in priorityQuestScheduleIds)
|
|
{
|
|
if (!QuestManager.IsQuestEnabled(questScheduleId))
|
|
{
|
|
Logger.Error(client, $"Priority quest for quest state which doesn't exist or is not enabled, schedule {questScheduleId}");
|
|
Server.Database.DeletePriorityQuest(client.Character.CommonId, questScheduleId, connection);
|
|
continue;
|
|
}
|
|
|
|
var quest = QuestManager.GetQuestByScheduleId(questScheduleId);
|
|
if (quest == null)
|
|
{
|
|
Logger.Error(client, $"No quest object exists for {questScheduleId}");
|
|
Server.Database.DeletePriorityQuest(client.Character.CommonId, questScheduleId, connection);
|
|
continue;
|
|
}
|
|
|
|
var questStateManager = QuestManager.GetQuestStateManager(client, quest);
|
|
if (questStateManager == null)
|
|
{
|
|
Logger.Error(client, $"Unable to fetch the quest state manager for {questScheduleId}");
|
|
Server.Database.DeletePriorityQuest(client.Character.CommonId, questScheduleId, connection);
|
|
continue;
|
|
}
|
|
|
|
var questState = questStateManager.GetQuestState(questScheduleId);
|
|
if (questState == null)
|
|
{
|
|
Logger.Error(client, $"Failed to find quest state for {questScheduleId}");
|
|
Server.Database.DeletePriorityQuest(client.Character.CommonId, questScheduleId, connection);
|
|
continue;
|
|
}
|
|
|
|
setting.PriorityQuestList.Add(quest.ToCDataPriorityQuest(questState?.Step ?? 0));
|
|
}
|
|
});
|
|
|
|
|
|
res.PriorityQuestSettingsList.Add(setting);
|
|
|
|
return res;
|
|
}
|
|
}
|
|
}
|