mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-18 18:52:48 +00:00
Deleting mail in game now sets mail.deleted_at (migrations mysql 95, sqlite 78) instead of removing the row. Every read for the game skips deleted mail: the mailbox, a single mail (claim, read, delete), the unread count, the economy scan of waiting attachments and the UGC lookup of mailed models. Deleting a character still removes its mail. Check: delete a mail in game; it leaves the mailbox, the unread count drops, and the row is still in the mail table with deleted_at set. Parity test: ParitySeeded.Mail (DeleteMail). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
38 lines
1.1 KiB
C++
38 lines
1.1 KiB
C++
#ifndef __IMAIL__H__
|
|
#define __IMAIL__H__
|
|
|
|
#include <cstdint>
|
|
#include <optional>
|
|
#include <string_view>
|
|
|
|
#include "dCommonVars.h"
|
|
#include "NiQuaternion.h"
|
|
#include "NiPoint3.h"
|
|
#include "MailInfo.h"
|
|
|
|
class IMail {
|
|
public:
|
|
// Insert a new mail into the database.
|
|
virtual void InsertNewMail(const MailInfo& mail) = 0;
|
|
|
|
// Get the mail for the given character id. Mail the player deleted is left out (as in every read below).
|
|
virtual std::vector<MailInfo> GetMailForPlayer(const LWOOBJID characterId, const uint32_t numberOfMail) = 0;
|
|
|
|
// Get the mail for the given mail id.
|
|
virtual std::optional<MailInfo> GetMail(const uint64_t mailId) = 0;
|
|
|
|
// Get the number of unread mail for the given character id.
|
|
virtual uint32_t GetUnreadMailCount(const LWOOBJID characterId) = 0;
|
|
|
|
// Mark the given mail as read.
|
|
virtual void MarkMailRead(const uint64_t mailId) = 0;
|
|
|
|
// Claim the item from the given mail.
|
|
virtual void ClaimMailItem(const uint64_t mailId) = 0;
|
|
|
|
// A player deleted the mail: it is marked deleted (deleted_at) and kept for staff, and the game never shows it again.
|
|
virtual void DeleteMail(const uint64_t mailId) = 0;
|
|
};
|
|
|
|
#endif //!__IMAIL__H__
|