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:
Aaron Kimbrell
2026-09-27 08:38:39 -05:00
parent 71ecd3737c
commit c269affddf
7 changed files with 78 additions and 1 deletions

View File

@@ -623,6 +623,11 @@ namespace {
Game::server->Send(bitStream, sysAddr, false); //send routed packet to player
});
// New mail for a player the chat server says is in this world
handlers.On<ChatPackets::MailNotify>(MessageType::Chat::MAIL, [](const ChatPackets::MailNotify& notify, const SystemAddress&) {
Mail::NotifyNewMailHere(notify.receiverID);
});
handlers.On<ChatPackets::Announcement>(MessageType::Chat::GM_ANNOUNCE, [](const ChatPackets::Announcement& announcement, const SystemAddress&) {
//Send to our clients:
AMFArrayValue args;