Thread: Valius Cache not Downloading

Page 1 of 3 123 LastLast
Results 1 to 10 of 25
  1. #1 Valius Cache not Downloading 
    Registered Member Juicy7's Avatar
    Join Date
    Feb 2012
    Age
    23
    Posts
    151
    Thanks given
    45
    Thanks received
    1
    Rep Power
    0
    Hey,

    I'm having troubles setting up cache downloader. Do you mind helping me? All my files are on dropbox, I tried with only HTTP, dl.dropbox, changing =0 to =1 and it still won't download. The cacheVersion.dat file I created and added to cache has 1.0 number inside and on dropbox it has 1.1. I really don't know what I'm doing wrong here.

    Code:
    java.lang.NullPointerException
    	at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1838)
    	at sun.misc.FloatingDecimal.parseDouble(FloatingDecimal.java:110)
    	at java.lang.Double.parseDouble(Double.java:538)
    	at com.client.update.CacheDownloader.getExpectedVersion(CacheDownloader.java:91)
    	at com.client.update.CacheDownloader.downloadCache(CacheDownloader.java:65)
    	at com.client.Client.startUp(Client.java:11180)
    	at com.client.Client.run(Client.java:6495)
    	at java.lang.Thread.run(Thread.java:748)
    java.io.FileNotFoundException: C:\Users\Simon\ValiusCache1\cacheVersion.dat (The system cannot find the file specified)
    	at java.io.FileInputStream.open0(Native Method)
    	at java.io.FileInputStream.open(FileInputStream.java:195)
    	at java.io.FileInputStream.<init>(FileInputStream.java:138)
    	at java.io.FileInputStream.<init>(FileInputStream.java:93)
    	at java.io.FileReader.<init>(FileReader.java:58)
    	at com.client.update.CacheDownloader.getExistingVersion(CacheDownloader.java:100)
    	at com.client.update.CacheDownloader.downloadCache(CacheDownloader.java:66)
    	at com.client.Client.startUp(Client.java:11180)
    	at com.client.Client.run(Client.java:6495)
    	at java.lang.Thread.run(Thread.java:748)
    java.io.FileNotFoundException: C:\Users\Simon\ValiusCache1\itembonus.json (The system cannot find the file specified)
    	at java.io.FileInputStream.open0(Native Method)
    	at java.io.FileInputStream.open(FileInputStream.java:195)
    	at java.io.FileInputStream.<init>(FileInputStream.java:138)
    	at java.io.FileReader.<init>(FileReader.java:72)
    	at com.client.Client.loadItemBonusDefinitions(Client.java:8114)
    	at com.client.Client.startUp(Client.java:11188)
    	at com.client.Client.run(Client.java:6495)
    	at java.lang.Thread.run(Thread.java:748)
    java.lang.NullPointerException
    	at com.client.cache.graphics.font.TextDrawingArea.<init>(TextDrawingArea.java:24)
    	at com.client.Client.startUp(Client.java:11191)
    	at com.client.Client.run(Client.java:6495)
    	at java.lang.Thread.run(Thread.java:748)
    Error: loaderror Loading title screen - 0% 5
    loaderror Loading title screen - 0% 5
    This is the issue I have, I zipped the cache to cache.zip (I zipped all the files and not only 1 folder). I does not download all the files, only this: Screenshot by Lightshot
    Any help is welcome, I will thank!
    I'm trying my best. I promise.
    Reply With Quote  
     

  2. #2  
    Registered Member Juicy7's Avatar
    Join Date
    Feb 2012
    Age
    23
    Posts
    151
    Thanks given
    45
    Thanks received
    1
    Rep Power
    0
    bump
    I'm trying my best. I promise.
    Reply With Quote  
     

  3. #3  
    Donator


    Join Date
    Oct 2008
    Posts
    125
    Thanks given
    34
    Thanks received
    89
    Rep Power
    1065
    Whats in the folder:
    Code:
    C:\Users\Simon\ValiusCache1\
    It seems it cant find the file, so send us a screenshot of that folder
    Support:
    Attached image
    Reply With Quote  
     

  4. #4  
    Registered Member Juicy7's Avatar
    Join Date
    Feb 2012
    Age
    23
    Posts
    151
    Thanks given
    45
    Thanks received
    1
    Rep Power
    0
    Quote Originally Posted by Supertje View Post
    Whats in the folder:
    Code:
    C:\Users\Simon\ValiusCache1\
    It seems it cant find the file, so send us a screenshot of that folder
    Thank you for responding, the photo of downloaded "cache" is above, I will post it here again. Screenshot by Lightshot

    Please take a look at it and let me know if you have any idea. I think I tried everything or maybe I got the version file wrong, no idea.
    I'm trying my best. I promise.
    Reply With Quote  
     

  5. #5  
    Donator


    Join Date
    Oct 2008
    Posts
    125
    Thanks given
    34
    Thanks received
    89
    Rep Power
    1065
    ok its missing
    Code:
    cacheVersion.dat
    Add that to it
    Support:
    Attached image
    Reply With Quote  
     

  6. #6  
    Registered Member Juicy7's Avatar
    Join Date
    Feb 2012
    Age
    23
    Posts
    151
    Thanks given
    45
    Thanks received
    1
    Rep Power
    0
    Quote Originally Posted by Supertje View Post
    ok its missing
    Code:
    cacheVersion.dat
    Add that to it
    I added it to cache.zip, still does the same. I wrote that on the first post
    I'm trying my best. I promise.
    Reply With Quote  
     

  7. #7  
    Donator


    Join Date
    Oct 2008
    Posts
    125
    Thanks given
    34
    Thanks received
    89
    Rep Power
    1065
    Quote Originally Posted by Juicy7 View Post
    I added it to cache.zip, still does the same. I wrote that on the first post
    did u check what need to be in the file?

    Most cache downloaders has a count in it, like you have this:
    Code:
    cacheVersion1.dat
    cacheVersion2.dat
    cacheVersion3.dat
    You can find that in your client files...
    Make sure u read your code!
    Support:
    Attached image
    Reply With Quote  
     

  8. #8  
    Registered Member Juicy7's Avatar
    Join Date
    Feb 2012
    Age
    23
    Posts
    151
    Thanks given
    45
    Thanks received
    1
    Rep Power
    0
    Quote Originally Posted by Supertje View Post
    did u check what need to be in the file?

    Most cache downloaders has a count in it, like you have this:
    Code:
    cacheVersion1.dat
    cacheVersion2.dat
    cacheVersion3.dat
    You can find that in your client files...
    Make sure u read your code!
    I might be dumb but I can't find these nor I have seen multiple of these.
    If I create more of them, do I just put different versions in them?
    Like:
    cacheVersion1.dat - 1.0
    cacheVersion2.dat - 2.0
    cacheVersion3.dat - 3.0

    Please let me know, thank you.
    I'm trying my best. I promise.
    Reply With Quote  
     

  9. #9  
    Donator


    Join Date
    Oct 2008
    Posts
    125
    Thanks given
    34
    Thanks received
    89
    Rep Power
    1065
    no you just need one, can u drop the full code of the cache loader/downloader?
    Support:
    Attached image
    Reply With Quote  
     

  10. #10  
    Registered Member Juicy7's Avatar
    Join Date
    Feb 2012
    Age
    23
    Posts
    151
    Thanks given
    45
    Thanks received
    1
    Rep Power
    0
    Quote Originally Posted by Supertje View Post
    no you just need one, can u drop the full code of the cache loader/downloader?
    yes sure, here:
    Code:
    package com.client.update;
    
    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.BufferedReader;
    import java.io.BufferedInputStream;
    import java.io.FileOutputStream;
    import java.io.FileReader;
    import java.io.FileInputStream;
    import java.io.InputStream;
    import java.io.InputStreamReader;
    import java.net.URLConnection;
    import java.net.URL;
    import java.nio.file.Files;
    import java.nio.file.Path;
    import java.nio.file.Paths;
    import java.util.zip.ZipEntry;
    import java.util.zip.ZipInputStream;
    
    import com.client.Client;
    import com.client.config.Configuration;
    import com.client.sign.Signlink;
    
    public class CacheDownloader {
    
    	private Client client;
    
    	private final int BUFFER = 8192;
    
    	private String CACHE_LINK = Configuration.CACHELINK;
    	private String BETA_CACHE_LINK = "http://beta.valius.net/cache.zip";
    
    	private static String VERSION_FILE_URL = "http://server.valius.net/cache/317/version.txt";
    	private static String BETA_VERSION_FILE_URL = "http://beta.valius.net/version.txt";
    	private Path FILE_LOCATION = Paths.get(getCacheDir(), getArchivedName());
    
    	public CacheDownloader(Client client) {
    		this.client = client;
    	}
    
    	private void drawLoadingText(String text) {
    		client.drawLoadingText(99, text);
    		System.out.println(text);
    	}
    
    	private void drawLoadingText(int amount, String text) {
    		client.drawLoadingText(amount, text);
    	}
    
    	private String getCacheDir() {
    		return Signlink.getCacheDirectory();
    	}
    
    	private String getCacheLink() {
    		return Configuration.betaClient ? BETA_CACHE_LINK : CACHE_LINK;
    	}
    
    	public CacheDownloader downloadCache() {
    		try {
    			
    			double expectedVersion = this.getExpectedVersion();
    			double currentVersion = this.getExistingVersion();
    			if(expectedVersion > currentVersion) {
    				downloadFile(getCacheLink(), getArchivedName());
    				unZip();
    				writeVersion(expectedVersion);
    			}
    			
    		} catch (Exception e) {
    			e.printStackTrace();
    		}
    		return this;
    	}
    	
    	private void writeVersion(double version) throws IOException {
    		FileWriter fileWriter = new FileWriter(getCacheDir() + "/cacheVersion.dat");
    		fileWriter.write(String.valueOf(version));
    		fileWriter.close();
    	}
    	
    	private double getExpectedVersion() {
    		try {
    			URL versionFile = new URL(Configuration.betaClient ? BETA_VERSION_FILE_URL : VERSION_FILE_URL);
    			BufferedReader in = new BufferedReader(new InputStreamReader(versionFile.openStream()));
    			String line = in.readLine();
    			in.close();
    			return Double.parseDouble(line);
    		} catch(Exception ex) {
    			ex.printStackTrace();
    		}
    		return 0.0;
    	}
    	
    	private double getExistingVersion() {
    		try {
    			BufferedReader in = new BufferedReader(new FileReader(getCacheDir() + "/cacheVersion.dat"));
    			String line = in.readLine();
    			in.close();
    			return Double.parseDouble(line);
    		} catch(Exception ex) {
    			ex.printStackTrace();
    		}
    		return 0.0;
    	}
    
    	private void downloadFile(String adress, String localFileName) {
    		client.resetBackgroundImages();
    		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 fileSize = conn.getContentLength();
    
    
    			while ((numRead = in.read(data)) != -1) {
    				out.write(data, 0, numRead);
    				numWritten += numRead;
    
    				int percentage = (int) (((double) numWritten / (double) fileSize) * 100D);
    				drawLoadingText((int)percentage, "Valius - Downloading Cache " + percentage + "%");
    
    			}
    			System.out.println(localFileName + "\t" + numWritten);
    			drawLoadingText("Valius - Unzipping...");
    		} catch (Exception exception) {
    			exception.printStackTrace();
    		} finally {
    			try {
    				if (in != null) {
    					in.close();
    				}
    				if (out != null) {
    					out.close();
    				}
    			} catch (IOException ioe) {
    				ioe.printStackTrace();
    			}
    		}
    	}
    
    	private String getArchivedName() {
    		int lastSlashIndex = getCacheLink().lastIndexOf('/');
    		if (lastSlashIndex >= 0 && lastSlashIndex < getCacheLink().length() - 1) {
    			String u = getCacheLink().substring(lastSlashIndex + 1);
    			String Name = u.replace("?dl=1", "");
    			return Name;
    		} else {
    			System.err.println("error retrieving archived name.");
    		}
    		return "";
    	}
    
    	private void unZip() throws IOException {
    		InputStream in = new BufferedInputStream(new FileInputStream(FILE_LOCATION.toString()));
    		ZipInputStream zin = new ZipInputStream(in);
    		ZipEntry e;
    		while ((e = zin.getNextEntry()) != null) {
    			String fileName = e.getName();
    			File newFile = new File(getCacheDir() + File.separator + fileName);
    			if (e.isDirectory()) {
    				newFile.mkdirs();
    			} else {
    				newFile.getParentFile().mkdirs();
    				if(newFile.exists())
    					newFile.delete();
    				unzip(zin, getCacheDir() + e.getName());
    			}
    			System.out.println("unzipping2 " + e.getName());
    		}
    		zin.close();
    		Files.deleteIfExists(FILE_LOCATION);
    	}
    
    	private void unzip(ZipInputStream zin, String s) throws IOException {
    		FileOutputStream out = new FileOutputStream(s);
    		byte[] b = new byte[BUFFER];
    		int len = 0;
    		while ((len = zin.read(b)) != -1)
    			out.write(b, 0, len);
    
    		out.close();
    	}
    
    }
    and configuration.java

    Code:
    package com.client.config;
    
    import com.jcabi.manifests.Manifests;
    
    public class Configuration {
    	
    	public static boolean betaClient;
    	
    	public static void checkMode() {
    		try {
    			String modeString = Manifests.read("Mode");
    			if(modeString.equalsIgnoreCase("beta")) {
    				betaClient = true;
    				LIVE_SERVER = false;
    				IP = "beta.valius.net";
    			}
    		} catch(Exception ex) {
    			
    		}
    	}
    	
    	public static boolean newFonts = false;
    
    	/**
    	 * Attack option priorities 0 -> Depends on combat level 1 -> Always right-click
    	 * 2 -> Left-click where available 3 -> Hidden
    	 */
    	public static int playerAttackOptionPriority = 0;
    	public static int npcAttackOptionPriority = 2;
    
    	public static boolean debug = false;
    	public static final boolean DUMP_SPRITES = false;
    
    	public static int xpSize = 0;
    	public static int xpSpeed = 0;
    	public static int xpDuration = 0;
    	public static int xpColour = 0;
    	public static int xpGroup = 0;
    	
    	public static boolean renderLoginScene = true;
    	public static final int LOGIN_SCREEN_WORLD_X = 3050;
    	public static final int LOGIN_SCREEN_WORLD_Y = 9950;
    
    	public static boolean enableSmoothShading = true;
    	public static boolean enableTileBlending = true;
    	public static boolean enableAntiAliasing = false;
    	public static boolean enableFogRendering = false;
        public static boolean enableRainbowFog = false;
    	public static boolean bountyHunter = true;
    	public static boolean playerNames = false;
    	public static boolean staffIcons = true;
    	public static int chatColor = 0;
        public static int fogColor = 0xDCDBDF;
    	public static long fogDelay = 500;
    	public static final String CLIENT_TITLE = "Valius | Your #1 Custom OSRS Experience";
    	public static final String SHORT_CLIENT_TITLE = "Valius";
    	public static final int CLIENT_VERSION = 5;
        public static Boolean LIVE_SERVER = false;
        public static String IP = "192.99.145.49";
    	public static final int PORT = 43594;
    	
    	public static final boolean THREADED_RENDERING = false;
    
    	public static Boolean DUMP_DATA = false;
    	public static int dumpID = 149;
    	public static Boolean DUMP_OTHER = false;
    	
    	
    	public static Boolean DUMP_ITEM_LIST = false;
    	public static Boolean DUMP_NPC_DATA = false;
    	public static final boolean DUMP_ITEM_DATA = false;
    	
    	//The one in libs is unobfuscated, the one in deploy is obfuscated alright so i just run the jar in gradle tasks (do i have to clean it each time before?) No need to clean every time but if you run into any issues, try leaning and jarring alright awesome , thanks man :)
    
    	/**
    	 * Used to repack indexes Index 1 = Models Index 2 = Animations Index 3 =
    	 * Sounds/Music Index 4 = Maps You can only do up to 300 files at a time
    	 */
    	
    	public static boolean repackIndexOne = false, 
    			repackIndexTwo = false, 
    			repackIndexThree = false,
    			repackIndexFour = false, 
    			repackIndexFive = false;
    			
    
    	public static final String CACHE_NAME = "ValiusCache1";
    
    	public static final String CACHELINK = "http://www.dropbox.com/s/srcy32cr8g8n13e/cache.zip"; //  cache link
    
        public static int CACHE_VERSION_LOADER = 1;
        
        /*
         * Discord Rich Presence Settings
         */
    	
    	/**
    	 * Seasonal Events
    	 */
    	public static boolean HALLOWEEN = false;
    	public static boolean CHRISTMAS = false;
    	public static boolean CHRISTMAS_EVENT = false;
    	public static boolean EASTER = false;
    
    	public static boolean osbuddyGameframe = false;
    
    	public static boolean oldGameframe = false;
    	public static int gameWorld = 1;
    
    	public static int xpPosition;
    	public static boolean escapeCloseInterface = false;
    	public static boolean inventoryContextMenu = true;
    	public static int statMenuColor = 0xBABABA;
    	public static boolean alwaysLeftClickAttack;
    	public static boolean hideCombatOverlay;
    	
    	public static boolean displayEntityOverlaySpriteText = true;
    	public static boolean displayObjectOverlaySpriteText = true;
    
    	public static boolean enableTweening = true;
    	
    	public static boolean hidePetOptions = false;
    
    }
    I'm trying my best. I promise.
    Reply With Quote  
     

Page 1 of 3 123 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. Cache not Downloading
    By Gh0stPred in forum Help
    Replies: 1
    Last Post: 12-03-2013, 05:37 AM
  2. Cache Not Downloading.
    By x317x in forum Help
    Replies: 3
    Last Post: 03-07-2013, 03:35 PM
  3. Cache not download?
    By Thani in forum Help
    Replies: 1
    Last Post: 01-05-2013, 09:45 AM
  4. InsanityX Cache Not Downloading?
    By Serzel in forum Help
    Replies: 2
    Last Post: 03-20-2012, 11:07 PM
  5. [DSPK] Cache not downloading
    By x Mariokillu x in forum Help
    Replies: 10
    Last Post: 12-08-2011, 01:26 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
  •