aboutsummaryrefslogtreecommitdiff
path: root/src/packet_distribution.cpp
diff options
context:
space:
mode:
authorCrystalwarrior <varsash@gmail.com>2019-09-11 00:49:30 +0300
committerCrystalwarrior <varsash@gmail.com>2019-09-11 00:49:30 +0300
commitc2fd3796a97ee8d87544ec26df7d6797acfebd80 (patch)
treec4326c770d821c4cd5f14961e7acf3f62a3b09c1 /src/packet_distribution.cpp
parent961563daf3af7fd0167b281ed101d11c67a4eaf7 (diff)
Add clear_music and clear_areas
Comment out the index as it can be potentially confusing alongside "true" area numbers Add "FM" to Packet Received that would reload the areas and music list TODO: Test this with arup systems
Diffstat (limited to 'src/packet_distribution.cpp')
-rw-r--r--src/packet_distribution.cpp42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/packet_distribution.cpp b/src/packet_distribution.cpp
index 40015fda..cfd6d8c6 100644
--- a/src/packet_distribution.cpp
+++ b/src/packet_distribution.cpp
@@ -525,6 +525,48 @@ void AOApplication::server_packet_received(AOPacket *p_packet)
send_server_packet(new AOPacket("RD#%"));
}
+ else if (header == "FM")
+ {
+ if (!courtroom_constructed)
+ goto end;
+
+ w_courtroom->clear_music();
+ w_courtroom->clear_areas();
+
+ bool musics_time = false;
+ int areas = 0;
+
+ for (int n_element = 0 ; n_element < f_contents.size() ; ++n_element)
+ {
+ if (musics_time)
+ {
+ w_courtroom->append_music(f_contents.at(n_element));
+ }
+ else
+ {
+ if (f_contents.at(n_element).endsWith(".wav") ||
+ f_contents.at(n_element).endsWith(".mp3") ||
+ f_contents.at(n_element).endsWith(".mp4") ||
+ f_contents.at(n_element).endsWith(".ogg") ||
+ f_contents.at(n_element).endsWith(".opus"))
+ {
+ musics_time = true;
+ w_courtroom->fix_last_area();
+ w_courtroom->append_music(f_contents.at(n_element));
+ areas--;
+// qDebug() << "wtf!!" << f_contents.at(n_element);
+ }
+ else
+ {
+ w_courtroom->append_area(f_contents.at(n_element));
+ areas++;
+ }
+ }
+ }
+
+ w_courtroom->list_music();
+ w_courtroom->list_areas();
+ }
else if (header == "DONE")
{
if (!courtroom_constructed)