public static void OnQueryRemoveMail(WorldClient client, INetPacketStream packet) { var onQueryRemoveMailPacket = new QueryRemoveMailPacket(packet); var queryRemoveMailEvent = new QueryRemoveMailEventArgs(onQueryRemoveMailPacket.MailId); client.Player.NotifySystem <MailboxSystem>(queryRemoveMailEvent); }
private void RemoveMail(IPlayerEntity player, QueryRemoveMailEventArgs e) { var database = DependencyContainer.Instance.Resolve <IDatabase>(); var mail = database.Mails.Get(x => x.Id == e.MailId && x.ReceiverId == player.PlayerData.Id); if (mail is null) { return; } mail.IsDeleted = true; database.Complete(); WorldPacketFactory.SendRemoveMail(player, mail, RemovedFromMail.Mail); }