Implementing player list for new lobby chat.

This commit is contained in:
lotodore
2009-08-15 22:20:19 +00:00
parent 51d8883e88
commit a380497bc2
6 changed files with 48 additions and 8 deletions
+16 -5
View File
@@ -730,7 +730,6 @@ AbstractClientStateReceiving::HandlePacket(boost::shared_ptr<ClientThread> clien
if (netInfo->avatarData != NULL)
{
tmpInfo.hasAvatar = true;
// TODO: use sha1.
memcpy(tmpInfo.avatar.data, netInfo->avatarData->avatar.buf, MD5_DATA_SIZE);
tmpInfo.avatarType = (AvatarFileType)netInfo->avatarData->avatarType;
}
@@ -840,11 +839,23 @@ AbstractClientStateReceiving::HandlePacket(boost::shared_ptr<ClientThread> clien
else if (tmpPacket->GetMsg()->present == PokerTHMessage_PR_playerListMessage)
{
PlayerListMessage_t *netPlayerList = &tmpPacket->GetMsg()->choice.playerListMessage;
PlayerInfo info;
if (!client->GetCachedPlayerInfo(netPlayerList->playerId, info))
if (netPlayerList->playerListNotification == playerListNotification_playerListNew)
{
// Request player info.
client->RequestPlayerInfo(netPlayerList->playerId);
PlayerInfo info;
if (!client->GetCachedPlayerInfo(netPlayerList->playerId, info))
{
// Request player info.
ostringstream name;
name << "#" << netPlayerList->playerId;
info.playerName = name.str();
client->RequestPlayerInfo(netPlayerList->playerId);
}
client->GetCallback().SignalLobbyPlayerJoined(netPlayerList->playerId, info.playerName);
}
else if (netPlayerList->playerListNotification == playerListNotification_playerListLeft)
{
client->GetCallback().SignalLobbyPlayerLeft(netPlayerList->playerId);
}
}
else if (tmpPacket->GetMsg()->present == PokerTHMessage_PR_gameListMessage)