diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-11-30 18:28:12 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-11-30 18:28:12 +0300 |
commit | fde614c1e6e944b4805e7e6a89689b9d546330ad (patch) | |
tree | e378b3d2ace8ae88a3eaf0e98657bbd227a748ab /src/net/ea | |
parent | 0af4b6dd0f616564a55447c7ce5318c72f68e590 (diff) | |
download | manaverse-fde614c1e6e944b4805e7e6a89689b9d546330ad.tar.gz manaverse-fde614c1e6e944b4805e7e6a89689b9d546330ad.tar.bz2 manaverse-fde614c1e6e944b4805e7e6a89689b9d546330ad.tar.xz manaverse-fde614c1e6e944b4805e7e6a89689b9d546330ad.zip |
eathena: add packet SMSG_MAP_MUSIC 0x0b05.
Diffstat (limited to 'src/net/ea')
-rw-r--r-- | src/net/ea/playerhandler.cpp | 12 | ||||
-rw-r--r-- | src/net/ea/playerhandler.h | 2 |
2 files changed, 14 insertions, 0 deletions
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 |