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.
37 lines
1.2 KiB
C#
37 lines
1.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;
|
|
using System;
|
|
|
|
namespace Arrowgene.Ddon.GameServer.Handler
|
|
{
|
|
public class MailMailGetTextHandler : GameRequestPacketHandler<C2SMailMailGetTextReq, S2CMailMailGetTextRes>
|
|
{
|
|
private static readonly ServerLogger Logger = LogProvider.Logger<ServerLogger>(typeof(MailMailGetTextHandler));
|
|
|
|
public MailMailGetTextHandler(DdonGameServer server) : base(server)
|
|
{
|
|
}
|
|
|
|
public override S2CMailMailGetTextRes Handle(GameClient client, C2SMailMailGetTextReq request)
|
|
{
|
|
MailMessage message = new();
|
|
|
|
Server.Database.ExecuteInTransaction(connection =>
|
|
{
|
|
message = Server.Database.SelectMailMessage(request.MailId, connection);
|
|
Server.Database.UpdateMailMessageState(request.MailId, MailState.Opened, connection);
|
|
});
|
|
|
|
var result = new S2CMailMailGetTextRes()
|
|
{
|
|
MailId = request.MailId,
|
|
MailText = message.Body
|
|
};
|
|
|
|
return result;
|
|
}
|
|
}
|
|
}
|