diff --git a/src/area_data.cpp b/src/area_data.cpp index 83bfc38..b03500d 100644 --- a/src/area_data.cpp +++ b/src/area_data.cpp @@ -19,7 +19,9 @@ AreaData::AreaData(QString p_name, int p_index) { - name = p_name; + QStringList name_split = p_name.split(":"); + name_split.removeFirst(); + name = name_split.join(":"); index = p_index; QSettings areas_ini("config/areas.ini", QSettings::IniFormat); areas_ini.beginGroup(p_name); diff --git a/src/packets.cpp b/src/packets.cpp index 9931391..421688f 100644 --- a/src/packets.cpp +++ b/src/packets.cpp @@ -109,9 +109,9 @@ void AOClient::pktLoadingDone(AreaData* area, int argc, QStringList argv, AOPack sendPacket("HP", {"1", QString::number(area->def_hp)}); sendPacket("HP", {"2", QString::number(area->pro_hp)}); sendPacket("FA", server->area_names); - sendPacket("BN", {area->background}); sendPacket("OPPASS", {"DEADBEEF"}); sendPacket("DONE"); + sendPacket("BN", {area->background}); sendServerMessage("=== MOTD ===\r\n" + server->MOTD + "\r\n============="); diff --git a/src/server.cpp b/src/server.cpp index 64a9ea0..35d0281 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -84,6 +84,7 @@ void Server::start() area_names = areas_ini.childGroups(); // invisibly does a lexicographical sort, because Qt is great like that std::sort(area_names.begin(), area_names.end(), [] (const QString &a, const QString &b) {return a.split(":")[0].toInt() < b.split(":")[0].toInt();}); QStringList sanitized_area_names; + QStringList raw_area_names = area_names; for (QString area_name : area_names) { QStringList name_split = area_name.split(":"); name_split.removeFirst(); @@ -91,8 +92,8 @@ void Server::start() sanitized_area_names.append(area_name_sanitized); } area_names = sanitized_area_names; - for (int i = 0; i < area_names.length(); i++) { - QString area_name = area_names[i]; + for (int i = 0; i < raw_area_names.length(); i++) { + QString area_name = raw_area_names[i]; areas.insert(i, new AreaData(area_name, i)); } }