} while (msg.hasPlayerListMessage());
assertTrue(msg.hasPlayerInfoReplyMessage() && msg.getMessageType() == PokerTHMessageType.Type_PlayerInfoReplyMessage);
PlayerInfoReplyMessage reply = msg.getPlayerInfoReplyMessage();
assertTrue(reply.getPlayerId() == firstPlayerId);
assertTrue(reply.hasPlayerInfoData());
PlayerInfoData info = reply.getPlayerInfoData();
assertEquals(GuestUser, info.getPlayerName());
assertFalse(info.hasCountryCode());
assertTrue(info.getIsHuman());
assertEquals(NetPlayerInfoRights.netPlayerRightsGuest, info.getPlayerRights());
assertFalse(info.hasAvatarData());
}
// Request other players' info (one request containing 9 queries).
Collection<Integer> tmpList = new ArrayList<Integer>();
for (Integer id : playerId) { tmpList.add(id); }
sendPlayerInfoRequest(sock, tmpList);
for (int i = 0; i < 9; i++) {
do {
msg = receiveMessage();
} while (msg.hasPlayerListMessage());
assertTrue(msg.hasPlayerInfoReplyMessage() && msg.getMessageType() == PokerTHMessageType.Type_PlayerInfoReplyMessage);
PlayerInfoReplyMessage reply = msg.getPlayerInfoReplyMessage();
assertTrue(reply.getPlayerId() == playerId[i]);
assertTrue(reply.hasPlayerInfoData());
PlayerInfoData info = reply.getPlayerInfoData();
assertEquals("test" + (i+1), info.getPlayerName());
assertFalse(info.hasCountryCode());
assertTrue(info.getIsHuman());
assertEquals(NetPlayerInfoRights.netPlayerRightsNormal, info.getPlayerRights());
// Every second player has an avatar, see above.
if (i % 2 == 0) {
assertFalse(info.hasAvatarData());
} else {
assertTrue(info.hasAvatarData());
assertTrue(Arrays.equals(info.getAvatarData().getAvatarHash().toByteArray(), avatarHash));
assertEquals(NetAvatarType.netAvatarImagePng, info.getAvatarData().getAvatarType());
}
}
// Request invalid player info.
sendPlayerInfoRequest(sock, maxPlayerId + 1);
msg = receiveMessage();