public void receive(Object obj) {
		// TODO Parse all possible messages
		Event event = (Event)obj;
		int port;
		switch(event.type) {
			case "new game":
				port = (int)event.data;
				if (port==-1) throw new RuntimeException("could not create game, go back to main menu");
				else {
					gui.joinGame(port);
				}
				break;
			case "games info":
				Vector<GameObject> games = (Vector<GameObject>)event.data;
				Helper.log("Received update game event from central server, updated " + games.size() + " games.");
				gui.lobby.updateGames(games);
				break;
			case "join game":
				port = (int)event.data;
				System.out.println("CONNECTION TO CS: ABOUT TO TELL GUI TO JOIN GAME");
				gui.joinGame(port);
				break;
			case "new profile":
				gui.createProfile.createProfileResponse(event);
				break;
			case "login":
				System.out.println("recevied login: " + event);
				gui.login.loginResponse(event);
				break;
			case "stats":
				gui.stats.statsResponse(event);
				break;
			default:
				ThinkTankGUI.logger.log(Level.INFO, "Parse error. did not understand message: " + event);
		}
	}