From 06aebc1f81b8919106d49faa219cdc1aa9c223b2 Mon Sep 17 00:00:00 2001 From: Salanto <62221668+Salanto@users.noreply.github.com> Date: Mon, 14 Mar 2022 18:44:40 +0100 Subject: [PATCH 1/2] Actually play song on join --- core/src/packets.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/packets.cpp b/core/src/packets.cpp index 2520173..03612c8 100644 --- a/core/src/packets.cpp +++ b/core/src/packets.cpp @@ -133,8 +133,6 @@ void AOClient::pktLoadingDone(AreaData* area, int argc, QStringList argv, AOPack } server->m_player_count++; - emit server->updatePlayerCount(server->m_player_count); - area->clientJoinedArea(-1, m_id); m_joined = true; server->updateCharsTaken(area); @@ -169,6 +167,8 @@ void AOClient::pktLoadingDone(AreaData* area, int argc, QStringList argv, AOPack sendPacket("TI", {QString::number(l_timer_id), "3"}); } } + emit server->updatePlayerCount(server->m_player_count); + area->clientJoinedArea(-1, m_id); } void AOClient::pktCharPassword(AreaData* area, int argc, QStringList argv, AOPacket packet) From 601fa10f4fe86d10567f3ec7e87a8155539e641b Mon Sep 17 00:00:00 2001 From: Salanto <62221668+Salanto@users.noreply.github.com> Date: Mon, 14 Mar 2022 18:45:22 +0100 Subject: [PATCH 2/2] Move arup below updating playercount. --- core/src/packets.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/core/src/packets.cpp b/core/src/packets.cpp index 03612c8..3e962ca 100644 --- a/core/src/packets.cpp +++ b/core/src/packets.cpp @@ -135,10 +135,7 @@ void AOClient::pktLoadingDone(AreaData* area, int argc, QStringList argv, AOPack server->m_player_count++; m_joined = true; server->updateCharsTaken(area); - - arup(ARUPType::PLAYER_COUNT, true); // Tell everyone there is a new player sendEvidenceList(area); - sendPacket("HP", {"1", QString::number(area->defHP())}); sendPacket("HP", {"2", QString::number(area->proHP())}); sendPacket("FA", server->m_area_names); @@ -169,6 +166,7 @@ void AOClient::pktLoadingDone(AreaData* area, int argc, QStringList argv, AOPack } emit server->updatePlayerCount(server->m_player_count); area->clientJoinedArea(-1, m_id); + arup(ARUPType::PLAYER_COUNT, true); // Tell everyone there is a new player } void AOClient::pktCharPassword(AreaData* area, int argc, QStringList argv, AOPacket packet)