mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-02 02:43:44 +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:
@@ -898,3 +898,12 @@ TEST_F(ChatPacketsTests, AchievementNotifyRoundTrips) {
|
||||
EXPECT_EQ(copy.targetPlayerName.string, u"Friend");
|
||||
ExpectTruncatedFails(notify);
|
||||
}
|
||||
|
||||
// DLU's own world -> chat -> world new-mail notice: header (chat service, MAIL) and the receiver's object ID.
|
||||
TEST_F(ChatPacketsTests, MailNotifyRoundTrips) {
|
||||
ChatPackets::MailNotify notify;
|
||||
notify.receiverID = 0x1000000000000042LL;
|
||||
EXPECT_PACKET_EQ(FromHex("53 02 00 24 00 00 00 00 42 00 00 00 00 00 00 10"), StructPacket(notify));
|
||||
EXPECT_EQ(RoundTrip(notify).receiverID, notify.receiverID);
|
||||
ExpectTruncatedFails(notify);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user