aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/courtroom.h1
-rw-r--r--src/packet_distribution.cpp51
2 files changed, 6 insertions, 46 deletions
diff --git a/include/courtroom.h b/include/courtroom.h
index ec0fa5c..74374c9 100644
--- a/include/courtroom.h
+++ b/include/courtroom.h
@@ -79,7 +79,6 @@ public:
void append_area(QString f_area){area_list.append(f_area);}
void clear_music(){music_list.clear();}
void clear_areas(){area_list.clear();}
- void fix_last_area()
void handle_failed_login();
QString threading_sfx = "";
QString threading_shake = "";
diff --git a/src/packet_distribution.cpp b/src/packet_distribution.cpp
index c381278..b14cd57 100644
--- a/src/packet_distribution.cpp
+++ b/src/packet_distribution.cpp
@@ -515,11 +515,14 @@ void AOApplication::server_packet_received(AOPacket *p_packet)
send_server_packet(new AOPacket("RM#%"));
}
- else if (header == "SM")
+ else if (header == "SM" || header == "FM")
{
if (!courtroom_constructed)
goto end;
+ w_courtroom->clear_music();
+ w_courtroom->clear_areas();
+
bool musiclist_start = false;
area_count = 0;
@@ -543,50 +546,8 @@ void AOApplication::server_packet_received(AOPacket *p_packet)
}
}
QThreadPool::globalInstance()->waitForDone();
-
- 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();
+ if (header == "SM")
+ send_server_packet(new AOPacket("RD#%"));
}
else if (header == "DONE")
{