if(cmd[0].equals(Command.ROOM_ENTERED)) {
yourPlayer.setPlayerID(Integer.parseInt(data));
ids.put(yourPlayer.getPlayerID(), yourPlayer);
} else if(cmd[0].equals(Command.PLAYER_EXITED)) {
Player toRemove = ids.remove(Integer.parseInt(data));
System.out.println(toRemove.getPlayerID() + " HAS EXITED.");
players.remove(toRemove);
} else {
if(yourPlayer.getPlayerID() != -1) {
int whichPlayer = Integer.parseInt(cmd[1]);
if(yourPlayer.getPlayerID() == whichPlayer) return;
String[] info = data.split(",");
if(cmd[0].equals(Command.NEWCOMER)) {
registerPlayer(new Player(
Integer.parseInt(info[0]), Integer.parseInt(info[1]),
GameSettings.PLAYER_SIZE, GameSettings.PLAYER_SIZE,
whichPlayer, Integer.parseInt(info[2]), Integer.parseInt(info[3]), Color.RED));
} else if(cmd[0].equals(Command.INFO)) {
Player pToMove = null;
pToMove = ids.get(whichPlayer);
pToMove.movRight = Boolean.parseBoolean(info[0]);
pToMove.movLeft = Boolean.parseBoolean(info[1]);
pToMove.movUp = Boolean.parseBoolean(info[2]);
pToMove.movDown = Boolean.parseBoolean(info[3]);
pToMove.movRightBlocked = Boolean.parseBoolean(info[4]);
pToMove.movLeftBlocked = Boolean.parseBoolean(info[5]);
pToMove.movUpBlocked = Boolean.parseBoolean(info[6]);
pToMove.movDownBlocked = Boolean.parseBoolean(info[7]);
/*pToMove.setLocation(Integer.parseInt(info[0]),
Integer.parseInt(info[1]));*/
pToMove.health = Integer.parseInt(info[8]);
} else if(cmd[0].equals(Command.SYNC_INFO)) {
Player pToMove = null;
pToMove = ids.get(whichPlayer);
pToMove.setLocation(Integer.parseInt(info[0]),
Integer.parseInt(info[1]));
//pToMove.health = Integer.parseInt(info[10]);
} else if(cmd[0].equals(Command.EXISTING)) {
registerPlayer(new Player(
Integer.parseInt(info[0]),
Integer.parseInt(info[1]), GameSettings.PLAYER_SIZE,
GameSettings.PLAYER_SIZE, whichPlayer,
Integer.parseInt(info[2]), Integer.parseInt(info[3]),
Color.RED));
} else if(cmd[0].equals(Command.WEP_FIRE)) {
Player firingPlayer = ids.get(whichPlayer);
WeaponType firingWep =
WeaponType.valueOf(info[0]);
BulletCombo.spawnShot(firingWep,
bullets, firingPlayer, new Point(