Revert "fix: friends not updating and using incorrect world (#1724)"

This reverts commit 23551d4ed8cc53ac0835a85ce871b2e529979ee9.
This commit is contained in:
David Markowitz 2025-01-07 18:45:40 -08:00
parent 23551d4ed8
commit b173d7069e
3 changed files with 24 additions and 26 deletions

View File

@ -29,6 +29,7 @@ void ChatPacketHandler::HandleFriendlistRequest(Packet* packet) {
auto& player = Game::playerContainer.GetPlayerDataMutable(playerID); auto& player = Game::playerContainer.GetPlayerDataMutable(playerID);
if (!player) return; if (!player) return;
if (player.friends.empty()) {
auto friendsList = Database::Get()->GetFriendsList(playerID); auto friendsList = Database::Get()->GetFriendsList(playerID);
for (const auto& friendData : friendsList) { for (const auto& friendData : friendsList) {
FriendData fd; FriendData fd;
@ -49,7 +50,7 @@ void ChatPacketHandler::HandleFriendlistRequest(Packet* packet) {
fd.zoneID = fr.zoneID; fd.zoneID = fr.zoneID;
//Since this friend is online, we need to update them on the fact that we've just logged in: //Since this friend is online, we need to update them on the fact that we've just logged in:
if (player.isLogin) SendFriendUpdate(fr, player, 1, fd.isBestFriend); SendFriendUpdate(fr, player, 1, fd.isBestFriend);
} else { } else {
fd.isOnline = false; fd.isOnline = false;
fd.zoneID = LWOZONEID(); fd.zoneID = LWOZONEID();
@ -57,6 +58,7 @@ void ChatPacketHandler::HandleFriendlistRequest(Packet* packet) {
player.friends.push_back(fd); player.friends.push_back(fd);
} }
}
//Now, we need to send the friendlist to the server they came from: //Now, we need to send the friendlist to the server they came from:
CBITSTREAM; CBITSTREAM;

View File

@ -32,10 +32,7 @@ void PlayerContainer::InsertPlayer(Packet* packet) {
return; return;
} }
auto isLogin = !m_Players.contains(playerId);
auto& data = m_Players[playerId]; auto& data = m_Players[playerId];
data = PlayerData();
data.isLogin = isLogin;
data.playerID = playerId; data.playerID = playerId;
uint32_t len; uint32_t len;

View File

@ -46,7 +46,6 @@ struct PlayerData {
std::vector<IgnoreData> ignoredPlayers; std::vector<IgnoreData> ignoredPlayers;
eGameMasterLevel gmLevel = static_cast<eGameMasterLevel>(0); // CIVILLIAN eGameMasterLevel gmLevel = static_cast<eGameMasterLevel>(0); // CIVILLIAN
bool isFTP = false; bool isFTP = false;
bool isLogin = false;
}; };
struct TeamData { struct TeamData {