(ClientConnection client)
| 206 | } |
| 207 | |
| 208 | private void sendAllInfoMessage(ClientConnection client) |
| 209 | { |
| 210 | ListIterator<ClientConnection> itr = clients.listIterator(); |
| 211 | |
| 212 | while(itr.hasNext()) |
| 213 | { |
| 214 | ClientConnection tmpClient = itr.next(); |
| 215 | |
| 216 | List<Player> players = tmpClient.getPlayers(); |
| 217 | |
| 218 | ListIterator<Player> pitr = players.listIterator(); |
| 219 | |
| 220 | while(pitr.hasNext()) |
| 221 | { |
| 222 | Player player = pitr.next(); |
| 223 | |
| 224 | String message; |
| 225 | |
| 226 | int local = 0; |
| 227 | if(client == tmpClient) |
| 228 | { |
| 229 | local = 1; |
| 230 | } |
| 231 | |
| 232 | int ready = 0; |
| 233 | if(player.getReady() == true) |
| 234 | { |
| 235 | ready = 1; |
| 236 | } |
| 237 | |
| 238 | message = NetworkProtocol.ADD_PLAYER+"&"+player.getID()+"&"+player.getName()+"&"+player.getTeam()+"&"+local+"&"+player.getNumSoldiers()+"&"+ready; |
| 239 | |
| 240 | client.sendMessage(message); |
| 241 | } |
| 242 | } |
| 243 | |
| 244 | String message = NetworkProtocol.SET_MODE+"&"+gameMode; |
| 245 | client.sendMessage(message); |
| 246 | } |
| 247 | |
| 248 | protected void sendAddPlayerMessage(Player player, ClientConnection playerFrom) |
| 249 | { |
no test coverage detected