mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-07 21:33:43 +00:00
feat(mail): notify online recipients of new mail on any world
Mail sent to someone who is not in the sender's world (system mail with no address, and all player-to-player mail) now reaches them: the world sends a MailNotify (Chat::MAIL, unused until now) to the chat server, which passes it to the world the receiver is in, and that world sends the client its unread count with a NewMail NotificationResponse. Receivers in the same world are told directly. Player-to-player mail did not notify the receiver at all before. Replaces the TODO in Mail::SendMail. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -168,6 +168,15 @@ namespace ChatPackets {
|
||||
return true;
|
||||
}
|
||||
|
||||
void MailNotify::Serialize(RakNet::BitStream& bitStream) const {
|
||||
bitStream.Write(receiverID);
|
||||
}
|
||||
|
||||
bool MailNotify::Deserialize(RakNet::BitStream& bitStream) {
|
||||
VALIDATE_READ(bitStream.Read(receiverID));
|
||||
return true;
|
||||
}
|
||||
|
||||
void ShowAllRequest::Serialize(RakNet::BitStream& bitStream) const {
|
||||
bitStream.Write(requestor);
|
||||
bitStream.Write(displayZoneData);
|
||||
|
||||
@@ -126,6 +126,15 @@ namespace ChatPackets {
|
||||
bool Deserialize(RakNet::BitStream& bitStream) override;
|
||||
};
|
||||
|
||||
// World -> chat -> world: receiverID has new mail. DLU's own server packet: the chat server passes it on to the world
|
||||
// the receiver is in, which sends them the new-mail notification. Characters that are offline are skipped.
|
||||
struct MailNotify : public LUBitStream {
|
||||
LWOOBJID receiverID{ LWOOBJID_EMPTY };
|
||||
MailNotify() : LUBitStream(ServiceType::CHAT, MessageType::Chat::MAIL) {}
|
||||
void Serialize(RakNet::BitStream& bitStream) const override;
|
||||
bool Deserialize(RakNet::BitStream& bitStream) override;
|
||||
};
|
||||
|
||||
// World -> chat: /showall
|
||||
struct ShowAllRequest : public LUBitStream {
|
||||
LWOOBJID requestor = LWOOBJID_EMPTY;
|
||||
|
||||
Reference in New Issue
Block a user