Dragon-Age Source cache downloader problems (UNSOLVED)

Title. Tried a few tuts on making your own auto downloader. Could someone link me or help me get my cache to auto download on this source? I got my direct link good to go and yes the cache is a .rar file.

You need to either host the cache and change the connection details in your client and compile it, or use one that is already hosted.

As i’ve used this source i know what you are referring to, but in future it would be handy to show people the error you get as it could be any number of reasons as to why the cache is not downloading and the error code can help define whats going wrong where.

In your client open the UpdateCache.java file and at:
ZIP URL put where your cache would download from or use:
https://dl.dropboxusercontent.com/u/59796357/dragonage.zip

at VERSION URL same as above link from where it would download from:
https://dl.dropboxusercontent.com/u/59796357/cacheVersion.txt

credits to oldschool-scape for the links

I’ll provide pictures in a moment. But I can say that I have to right links in there, but what keeps happening is when I run the client it it says “making directory” “requesting title screen” “connection error” and when I open up the cache in my computer its only partially there. And looks to be as if its not even reading my link.

Here is what I get when loading the client.

Here is what the client is downloading as the cache.

As you can see, whatever it is downloading from, it is missing parts of the cache like the sprites and such. My client cache is as a .rar file on mediafire and the link is direct to starting the download. Im not sure where its getting that from.

I’ve tested the link and it does contain everything it should.

Pro tip:
That’s not downloading anything. Those files you see are auto-generated by your signlink when they cannot be found normally.

As for your issue:

  1. You need a direct link to the download. Media fire doesn’t provide these, however dropbox does with a couple edits.
  2. You cannot unzip a rar this way. The code in the cache downloader is specifically for a zip file. So it will check for a zip and decompress that. NOT a rar.

Great thank you. Im tinkering with it a bit. I have it as a .zip now, and it is on dropbox as a direct link.
In my CacheUpdater, I have this now:

[CODE]
public class UpdateCache implements Runnable {

public static final String ZIP_URL = "https://dl.dropboxusercontent.com/s/ksyjth05203c3qi/.DEcache.zip?dl=0";
public static final String VERSION_URL = "https://dl.dropboxusercontent.com/s/ksyjth05203c3qi/.DEcache.zip?dl=0";
public static final String VERSION_FILE = "https://dl.dropboxusercontent.com/s/ksyjth05203c3qi/.DEcache.zip?dl=0";
private Client client;
Client frame;
public UpdateCache(Client client) {
            this.client = client;
}[/CODE]

says requesting title screen and still trying to make a directory. Looking all over the internet for a fix. I know people use this source so I cant be the only one who ran into this issue.

[quote=“Divnityrs, post:5, topic:554872”]Great thank you. Im tinkering with it a bit. I have it as a .zip now, and it is on dropbox as a direct link.
In my CacheUpdater, I have this now:

public static final String ZIP_URL = "direct link"; public static final String VERSION_URL = "directlink"; public static final String VERSION_FILE = "directlink"; private Client client; Client frame;[/quote]
Okay… This is going to be assumed, as you didn’t provide the entire class:
ZIP_URL is the direct link to the cache.
VERSION_URL is a link to a .txt file with a version number in it
VERSION_FILE is the name of a .dat file the client would use for checking the version against the text file

Makes sense. Although Im not quite familiar with how to make a working .dat file for checking the version. Conducting research online for it as well currently.

You don’t need to make the dat file.
Simply just put a file name in there that ends with ".dat"
As for the text file. just put a number in it, like “1”

Okay working on it.

Entire UpdateCache.java:

[CODE]
import java.net.URL;
import java.net.URLConnection;
import java.util.zip.;
import java.io.
;
import javax.swing.JOptionPane;

public class UpdateCache implements Runnable {

public static final String ZIP_URL = "https://dl.dropboxusercontent.com/s/ksyjth05203c3qi/.DEcache.zip?dl=0";
public static final String VERSION_URL = "https://dl.dropboxusercontent.com/s/9my2ht4qcdy0jn4/cacheVersion.zip?dl=0";
public static final String VERSION_FILE = "https://dl.dropboxusercontent.com/s/c7ebcagzmby01oz/cacheVersion.dat.zip?dl=0";
private Client client;
Client frame;
public UpdateCache(Client client) {
            this.client = client;
}
	
private void drawLoadingText(int amount, String text) {
            client.drawLoadingText(amount, text);
}

public double getCurrentVersion(){
	try {
		BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(VERSION_FILE)));
		return Double.parseDouble(br.readLine());
	} catch (Exception e) {
		return 0.1;
	}
}

