From e7b0eec60bdd4b2a6cd33077c069e90a1aab7ad3 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 19 Mar 2016 23:28:10 +0300 Subject: Impliment packet SMSG_FAMILY_CALL_PARTNER (hercules). --- src/enums/resources/notifytypes.h | 2 ++ src/net/eathena/familyrecv.cpp | 13 +++++++++++-- src/resources/notifications.h | 8 ++++++++ 3 files changed, 21 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/enums/resources/notifytypes.h b/src/enums/resources/notifytypes.h index e5f465428..84f875c91 100644 --- a/src/enums/resources/notifytypes.h +++ b/src/enums/resources/notifytypes.h @@ -220,6 +220,8 @@ namespace NotifyTypes BEING_REMOVE_TRICK_DEAD, BEING_REMOVE_UNKNOWN, DIVORCED, + CALLED_PARTNER, + CALLING_PARTNER, TYPE_END }; diff --git a/src/net/eathena/familyrecv.cpp b/src/net/eathena/familyrecv.cpp index 5a689bb67..995c00a8b 100644 --- a/src/net/eathena/familyrecv.cpp +++ b/src/net/eathena/familyrecv.cpp @@ -23,6 +23,8 @@ #include "logger.h" #include "notifymanager.h" +#include "being/localplayer.h" + #include "enums/resources/notifytypes.h" #include "net/messagein.h" @@ -48,8 +50,15 @@ void FamilyRecv::processAskForChild(Net::MessageIn &msg) void FamilyRecv::processCallPartner(Net::MessageIn &msg) { - UNIMPLIMENTEDPACKET; - msg.readString(24, "name"); + const std::string name = msg.readString(24, "name"); + if (localPlayer && name == localPlayer->getName()) + { + NotifyManager::notify(NotifyTypes::CALLED_PARTNER); + } + else + { + NotifyManager::notify(NotifyTypes::CALLING_PARTNER, name.c_str()); + } } void FamilyRecv::processDivorced(Net::MessageIn &msg) diff --git a/src/resources/notifications.h b/src/resources/notifications.h index abb5efe56..e726e8093 100644 --- a/src/resources/notifications.h +++ b/src/resources/notifications.h @@ -795,6 +795,14 @@ namespace NotifyManager // TRANSLATORS: notification message N_("You and %s was divorced."), NotifyFlags::STRING}, + {"partner called", + // TRANSLATORS: notification message + N_("You was called by partner."), + NotifyFlags::EMPTY}, + {"partner calling", + // TRANSLATORS: notification message + N_("You calling partner %s."), + NotifyFlags::STRING}, }; } // namespace NotifyManager #endif // RESOURCES_NOTIFICATIONS_H -- cgit v1.2.3-70-g09d2