From fde614c1e6e944b4805e7e6a89689b9d546330ad Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 30 Nov 2014 18:28:12 +0300 Subject: eathena: add packet SMSG_MAP_MUSIC 0x0b05. --- src/net/ea/playerhandler.cpp | 12 ++++++++++++ src/net/ea/playerhandler.h | 2 ++ 2 files changed, 14 insertions(+) (limited to 'src/net/ea') diff --git a/src/net/ea/playerhandler.cpp b/src/net/ea/playerhandler.cpp index 8fd63a641..baea3b1e6 100644 --- a/src/net/ea/playerhandler.cpp +++ b/src/net/ea/playerhandler.cpp @@ -26,6 +26,7 @@ #include "game.h" #include "party.h" #include "notifymanager.h" +#include "soundmanager.h" #include "units.h" #include "being/attributes.h" @@ -532,4 +533,15 @@ void PlayerHandler::processMapMask(Net::MessageIn &msg) map->setMask(mask); } +void PlayerHandler::processMapMusic(Net::MessageIn &msg) +{ + const int size = msg.readInt16("len") - 5; + const std::string music = msg.readString(size, "name"); + soundManager.playMusic(music); + + Map *const map = viewport->getMap(); + if (map) + map->setMusicFile(music); +} + } // namespace Ea diff --git a/src/net/ea/playerhandler.h b/src/net/ea/playerhandler.h index 211baab2e..44510d573 100644 --- a/src/net/ea/playerhandler.h +++ b/src/net/ea/playerhandler.h @@ -74,6 +74,8 @@ class PlayerHandler notfinal : public Net::PlayerHandler static void processPlayerArrowMessage(Net::MessageIn &msg); static void processMapMask(Net::MessageIn &msg); + + static void processMapMusic(Net::MessageIn &msg); }; } // namespace Ea -- cgit v1.2.3-70-g09d2