public double getNewestVersion(){
	try {
		URL tmp = new URL(VERSION_URL);
		BufferedReader br = new BufferedReader(new InputStreamReader(tmp.openStream()));
		return Double.parseDouble(br.readLine());
	} catch (Exception e) {
		handleException(e);
		return -1;
	}
}

private void handleException(Exception e){
	StringBuilder strBuff = new StringBuilder();
	strBuff.append("Please Screenshot this message, and send it to an admin!\r\n\r\n");
    StringBuilder append = strBuff.append(e.getClass().getName()).append(" \"").append(e.getMessage()).append("\"\r\n");
	for(StackTraceElement s : e.getStackTrace())
		strBuff.append(s.toString()).append("\r\n");
	alert("Exception [" + e.getClass().getSimpleName() + "]",strBuff.toString(),true);
}

private void alert(String msg){
	alert("Message",msg,false);
}

private void alert(String title,String msg,boolean error){
	JOptionPane.showMessageDialog(null,
		   msg,
		   title,
		    (error ? JOptionPane.ERROR_MESSAGE : JOptionPane.PLAIN_MESSAGE));
}

@Override
public void run() {
drawLoadingText(0, "Checking Versions");
	try{
	double newest = getNewestVersion();
	if(newest > this.getCurrentVersion()){
		int n = JOptionPane.showConfirmDialog(
			    null,
			    "There is an update to version " + newest + "\n" +
				"Would you like to update?",
			    "Current version: "+ getCurrentVersion(),
			    JOptionPane.YES_NO_OPTION);
		if(n == 0){
			updateClient();
			drawLoadingText(0, "Cache has been updated, please restart the client!");
			alert("Cache has been updated, please restart the client!");
			OutputStream out = new FileOutputStream(VERSION_FILE);
			out.write(String.valueOf(newest).getBytes());;
			System.exit(0);
		}else{
			alert(" Your client may not load correct " +
			getCurrentVersion());
			//System.exit(0);
		}
	}
	}catch(Exception e){
		handleException(e);
	}
}

private void updateClient() {
	File clientZip = downloadClient();
	if(clientZip != null){
	unZip(clientZip);
	}
}

private void unZip(File clientZip) {
	try {
		unZipFile(clientZip,new File(signlink.findcachedir()));
		clientZip.delete();
	} catch (IOException e) {
		handleException(e);
	}
}

private void unZipFile(File zipFile,File outFile) throws IOException{
	ZipInputStream zin = new ZipInputStream(new BufferedInputStream(new FileInputStream(zipFile)));
	ZipEntry e;
	long max = 0;
	long curr = 0;
	while((e = zin.getNextEntry()) != null)
		max += e.getSize();
	zin.close();
	ZipInputStream in = new ZipInputStream(new BufferedInputStream(new FileInputStream(zipFile)));
	while((e = in.getNextEntry()) != null){
		if(e.isDirectory())
			new File(outFile,e.getName()).mkdirs();
		else{
			FileOutputStream out = new FileOutputStream(new File(outFile,e.getName()));
			byte[] b = new byte[1024];
			int len;
			while((len = in.read(b,0,b.length)) > -1){
				curr += len;
					out.write(b, 0, len);
					setUnzipPercent((int)((curr * 100) / max));
			}
			out.flush();
			out.close();
		}
	}
}

public int percent = 0;

public void setDownloadPercent(int amount){
        percent = amount;
		drawLoadingText(amount, "Downloading Cache" + " - " + amount + "%");
}

public int percent2 = 0;

public void setUnzipPercent(int amount2){
        percent2 = amount2;
		drawLoadingText(amount2, "Extracting Cache" + " - " + amount2 + "%");
}

private File downloadClient(){
	File ret = new File(signlink.findcachedir()+"cache.zip");
	try{
	OutputStream out = new FileOutputStream(ret);
	URLConnection conn = new URL(ZIP_URL).openConnection();
	InputStream in = conn.getInputStream();
	long max = conn.getContentLength();
	long curr = 0;
	byte[] b = new byte[1024];
	int len;
	while((len = in.read(b, 0, b.length)) > -1){
		out.write(b,0,len);
		curr += len;
		setDownloadPercent((int)((curr * 100) / max));
	}
	out.flush();
	out.close();
	in.close();
	return ret;
	}catch(Exception e){
		handleException(e);
			ret.delete();
		return null;
	}
}

}[/CODE]

Entire signlink.java:

[CODE]
import java.applet.Applet;
import java.io.;
import java.net.
;

