From 1781ac6b03eae6673dcefee6f6547e2ad8270ae8 Mon Sep 17 00:00:00 2001 From: gsemaj Date: Tue, 25 Jun 2024 15:21:32 -0700 Subject: [PATCH] Fix delayed loading of nano skill icons We actually don't need to wait for post-load to do the second nano book send. That adds unnecessary delay. Moving it to right after `P_FE2CL_REP_PC_ENTER_SUCC` does the trick and gives the client plenty of time to fetch the icons before loading in-game. --- src/PlayerManager.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/PlayerManager.cpp b/src/PlayerManager.cpp index f1ef7d3..a403838 100644 --- a/src/PlayerManager.cpp +++ b/src/PlayerManager.cpp @@ -293,12 +293,14 @@ static void enterPlayer(CNSocket* sock, CNPacketData* data) { sock->setActiveKey(SOCKETKEY_FE); // send all packets using the FE key from now on // Academy builds receive nanos in a separate packet. These need to be sent - // before P_FE2CL_REP_PC_ENTER_SUCC as well as after initial load + // before P_FE2CL_REP_PC_ENTER_SUCC as well as after // due to a race condition in the client :( sendNanoBookSubset(sock, plr); sock->sendPacket(response, P_FE2CL_REP_PC_ENTER_SUCC); + sendNanoBookSubset(sock, plr); + // transfer ownership of Player object into the shard (still valid in this function though) addPlayer(sock, plr); @@ -375,7 +377,6 @@ static void loadPlayer(CNSocket* sock, CNPacketData* data) { Missions::failInstancedMissions(sock); // auto-fail missions Buddies::sendBuddyList(sock); // buddy list Items::checkItemExpire(sock, plr); // vehicle expiration - sendNanoBookSubset(sock, plr); // nanos (post-load) plr->initialLoadDone = true; }