From 8438ad4513e9aa2af4b42317aa05358e36f06e98 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 13 Dec 2014 23:35:11 +0300 Subject: Move processPartyInvited from ea namespace into eathena and tmwa. --- src/net/tmwa/partyhandler.cpp | 20 ++++++++++++++++++++ src/net/tmwa/partyhandler.h | 2 ++ 2 files changed, 22 insertions(+) (limited to 'src/net/tmwa') diff --git a/src/net/tmwa/partyhandler.cpp b/src/net/tmwa/partyhandler.cpp index 7cf5cef3e..5762503c7 100644 --- a/src/net/tmwa/partyhandler.cpp +++ b/src/net/tmwa/partyhandler.cpp @@ -383,4 +383,24 @@ void PartyHandler::allowInvite(const bool allow A_UNUSED) const { } +void PartyHandler::processPartyInvited(Net::MessageIn &msg) +{ + const int id = msg.readInt32("account id"); + const std::string partyName = msg.readString(24, "party name"); + std::string nick; + + if (actorManager) + { + const Being *const being = actorManager->findBeing(id); + if (being) + { + if (being->getType() == ActorType::Player) + nick = being->getName(); + } + } + + if (socialWindow) + socialWindow->showPartyInvite(partyName, nick); +} + } // namespace TmwAthena diff --git a/src/net/tmwa/partyhandler.h b/src/net/tmwa/partyhandler.h index a6fdfdddf..a29f03718 100644 --- a/src/net/tmwa/partyhandler.h +++ b/src/net/tmwa/partyhandler.h @@ -73,6 +73,8 @@ class PartyHandler final : public MessageHandler, public Ea::PartyHandler static void processPartyMessage(Net::MessageIn &msg); static void processPartyInviteResponse(Net::MessageIn &msg); + + static void processPartyInvited(Net::MessageIn &msg); }; } // namespace TmwAthena -- cgit v1.2.3-70-g09d2