(String message)
| 1238 | } |
| 1239 | |
| 1240 | public synchronized void handleMessage(String message) |
| 1241 | { |
| 1242 | String[] info = message.split("&"); |
| 1243 | |
| 1244 | try |
| 1245 | { |
| 1246 | int type = Integer.parseInt(info[0]); |
| 1247 | |
| 1248 | //if(type != NetworkProtocol.NO_INFO) |
| 1249 | //{ |
| 1250 | // System.out.println("Message received on client: "+message); |
| 1251 | //} |
| 1252 | |
| 1253 | switch(type) |
| 1254 | { |
| 1255 | case NetworkProtocol.NO_INFO: |
| 1256 | { |
| 1257 | |
| 1258 | }break; |
| 1259 | |
| 1260 | case NetworkProtocol.ADD_PLAYER: |
| 1261 | { |
| 1262 | addPlayerMessage(info); |
| 1263 | }break; |
| 1264 | |
| 1265 | case NetworkProtocol.SET_TEAM: |
| 1266 | { |
| 1267 | setSideMessage(info); |
| 1268 | }break; |
| 1269 | |
| 1270 | case NetworkProtocol.REMOVE_PLAYER: |
| 1271 | { |
| 1272 | removePlayerMessage(info); |
| 1273 | }break; |
| 1274 | |
| 1275 | case NetworkProtocol.ADD_SOLDIER: |
| 1276 | { |
| 1277 | addSoldierMessage(info); |
| 1278 | }break; |
| 1279 | |
| 1280 | case NetworkProtocol.REMOVE_SOLDIER: |
| 1281 | { |
| 1282 | removeSoldierMessage(info); |
| 1283 | }break; |
| 1284 | |
| 1285 | case NetworkProtocol.CHAT_MSG: |
| 1286 | { |
| 1287 | addChatMessage(info); |
| 1288 | }break; |
| 1289 | |
| 1290 | case NetworkProtocol.SET_MODE: |
| 1291 | { |
| 1292 | setModeMessage(info); |
| 1293 | }break; |
| 1294 | |
| 1295 | case NetworkProtocol.SET_READY: |
| 1296 | { |
| 1297 | setReadyMessage(info); |
no test coverage detected