diff --git a/src/aoclient.cpp b/src/aoclient.cpp index 71ffe0a..16bd350 100644 --- a/src/aoclient.cpp +++ b/src/aoclient.cpp @@ -140,11 +140,11 @@ void AOClient::changeArea(int new_area) for (QTimer* timer : server->areas[current_area]->timers) { int timer_id = server->areas[current_area]->timers.indexOf(timer) + 1; if (timer->isActive()) { - sendPacket("TI", {QString::number(timer_id), QString::number(2)}); - sendPacket("TI", {QString::number(timer_id), QString::number(0), QString::number(QTime(0,0).msecsTo(QTime(0,0).addMSecs(timer->remainingTime())))}); + sendPacket("TI", {QString::number(timer_id), "2"}); + sendPacket("TI", {QString::number(timer_id), "0", QString::number(QTime(0,0).msecsTo(QTime(0,0).addMSecs(timer->remainingTime())))}); } else { - sendPacket("TI", {QString::number(timer_id), QString::number(3)}); + sendPacket("TI", {QString::number(timer_id), "3"}); } } sendServerMessage("You moved to area " + server->area_names[current_area]); @@ -180,24 +180,6 @@ void AOClient::changeCharacter(int char_id) server->updateCharsTaken(area); sendPacket("PV", {QString::number(id), "CID", QString::number(char_id)}); - fullArup(); - if (server->timer->isActive()) { - sendPacket("TI", {"0", "2"}); - sendPacket("TI", {"0", "0", QString::number(QTime(0,0).msecsTo(QTime(0,0).addMSecs(server->timer->remainingTime())))}); - } - else { - sendPacket("TI", {"0", "3"}); - } - for (QTimer* timer : area->timers) { - int timer_id = area->timers.indexOf(timer) + 1; - if (timer->isActive()) { - sendPacket("TI", {QString::number(timer_id), "2"}); - sendPacket("TI", {QString::number(timer_id), "0", QString::number(QTime(0,0).msecsTo(QTime(0,0).addMSecs(timer->remainingTime())))}); - } - else { - sendPacket("TI", {QString::number(timer_id), "3"}); - } - } } void AOClient::changePosition(QString new_pos) diff --git a/src/packets.cpp b/src/packets.cpp index cabbb8c..d52f23e 100644 --- a/src/packets.cpp +++ b/src/packets.cpp @@ -102,7 +102,7 @@ void AOClient::pktLoadingDone(AreaData* area, int argc, QStringList argv, AOPack area->player_count++; joined = true; server->updateCharsTaken(area); - fullArup(); // Give client all the area data + arup(ARUPType::PLAYER_COUNT, true); // Tell everyone there is a new player sendEvidenceList(area); @@ -112,6 +112,25 @@ void AOClient::pktLoadingDone(AreaData* area, int argc, QStringList argv, AOPack sendPacket("BN", {area->background}); sendPacket("OPPASS", {"DEADBEEF"}); sendPacket("DONE"); + + fullArup(); // Give client all the area data + if (server->timer->isActive()) { + sendPacket("TI", {"0", "2"}); + sendPacket("TI", {"0", "0", QString::number(QTime(0,0).msecsTo(QTime(0,0).addMSecs(server->timer->remainingTime())))}); + } + else { + sendPacket("TI", {"0", "3"}); + } + for (QTimer* timer : area->timers) { + int timer_id = area->timers.indexOf(timer) + 1; + if (timer->isActive()) { + sendPacket("TI", {QString::number(timer_id), "2"}); + sendPacket("TI", {QString::number(timer_id), "0", QString::number(QTime(0,0).msecsTo(QTime(0,0).addMSecs(timer->remainingTime())))}); + } + else { + sendPacket("TI", {QString::number(timer_id), "3"}); + } + } } void AOClient::pktCharPassword(AreaData* area, int argc, QStringList argv, AOPacket packet)