summaryrefslogtreecommitdiff
path: root/src/net/ea
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/ea')
-rw-r--r--src/net/ea/playerhandler.cpp12
-rw-r--r--src/net/ea/playerhandler.h2
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