public final class signlink implements Runnable {

public static void startpriv(InetAddress inetaddress) {
	threadliveid = (int) (Math.random() * 99999999D);
	if (active) {
		try {
			Thread.sleep(500L);
		} catch (Exception _ex) {
		}
		active = false;
	}
	socketreq = 0;
	threadreq = null;
	dnsreq = null;
	savereq = null;
	urlreq = null;
	socketip = inetaddress;
	Thread thread = new Thread(new signlink());
	thread.setDaemon(true);
	thread.start();
	while (!active) {
		try {
			Thread.sleep(50L);
		} catch (Exception _ex) {
		}
	}
}

public void run() {
	active = true;
	uid = getuid(findcachedir());
	try {
		cache_dat = new RandomAccessFile(findcachedir()
				+ "main_file_cache.dat", "rw");
		for (int j = 0; j < 5; j++) {
			cache_idx[j] = new RandomAccessFile(findcachedir()
					+ "main_file_cache.idx" + j, "rw");
		}
	} catch (Exception exception) {
		exception.printStackTrace();
	}
	for (int i = threadliveid; threadliveid == i;) {
		if (socketreq != 0) {
			try {
				socket = new Socket(socketip, socketreq);
			} catch (Exception _ex) {
				socket = null;
			}
			socketreq = 0;
		} else if (threadreq != null) {
			Thread thread = new Thread(threadreq);
			thread.setDaemon(true);
			thread.start();
			thread.setPriority(threadreqpri);
			threadreq = null;
		} else if (dnsreq != null) {
			try {
				dns = InetAddress.getByName(dnsreq).getHostName();
			} catch (Exception _ex) {
				dns = "unknown";
			}
			dnsreq = null;
		} else if (savereq != null) {
			if (savebuf != null)
				try {
					FileOutputStream fileoutputstream = new FileOutputStream(
							findcachedir() + savereq);
					fileoutputstream.write(savebuf, 0, savelen);
					fileoutputstream.close();
				} catch (Exception _ex) {
				}
			if (waveplay) {
				waveplay = false;
			}
			if (midiplay) {
				midi = findcachedir() + savereq;
				midiplay = false;
			}
			savereq = null;
		} else if (urlreq != null) {
			try {
				System.out.println("urlstream");
				urlstream = new DataInputStream((new URL(
						mainapp.getCodeBase(), urlreq)).openStream());
			} catch (Exception _ex) {
				urlstream = null;
			}
			urlreq = null;
		}
		try {
			Thread.sleep(50L);
		} catch (Exception _ex) {
		}
	}
}
static boolean AkiMonMode = false;
public static String findcachedir() {
	if(!AkiMonMode) {
	boolean exists = (new File(System.getProperty("user.home")
			+ "/.DEcache/")).exists();
	if (exists) {
		return System.getProperty("user.home") + "/.DEcache/";
	} else {
		File f = new File(System.getProperty("user.home") + "/.DEcache/");
		f.mkdir();
		System.out.println("Directory doesnt exist, making directory");
		return System.getProperty("user.home") + "/.DEcache/";
	}
	} else
		return "./cache/";
}
//public static String findcachedir() {

// return “./cache/”;
// }
private static int getuid(String s) {
return 234523;
}

public static synchronized Socket opensocket(int i) throws IOException {
	for (socketreq = i; socketreq != 0;)
		try {
			Thread.sleep(50L);
		} catch (Exception _ex) {
		}

	if (socket == null)
		throw new IOException("could not open socket");
	else
		return socket;
}

public static synchronized DataInputStream openurl(String s)
		throws IOException {
	for (urlreq = s; urlreq != null;)
		try {
			Thread.sleep(50L);
		} catch (Exception _ex) {
		}

	if (urlstream == null)
		throw new IOException("could not open: " + s);
	else
		return urlstream;
}

public static synchronized void dnslookup(String s) {
	dns = s;
	dnsreq = s;
}

public static synchronized void startthread(Runnable runnable, int i) {
	threadreqpri = i;
	threadreq = runnable;
}

public static synchronized boolean wavesave(byte abyte0[], int i) {
	if (i > 0x1e8480)
		return false;
	if (savereq != null) {
		return false;
	} else {
		wavepos = (wavepos + 1) % 5;
		savelen = i;
		savebuf = abyte0;
		waveplay = true;
		savereq = "sound" + wavepos + ".wav";
		return true;
	}
}

public static synchronized boolean wavereplay() {
	if (savereq != null) {
		return false;
	} else {
		savebuf = null;
		waveplay = true;
		savereq = "sound" + wavepos + ".wav";
		return true;
	}
}

public static synchronized void midisave(byte abyte0[], int i) {
	if (i > 0x1e8480)
		return;
	if (savereq != null) {
	} else {
		midipos = (midipos + 1) % 5;
		savelen = i;
		savebuf = abyte0;
		midiplay = true;
	}
}

public static void reporterror(String s) {
	System.out.println("Error: " + s);
}

private signlink() {
}

public static final int clientversion = 317;
public static int uid;
public static int storeid = 32;
public static RandomAccessFile cache_dat = null;
public static final RandomAccessFile[] cache_idx = new RandomAccessFile[5];
public static boolean sunjava;
public static Applet mainapp = null;
private static boolean active;
private static int threadliveid;
private static InetAddress socketip;
private static int socketreq;
private static Socket socket = null;
private static int threadreqpri = 1;
private static Runnable threadreq = null;
private static String dnsreq = null;
public static String dns = null;
private static String urlreq = null;
private static DataInputStream urlstream = null;
private static int savelen;
private static String savereq = null;
private static byte[] savebuf = null;
private static boolean midiplay;
private static int midipos;
public static String midi = null;
public static int midivol;
public static int midifade;
private static boolean waveplay;
private static int wavepos;
public static int wavevol;
public static boolean reporterror = true;
public static String errorname = "";

}[/CODE]

