public void recvState(sharedstate.SharedState state) throws Exception {
		DatagramPacket recvPacket = new DatagramPacket(recvBuffer, recvBuffer.length);
		sock.receive(recvPacket);
		String data = new String(recvPacket.getData());
		System.out.println("Received data: " + data);
		
		String type = Utils.parseType(data);
		if (type == null) return;
		if (type.equals("chat")) {
			state.chatMessage = Utils.parseMsg(data);
		} else if (type.equals("Player")) {
			sharedstate.Player p = new sharedstate.Player();
			p.fromNetString(data);
			addOrUpdate(state, p, data);
		} else if(type.equals("BeamD")){
			sharedstate.BeamD b = new sharedstate.BeamD();
			b.fromNetString(data);
			addOrUpdate(state, b, data);
		} else if (type.equals("Planet")) {
			sharedstate.Planet p = new sharedstate.Planet();
			p.fromNetString(data);
			addOrUpdate(state, p, data);
		}
	}