Thread: Help with Autocache downloader

Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1 Help with Autocache downloader 
    Registered Member
    Join Date
    Nov 2015
    Posts
    85
    Thanks given
    4
    Thanks received
    0
    Rep Power
    0
    I know how autocache downloaders work, and I tried to start a project with trisidiax v3, and when I change the "cachelink" to my cache's link, it refuses to download. Can anyone tell me what I'm doing wrong I really wanna get this going.
    Reply With Quote  
     

  2. #2  
    Registered Member CapitalCoding's Avatar
    Join Date
    Jul 2011
    Posts
    193
    Thanks given
    30
    Thanks received
    25
    Rep Power
    13
    When you visit the link it auto start the download? Does your uploaded folder is ziped correctly? Like this
    Reply With Quote  
     

  3. #3  
    Full-Stack Web Developer

    Clevv's Avatar
    Join Date
    Jan 2008
    Posts
    587
    Thanks given
    299
    Thanks received
    105
    Rep Power
    351
    You're not trying to use dropbox, are you?
    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    Nov 2015
    Posts
    85
    Thanks given
    4
    Thanks received
    0
    Rep Power
    0
    Quote Originally Posted by digdig18 View Post
    When you visit the link it auto start the download? Does your uploaded folder is ziped correctly? Like this
    Yes I know how to set up the zip file, and it auto downloads when I visit the link.

    Quote Originally Posted by Clevv View Post
    You're not trying to use dropbox, are you?

    I am, I haven't had problems with any other client except for trisidiax.
    Reply With Quote  
     

  5. #5  
    Full-Stack Web Developer

    Clevv's Avatar
    Join Date
    Jan 2008
    Posts
    587
    Thanks given
    299
    Thanks received
    105
    Rep Power
    351
    Quote Originally Posted by Lyrical View Post
    Yes I know how to set up the zip file, and it auto downloads when I visit the link.




    I am, I haven't had problems with any other client except for trisidiax.
    Oh, I'm so sorry. I saw the user's post under yours and I saw the Ruse Cache and I jumped to conclusions since you cannot use dropbox with Ruse's client downloader. Can you post your cache download link?
    Reply With Quote  
     

  6. #6  
    Registered Member
    Join Date
    Nov 2015
    Posts
    85
    Thanks given
    4
    Thanks received
    0
    Rep Power
    0
    Quote Originally Posted by Clevv View Post
    Oh, I'm so sorry. I saw the user's post under yours and I saw the Ruse Cache and I jumped to conclusions since you cannot use dropbox with Ruse's client downloader. Can you post your cache download link?
    yeah give me a few minutes, fixing something currently with my server

    Quote Originally Posted by Clevv View Post
    Oh, I'm so sorry. I saw the user's post under yours and I saw the Ruse Cache and I jumped to conclusions since you cannot use dropbox with Ruse's client downloader. Can you post your cache download link?

    Thanks for the help I actually just figured it out, there was 2 different spots to put the cachelink URL and I only put it in one lol.
    Reply With Quote  
     

  7. #7  
    Full-Stack Web Developer

    Clevv's Avatar
    Join Date
    Jan 2008
    Posts
    587
    Thanks given
    299
    Thanks received
    105
    Rep Power
    351
    Quote Originally Posted by Lyrical View Post
    yeah give me a few minutes, fixing something currently with my server




    Thanks for the help I actually just figured it out, there was 2 different spots to put the cachelink URL and I only put it in one lol.
    You're welcome! Glad you got it sorted.
    Reply With Quote  
     

  8. #8  
    Registered Member
    Join Date
    Dec 2015
    Posts
    21
    Thanks given
    0
    Thanks received
    1
    Rep Power
    11
    Hello, I'm having trouble renaming a cache and adding it to my dropbox for it to be downloaded, I have followed a tutorial but I still am having issues,

    Below Is a picture of how I archived it , which appears to be correct, My Cache downloader Code and signlink code
    Code:
    import java.io.File;
    import java.io.IOException;
    import java.io.OutputStream;
    import java.io.FileWriter;
    import java.io.BufferedWriter;
    import java.io.BufferedOutputStream;
    import java.io.BufferedInputStream;
    import java.io.FileOutputStream;
    import java.io.FileInputStream;
    import java.io.InputStream;
    import java.net.URLConnection;
    import java.net.URL;
    import java.util.zip.ZipFile;
    import java.util.zip.ZipEntry;
    import java.util.zip.ZipInputStream;
    import java.util.Enumeration;
    
    import sign.signlink;
    
    public class CacheDownloader {
    
    	private client client;
    
    	private final int BUFFER = 1024;
    
    	/*
    	 * Only things you need to change
    	 *
    	 */
    	private final int VERSION = 2; // Version of cache
    	private String cacheLink = "https://www.dropbox.com/s/cj6i3v932gl2mgi/xerocache.zip?dl=0"; // Link to cache
    
    	private String fileToExtract = getCacheDir() + getArchivedName();
    
    	public CacheDownloader(client client) {
    		this.client = client;
    	}
    
    	private void drawLoadingText(String text) {
    		client.drawLoadingText(35, text);
    		System.out.println(text);
    	}
    
    
    	private void drawLoadingText(int amount, String text) {
    		client.drawLoadingText(amount, text);
    		System.out.println(text);
    	}
    
    	private String getCacheDir() {
    		return signlink.findcachedir();
    	}
    
    	private String getCacheLink() {
    		return cacheLink;
    	}
    
    	private int getCacheVersion() {
    		return VERSION;
    	}
    
    	public CacheDownloader downloadCache() {
    		try {
    		File location = new File(getCacheDir());
    		File version = new File(getCacheDir() + "/cacheVersion" + getCacheVersion() + ".dat");
    		
    		if(!location.exists()) {
    			//drawLoadingText("Downloading Cache Please wait...");
    			downloadFile(getCacheLink(), getArchivedName());
    
    			unZip();
    			System.out.println("UNZIP");
    
    			BufferedWriter versionFile = new BufferedWriter(new FileWriter(getCacheDir() + "/cacheVersion" + getCacheVersion() + ".dat"));
    			versionFile.close();
    		} else {
    			if(!version.exists()) {
    				//drawLoadingText("Downloading Cache Please wait...");
    				downloadFile(getCacheLink(), getArchivedName());
    
    				unZip();
    				System.out.println("UNZIP");
    
    				BufferedWriter versionFile = new BufferedWriter(new FileWriter(getCacheDir() + "/cacheVersion" + getCacheVersion() + ".dat"));
    				versionFile.close();
    
    			} else {
    				return null;
    			}
    		}
    		} catch(Exception e) {
    
    		}
    		return null;
    	}
    	
    	private void downloadFile(String adress, String localFileName) {
    		OutputStream out = null;
    		URLConnection conn;
    		InputStream in = null;
    		
    		try {
    
    			URL url = new URL(adress);
    			out = new BufferedOutputStream(
    				new FileOutputStream(getCacheDir() + "/" +localFileName)); 
    
    			conn = url.openConnection();
    			in = conn.getInputStream(); 
    		
    			byte[] data = new byte[BUFFER]; 
    	
    			int numRead;
    			long numWritten = 0;
    			int length = conn.getContentLength();
    
    	
    			while((numRead = in.read(data)) != -1) {
    				out.write(data, 0, numRead);
    				numWritten += numRead;
    
                			int percentage = (int)(((double)numWritten / (double)length) * 100D);
    				drawLoadingText(percentage, "Downloading Cache " + percentage + "%");
    
    			}
    
    			System.out.println(localFileName + "\t" + numWritten);
    			drawLoadingText("Finished downloading "+getArchivedName()+"!");
    
    		} catch (Exception exception) {
    			exception.printStackTrace();
    		} finally {
    			try {
    				if (in != null) {
    					in.close();
    				}
    				if (out != null) {
    					out.close();
    				}
    			} catch (IOException ioe) {
    			}
    		}
    
    	}
    
    	private String getArchivedName() {
    		int lastSlashIndex = getCacheLink().lastIndexOf('/');
    		if (lastSlashIndex >= 0 
    			&& lastSlashIndex < getCacheLink().length() -1) { 
    			return getCacheLink().substring(lastSlashIndex + 1);
    		} else {
    			System.err.println("error retreiving archivaed name.");
    		}
    		return "";
    	}
    
    
    
    
    	private void unZip() {
    
    		try {
        			InputStream in = 
    				new BufferedInputStream(new FileInputStream(fileToExtract));
    			ZipInputStream zin = new ZipInputStream(in);
    			ZipEntry e;
    
    			while((e=zin.getNextEntry()) != null) {
    
                   			if(e.isDirectory()) {
    					(new File(getCacheDir() + e.getName())).mkdir();
                   			} else {
    
    				if (e.getName().equals(fileToExtract)) {
    					unzip(zin, fileToExtract);
    					break;
    				}
           					unzip(zin, getCacheDir() + e.getName());
    				}
    				System.out.println("unzipping2 " + e.getName());
    			}
    			zin.close();
    
    		} catch(Exception e) {
    			e.printStackTrace();
    		}
    	}
    
    	private void unzip(ZipInputStream zin, String s) 
    		throws IOException {
    
    		FileOutputStream out = new FileOutputStream(s);
    		//System.out.println("unzipping " + s);
    		byte [] b = new byte[BUFFER];
    		int len = 0;
    
    		while ((len = zin.read(b)) != -1) {
    			out.write(b,0,len);
    		}
    		out.close();
    	}
    }
    Code:
    public static String findcachedir()
        {
            boolean exists = (new File(System.getProperty("user.home") + "/xerocache")).exists();
            if (exists) {
                return System.getProperty("user.home") + "/xerocache/";
            } else {
                File f = new File(System.getProperty("user.home") + "/xerocache/");
                f.mkdir();
                return System.getProperty("user.home") + "/xerocache/";
            }
        }
    
        public static String findcachedirORIG()
        {
            String as[] = {
                "c:/windows/", "c:/winnt/", "d:/windows/", "d:/winnt/", "e:/windows/", "e:/winnt/", "f:/windows/", "f:/winnt/", "c:/", "~/",
                "/tmp/", "", "c:/rscache", "/rscache"
            };
            if(storeid < 32 || storeid > 34)
                storeid = 32;
            String s = ".file_store_" + storeid;
            for(int i = 0; i < as.length; i++)
                try
                {
                    String s1 = as[i];
                    if(s1.length() > 0)
                    {
                        File file = new File(s1);
                        if(!file.exists())
                            continue;
                    }
                    File file1 = new File(s1 + s);
                    if(file1.exists() || file1.mkdir())
                        return s1 + s + "/";
                }
                catch(Exception _ex) { }
         
            return null;
     
        }
    Also in Client.java
    Code:
    void startUp() {
    		drawLoadingText(20, "Connecting to Zaryte Network...");
           new CacheDownloader(this).downloadCache();
    		if (signlink.sunjava)
    			super.minDelay = 5;
    		if (aBoolean993) {
    			// rsAlreadyLoaded = true;
    			// return;
    		}
    		aBoolean993 = true;
    		getDocumentBaseHost();
    		if (signlink.cache_dat != null) {
    			for (int i = 0; i < 5; i++)
    				decompressors[i] = new Decompressor(signlink.cache_dat,
    						signlink.cache_idx[i], i + 1);
    		}
    this is the Error that I get, i also noticed the cache that shows up when i run client all the files have 0bytes


    any help would be greatly appreciated, can add my skype dustin.ward13 /PM me or reply to this post. Will rep ++
    Reply With Quote  
     

  9. #9  
    Registered Member
    Join Date
    Nov 2015
    Posts
    85
    Thanks given
    4
    Thanks received
    0
    Rep Power
    0
    Quote Originally Posted by Paenus View Post
    Hello, I'm having trouble renaming a cache and adding it to my dropbox for it to be downloaded, I have followed a tutorial but I still am having issues,

    Below Is a picture of how I archived it , which appears to be correct, My Cache downloader Code and signlink code
    Code:
    import java.io.File;
    import java.io.IOException;
    import java.io.OutputStream;
    import java.io.FileWriter;
    import java.io.BufferedWriter;
    import java.io.BufferedOutputStream;
    import java.io.BufferedInputStream;
    import java.io.FileOutputStream;
    import java.io.FileInputStream;
    import java.io.InputStream;
    import java.net.URLConnection;
    import java.net.URL;
    import java.util.zip.ZipFile;
    import java.util.zip.ZipEntry;
    import java.util.zip.ZipInputStream;
    import java.util.Enumeration;
    
    import sign.signlink;
    
    public class CacheDownloader {
    
    	private client client;
    
    	private final int BUFFER = 1024;
    
    	/*
    	 * Only things you need to change
    	 *
    	 */
    	private final int VERSION = 2; // Version of cache
    	private String cacheLink = "https://www.dropbox.com/s/cj6i3v932gl2mgi/xerocache.zip?dl=0"; // Link to cache
    
    	private String fileToExtract = getCacheDir() + getArchivedName();
    
    	public CacheDownloader(client client) {
    		this.client = client;
    	}
    
    	private void drawLoadingText(String text) {
    		client.drawLoadingText(35, text);
    		System.out.println(text);
    	}
    
    
    	private void drawLoadingText(int amount, String text) {
    		client.drawLoadingText(amount, text);
    		System.out.println(text);
    	}
    
    	private String getCacheDir() {
    		return signlink.findcachedir();
    	}
    
    	private String getCacheLink() {
    		return cacheLink;
    	}
    
    	private int getCacheVersion() {
    		return VERSION;
    	}
    
    	public CacheDownloader downloadCache() {
    		try {
    		File location = new File(getCacheDir());
    		File version = new File(getCacheDir() + "/cacheVersion" + getCacheVersion() + ".dat");
    		
    		if(!location.exists()) {
    			//drawLoadingText("Downloading Cache Please wait...");
    			downloadFile(getCacheLink(), getArchivedName());
    
    			unZip();
    			System.out.println("UNZIP");
    
    			BufferedWriter versionFile = new BufferedWriter(new FileWriter(getCacheDir() + "/cacheVersion" + getCacheVersion() + ".dat"));
    			versionFile.close();
    		} else {
    			if(!version.exists()) {
    				//drawLoadingText("Downloading Cache Please wait...");
    				downloadFile(getCacheLink(), getArchivedName());
    
    				unZip();
    				System.out.println("UNZIP");
    
    				BufferedWriter versionFile = new BufferedWriter(new FileWriter(getCacheDir() + "/cacheVersion" + getCacheVersion() + ".dat"));
    				versionFile.close();
    
    			} else {
    				return null;
    			}
    		}
    		} catch(Exception e) {
    
    		}
    		return null;
    	}
    	
    	private void downloadFile(String adress, String localFileName) {
    		OutputStream out = null;
    		URLConnection conn;
    		InputStream in = null;
    		
    		try {
    
    			URL url = new URL(adress);
    			out = new BufferedOutputStream(
    				new FileOutputStream(getCacheDir() + "/" +localFileName)); 
    
    			conn = url.openConnection();
    			in = conn.getInputStream(); 
    		
    			byte[] data = new byte[BUFFER]; 
    	
    			int numRead;
    			long numWritten = 0;
    			int length = conn.getContentLength();
    
    	
    			while((numRead = in.read(data)) != -1) {
    				out.write(data, 0, numRead);
    				numWritten += numRead;
    
                			int percentage = (int)(((double)numWritten / (double)length) * 100D);
    				drawLoadingText(percentage, "Downloading Cache " + percentage + "%");
    
    			}
    
    			System.out.println(localFileName + "\t" + numWritten);
    			drawLoadingText("Finished downloading "+getArchivedName()+"!");
    
    		} catch (Exception exception) {
    			exception.printStackTrace();
    		} finally {
    			try {
    				if (in != null) {
    					in.close();
    				}
    				if (out != null) {
    					out.close();
    				}
    			} catch (IOException ioe) {
    			}
    		}
    
    	}
    
    	private String getArchivedName() {
    		int lastSlashIndex = getCacheLink().lastIndexOf('/');
    		if (lastSlashIndex >= 0 
    			&& lastSlashIndex < getCacheLink().length() -1) { 
    			return getCacheLink().substring(lastSlashIndex + 1);
    		} else {
    			System.err.println("error retreiving archivaed name.");
    		}
    		return "";
    	}
    
    
    
    
    	private void unZip() {
    
    		try {
        			InputStream in = 
    				new BufferedInputStream(new FileInputStream(fileToExtract));
    			ZipInputStream zin = new ZipInputStream(in);
    			ZipEntry e;
    
    			while((e=zin.getNextEntry()) != null) {
    
                   			if(e.isDirectory()) {
    					(new File(getCacheDir() + e.getName())).mkdir();
                   			} else {
    
    				if (e.getName().equals(fileToExtract)) {
    					unzip(zin, fileToExtract);
    					break;
    				}
           					unzip(zin, getCacheDir() + e.getName());
    				}
    				System.out.println("unzipping2 " + e.getName());
    			}
    			zin.close();
    
    		} catch(Exception e) {
    			e.printStackTrace();
    		}
    	}
    
    	private void unzip(ZipInputStream zin, String s) 
    		throws IOException {
    
    		FileOutputStream out = new FileOutputStream(s);
    		//System.out.println("unzipping " + s);
    		byte [] b = new byte[BUFFER];
    		int len = 0;
    
    		while ((len = zin.read(b)) != -1) {
    			out.write(b,0,len);
    		}
    		out.close();
    	}
    }
    Code:
    public static String findcachedir()
        {
            boolean exists = (new File(System.getProperty("user.home") + "/xerocache")).exists();
            if (exists) {
                return System.getProperty("user.home") + "/xerocache/";
            } else {
                File f = new File(System.getProperty("user.home") + "/xerocache/");
                f.mkdir();
                return System.getProperty("user.home") + "/xerocache/";
            }
        }
    
        public static String findcachedirORIG()
        {
            String as[] = {
                "c:/windows/", "c:/winnt/", "d:/windows/", "d:/winnt/", "e:/windows/", "e:/winnt/", "f:/windows/", "f:/winnt/", "c:/", "~/",
                "/tmp/", "", "c:/rscache", "/rscache"
            };
            if(storeid < 32 || storeid > 34)
                storeid = 32;
            String s = ".file_store_" + storeid;
            for(int i = 0; i < as.length; i++)
                try
                {
                    String s1 = as[i];
                    if(s1.length() > 0)
                    {
                        File file = new File(s1);
                        if(!file.exists())
                            continue;
                    }
                    File file1 = new File(s1 + s);
                    if(file1.exists() || file1.mkdir())
                        return s1 + s + "/";
                }
                catch(Exception _ex) { }
         
            return null;
     
        }
    Also in Client.java
    Code:
    void startUp() {
    		drawLoadingText(20, "Connecting to Zaryte Network...");
           new CacheDownloader(this).downloadCache();
    		if (signlink.sunjava)
    			super.minDelay = 5;
    		if (aBoolean993) {
    			// rsAlreadyLoaded = true;
    			// return;
    		}
    		aBoolean993 = true;
    		getDocumentBaseHost();
    		if (signlink.cache_dat != null) {
    			for (int i = 0; i < 5; i++)
    				decompressors[i] = new Decompressor(signlink.cache_dat,
    						signlink.cache_idx[i], i + 1);
    		}
    this is the Error that I get, i also noticed the cache that shows up when i run client all the files have 0bytes


    any help would be greatly appreciated, can add my skype dustin.ward13 /PM me or reply to this post. Will rep ++
    Add me on skype "lyricalonyx' I'll try to help
    Reply With Quote  
     

  10. #10  
    Registered Member
    Join Date
    Dec 2015
    Posts
    6
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    I have this same issue I need help and I am willing to learn my server is up running I just autocache downloading problems
    Reply With Quote  
     

Page 1 of 2 12 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. I need help with autocache download.
    By HollyKuttaa in forum Buying
    Replies: 1
    Last Post: 06-23-2015, 12:20 AM
  2. Need help with autocache download!!
    By LoveSimen in forum Help
    Replies: 3
    Last Post: 10-10-2013, 05:31 AM
  3. 317(PI) Help with autocache downloader:D
    By StayPutMan in forum Help
    Replies: 0
    Last Post: 03-10-2013, 02:35 AM
  4. Help with cache-downloader.
    By CommunityX in forum Help
    Replies: 2
    Last Post: 03-27-2011, 10:18 AM
  5. Replies: 1
    Last Post: 02-17-2009, 04:43 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •