mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2024-11-22 21:40:05 +00:00
Fix buddy list not syncing properly
I couldn't reproduce this on my public server, but the list would show up empty sometimes on initial login on my local server, so I threw it in for good measure.
This commit is contained in:
parent
30de5c1734
commit
3f5a9c8811
@ -339,6 +339,15 @@ void BuddyManager::reqBuddyMenuchat(CNSocket* sock, CNPacketData* data) {
|
||||
void BuddyManager::reqPktGetBuddyState(CNSocket* sock, CNPacketData* data) {
|
||||
Player* plr = PlayerManager::getPlayer(sock);
|
||||
|
||||
/*
|
||||
* If the buddy list wasn't synced a second time yet, sync it.
|
||||
* Not sure why we have to do it again for the client not to trip up.
|
||||
*/
|
||||
if (!plr->buddiesSynced) {
|
||||
refreshBuddyList(sock);
|
||||
plr->buddiesSynced = true;
|
||||
}
|
||||
|
||||
INITSTRUCT(sP_FE2CL_REP_GET_BUDDY_STATE_SUCC, resp);
|
||||
|
||||
for (int slot = 0; slot < 50; slot++) {
|
||||
|
@ -71,5 +71,6 @@ struct Player {
|
||||
|
||||
bool notify;
|
||||
|
||||
bool buddiesSynced;
|
||||
int64_t buddyIDs[50];
|
||||
};
|
||||
|
@ -404,7 +404,7 @@ void PlayerManager::enterPlayer(CNSocket* sock, CNPacketData* data) {
|
||||
|
||||
MissionManager::failInstancedMissions(sock);
|
||||
|
||||
// send over buddy list
|
||||
// initial buddy sync
|
||||
BuddyManager::refreshBuddyList(sock);
|
||||
|
||||
for (auto& pair : PlayerManager::players)
|
||||
|
Loading…
Reference in New Issue
Block a user