(Player player, ClientConnection playerFrom)
| 246 | } |
| 247 | |
| 248 | protected void sendAddPlayerMessage(Player player, ClientConnection playerFrom) |
| 249 | { |
| 250 | ListIterator<ClientConnection> itr = clients.listIterator(); |
| 251 | |
| 252 | while(itr.hasNext()) |
| 253 | { |
| 254 | ClientConnection client = itr.next(); |
| 255 | |
| 256 | String message; |
| 257 | |
| 258 | int local = 0; |
| 259 | if(client == playerFrom) |
| 260 | { |
| 261 | local = 1; |
| 262 | } |
| 263 | |
| 264 | int ready = 0; |
| 265 | if(player.getReady() == true) |
| 266 | { |
| 267 | ready = 1; |
| 268 | } |
| 269 | |
| 270 | message = NetworkProtocol.ADD_PLAYER+"&"+player.getID()+"&"+player.getName()+"&"+player.getTeam()+"&"+local+"&"+player.getNumSoldiers()+"&"+ready; |
| 271 | |
| 272 | client.sendMessage(message); |
| 273 | } |
| 274 | } |
| 275 | |
| 276 | // Returns true if the player belongs to that client |
| 277 | private boolean setTeam(int team, int playerID, ClientConnection client) |
no test coverage detected