ddon-server/Arrowgene.Ddon.GameServer/Handler/QuestPlayInterruptHandler.cs
Paul Campbell 4ebb97a4c0 enhancement: Handle multiple group edgecases
- Created a new class UniqueIdPool to help with creating a pool of
  reusable 32bit IDs.
- Created a new class TimerManager to help with generically using timers
  across the code base.
- Added a timeout to board recruitment.
- Added a timeout to board ready up.
- Added the ability to kick a member from the entry board.
- Added the ability to extend the ready up time.
- Enhanced the vote to abandon content mechanism such that it will
  approve or reject the vote as soon as all members have voted.
- Found the proper NTC to end the group content.
- Synced timers shown in various UI elements so that they closer match
  the actual timer on the server.
- Refactored existing classes to use new UniqueIdPool and TimerManager
  classes.
2024-09-17 17:37:31 -04:00

39 lines
1.4 KiB
C#

using Arrowgene.Ddon.Server;
using Arrowgene.Ddon.Shared.Entity.PacketStructure;
using Arrowgene.Ddon.Shared.Model;
using Arrowgene.Logging;
namespace Arrowgene.Ddon.GameServer.Handler
{
public class QuestPlayInterruptHandler : GameRequestPacketHandler<C2SQuestPlayInterruptReq, S2CQuestPlayInterruptRes>
{
private static readonly ServerLogger Logger = LogProvider.Logger<ServerLogger>(typeof(QuestPlayEntryHandler));
public QuestPlayInterruptHandler(DdonGameServer server) : base(server)
{
}
public override S2CQuestPlayInterruptRes Handle(GameClient client, C2SQuestPlayInterruptReq request)
{
if (client.Party.Clients.Count > 1)
{
Server.PartyQuestContentManager.InitatePartyAbandonVote(client, client.Party, 60);
Server.PartyQuestContentManager.VoteToAbandon(client.Character, client.Party.Id, VoteAnswer.Agree);
client.Party.SendToAllExcept(new S2CQuestPlayInterruptNtc()
{
CharacterId = client.Character.CharacterId,
DeadlineSec = 60
}, client);
}
else
{
client.Party.SendToAll(new S2CQuestPlayInterruptAnswerNtc() { IsInterrupt = true });
}
return new S2CQuestPlayInterruptRes()
{
DeadlineSec = 60
};
}
}
}