else
{
data.writeInt(TeamsManager.getInstance().currentRound.teams.length);
for(int i = 0; i < TeamsManager.getInstance().currentRound.teams.length; i++)
{
Team team = TeamsManager.getInstance().currentRound.teams[i];
if(team == null)
{
writeUTF(data, "none");
continue;
}
writeUTF(data, team.shortName);
data.writeInt(team.score);
data.writeBoolean(TeamsManager.getInstance().currentRound.gametype.teamHasWon(team));
team.sortPlayers();
data.writeInt(team.members.size());
for(int j = 0; j < team.members.size(); j++)
{
String username = team.members.get(j);
PlayerData playerData = PlayerHandler.getPlayerData(username, Side.SERVER);
writeUTF(data, username);
if(playerData == null)
{
data.writeInt(0);
data.writeInt(0);
data.writeInt(0);
writeUTF(data, "");
}
else
{
data.writeInt(playerData.score);
data.writeInt(playerData.zombieScore);
data.writeInt(playerData.kills);
data.writeInt(playerData.deaths);
writeUTF(data, playerData.playerClass.shortName);
}
}
}
}
}
else
{
data.writeBoolean(false);
ArrayList<String> playerNames = new ArrayList<String>();
for(int i = 0; i < TeamsManager.getInstance().currentRound.teams.length; i++)
{
Team team = TeamsManager.getInstance().currentRound.teams[i];
if(team == null || team.members == null)
{
continue;
}
playerNames.addAll(team.members);