mirror of
https://github.com/sebastian-heinz/Arrowgene.DragonsDogmaOnline
synced 2026-08-03 11:12:41 -04:00
* Adds packet structures, handlers, and server support for Player Mail, Blacklists, Group Chats and Message Sets. Implements rudimentary GM features via chat command. Adds support for IP Bans and muted players. Simplifies how login stamps are handled. Cleans up and modernizes some old packet handlers. * Rebase. Fix CommandRoute and AccountRoute. Cleanup and response to PR comments. Rearrange some of the schedule_next stuff in the DB creation schema for clarity.
56 lines
2.2 KiB
C#
56 lines
2.2 KiB
C#
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 MailSystemMailGetTextHandler : GameRequestPacketHandler<C2SMailSystemMailGetTextReq, S2CMailSystemMailGetTextRes>
|
|
{
|
|
private static readonly ServerLogger Logger = LogProvider.Logger<ServerLogger>(typeof(MailSystemMailGetTextHandler));
|
|
|
|
public MailSystemMailGetTextHandler(DdonGameServer server) : base(server)
|
|
{
|
|
}
|
|
|
|
public override S2CMailSystemMailGetTextRes Handle(GameClient client, C2SMailSystemMailGetTextReq request)
|
|
{
|
|
var message = Server.Database.SelectSystemMailMessage(request.MailId);
|
|
var attachments = Server.Database.SelectAttachmentsForSystemMail(request.MailId);
|
|
|
|
Server.Database.UpdateSystemMailMessageState(request.MailId, MailState.Opened);
|
|
|
|
var result = new S2CMailSystemMailGetTextRes()
|
|
{
|
|
MailId = request.MailId,
|
|
MailTextInfo = new CDataMailTextInfo()
|
|
{
|
|
Text = message.Body
|
|
}
|
|
};
|
|
|
|
foreach (var attachment in attachments)
|
|
{
|
|
switch (attachment.AttachmentType)
|
|
{
|
|
case SystemMailAttachmentType.Item:
|
|
result.MailTextInfo.MailAttachmentList.ItemList.Add(attachment.ToCDataMailItemInfo());
|
|
break;
|
|
case SystemMailAttachmentType.GP:
|
|
result.MailTextInfo.MailAttachmentList.GPList.Add(attachment.ToCDataMailGPInfo());
|
|
break;
|
|
case SystemMailAttachmentType.Course:
|
|
result.MailTextInfo.MailAttachmentList.OptionCourseList.Add(attachment.ToCDataMailOptionCourseInfo());
|
|
break;
|
|
case SystemMailAttachmentType.PawnLegend:
|
|
result.MailTextInfo.MailAttachmentList.LegendPawnList.Add(attachment.ToCDataMailLegendPawnInfo());
|
|
break;
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
}
|
|
}
|
|
|