public void sendState(sharedstate.SharedState state) throws Exception {
		System.out.println("Sending state");
		if (!connected) {
			byte[] sendBuffer = ("type:connect\nid:" + state.getMyId() + "\n").getBytes();
			DatagramPacket sendPacket = new DatagramPacket(sendBuffer, sendBuffer.length, ip, port);
			sock.send(sendPacket);
			connected = true;
		}
		CopyOnWriteArrayList<GameObject> objs = state.getMyObjects();
		for (GameObject obj : objs) {
			//Skicka endast objekt som uppdaterats sedan sist.
			if(obj.getLastTimeStamp() > lastSentUpdate){
				byte[] sendBuffer = obj.toNetString().getBytes();//G�r om all info om objektet till en str�ng.
				DatagramPacket sendPacket = new DatagramPacket(sendBuffer, sendBuffer.length, ip, port);
				sock.send(sendPacket);
			}
		}
	}