Just for reference. ^

Still nothing. zip url=cache itself. version url= text file with just a version.txt with a number in it. version file is a version.dat with the same number in it as the version url.

You didn’t listen to me at all when I said to make a single text file and place a number in it.

Also remove “?dl=0” from your links.

Okay, took out the “?dl=0”. I did make a single file. The .txt is zipped with just a number 1 in it. the .dat is literally an empty .dat that is zipped.

public static final String ZIP_URL = "https://dl.dropboxusercontent.com/s/ksyjth05203c3qi/.DEcache.zip"; public static final String VERSION_URL = "https://dl.dropboxusercontent.com/s/9my2ht4qcdy0jn4/cacheVersion.zip"; public static final String VERSION_FILE = "https://dl.dropboxusercontent.com/s/c7ebcagzmby01oz/cacheVersion.dat.zip"; private Client client;

The only file that needs to be a zip is the cache.
The text file needs to be a raw text file.
The .dat file needs to be just a name with the .dat extension

public static final String ZIP_URL = "https://dl.dropboxusercontent.com/s/ksyjth05203c3qi/.DEcache.zip"; public static final String VERSION_URL = "https://dl.dropboxusercontent.com/s/rjqvzkpuz3x4i63/cacheVersion.txt"; public static final String VERSION_FILE = "https://dl.dropboxusercontent.com/s/hyuct9cspvctrd2/cacheVersion.dat"; private Client client;

Nothing. I dont get it. This is so frustrating.

PM me your skype Divinityrs

Okay I did.

[quote=“Divnityrs, post:13, topic:554872”] public static final String ZIP_URL = "https://dl.dropboxusercontent.com/s/ksyjth05203c3qi/.DEcache.zip"; public static final String VERSION_URL = "https://dl.dropboxusercontent.com/s/rjqvzkpuz3x4i63/cacheVersion.txt"; public static final String VERSION_FILE = "https://dl.dropboxusercontent.com/s/hyuct9cspvctrd2/cacheVersion.dat"; private Client client;

Nothing. I dont get it. This is so frustrating.[/quote]
Because. You’re. Not. Listening.
For the fifth time, the VERSION_FILE is just a dat file.
You do not upload anything. You do not create a link. You simply put the NAME OF THE FILE along with “.dat” for the VERSION_FILE.

I apologize. This is just really frustrating and its messing with my mind. Okay. did that. STILL nothing. Comp is about to go flying out of my window.

public static final String ZIP_URL = "https://dl.dropboxusercontent.com/s/ksyjth05203c3qi/.DEcache.zip"; public static final String VERSION_URL = "https://dl.dropboxusercontent.com/s/rjqvzkpuz3x4i63/cacheVersion.txt"; public static final String VERSION_FILE = "cacheVersion.dat"; private Client client;

[quote=“Divnityrs, post:17, topic:554872”]I apologize. This is just really frustrating and its messing with my mind. Okay. did that. STILL nothing. Comp is about to go flying out of my window.

public static final String ZIP_URL = "https://dl.dropboxusercontent.com/s/ksyjth05203c3qi/.DEcache.zip"; public static final String VERSION_URL = "https://dl.dropboxusercontent.com/s/rjqvzkpuz3x4i63/cacheVersion.txt"; public static final String VERSION_FILE = "cacheVersion.dat"; private Client client;[/quote]
After you changed it to that did you delete the cache folder from where it downloads?

damn son

replace dropboxusercontent with dropbox

https://dl.dropbox.com/s/ksyjth05203c3qi/.DEcache.zip

that shit happens when it can’t fetch ur cache properly from the link

[quote=“X-J-K-X, post:19, topic:554872”]damn son

replace dropboxusercontent with dropbox

https://dl.dropbox.com/s/ksyjth05203c3qi/.DEcache.zip

that shit happens when it can’t fetch ur cache properly from the link[/quote]
The link he has is fine. dropboxusercontent is basically the same as dropbox.com