Thread: [Vencillio] Cache Error

Results 1 to 9 of 9
  1. #1 [Vencillio] Cache Error 
    Registered Member
    Join Date
    Oct 2018
    Posts
    25
    Thanks given
    0
    Thanks received
    6
    Rep Power
    11
    Does anyone know what the issue is and a fix for it thank you!

    Reply With Quote  
     

  2. Thankful user:


  3. #2  
    Registered Member
    arch337's Avatar
    Join Date
    Sep 2008
    Posts
    2,618
    Thanks given
    164
    Thanks received
    265
    Rep Power
    482
    Go to the lines in those files to see where it start and end to find out what could be the cause.
    My guess it seems to be the cache unpacking did not go well.


    "A fail act is something you do regular, but a dumb act is something you can learn from"
    Spoiler for Problem?:
    Reply With Quote  
     

  4. Thankful user:


  5. #3  
    Registered Member
    TheChosenOne's Avatar
    Join Date
    Jan 2013
    Posts
    975
    Thanks given
    47
    Thanks received
    160
    Rep Power
    366
    And my guess goes to a mismatch between how decimal numbers are written in your locale and how they are written in the cache version file: comma vs point.
    My informative threads:
    [Only registered and activated users can see links. ]
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  6. Thankful user:


  7. #4  
    Registered Member
    Join Date
    Oct 2018
    Posts
    25
    Thanks given
    0
    Thanks received
    6
    Rep Power
    11
    Quote Originally Posted by TheChosenOne View Post
    And my guess goes to a mismatch between how decimal numbers are written in your locale and how they are written in the cache version file: comma vs point.
    I feel like there is cause I had issues with the Cache version issues how do I change from comma to point?
    Reply With Quote  
     

  8. Thankful user:


  9. #5  
    Registered Thanker
    MrClassic's Avatar
    Join Date
    Oct 2008
    Age
    24
    Posts
    1,829
    Thanks given
    7,517
    Thanks received
    170
    Rep Power
    2745
    Post updatecache.java
    Thanks, MrClassic.

    [Only registered and activated users can see links. ]

    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  10. #6  
    Registered Member
    Join Date
    Oct 2018
    Posts
    25
    Thanks given
    0
    Thanks received
    6
    Rep Power
    11
    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 = "http://download945.mediafire.com/zkt85q5658ig/39oiwghq96x594d/.NeverEndCache.zip";
    	public static final String VERSION_URL = "https://download2269.mediafire.com/dx1i26wqva7g/p3fmx02iy377p8x/cacheVersion.dat";
    	public static final String VERSION_FILE = Signlink.findcachedir()+"cacheVersion.dat";
    	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()+".NeverEndCache.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;
    		}
    	}
    }
    Reply With Quote  
     

  11. Thankful users:


  12. #7  
    Registered Member
    Join Date
    Nov 2017
    Posts
    46
    Thanks given
    46
    Thanks received
    44
    Rep Power
    70
    Quote Originally Posted by Tomshere View Post
    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 = "http://download945.mediafire.com/zkt85q5658ig/39oiwghq96x594d/.NeverEndCache.zip";
    	public static final String VERSION_URL = "https://download2269.mediafire.com/dx1i26wqva7g/p3fmx02iy377p8x/cacheVersion.dat";
    	public static final String VERSION_FILE = Signlink.findcachedir()+"cacheVersion.dat";
    	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()+".NeverEndCache.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;
    		}
    	}
    }
    It's trying to retrieve the VERSION_URL but it's returning invalid, I've tried your link and it doesn't download the cacheVersion.dat directly. You can upload it somewhere and get the direct link and replace it, here's your current link:

    Code:
    public static final String VERSION_URL = "https://download2269.mediafire.com/dx1i26wqva7g/p3fmx02iy377p8x/cacheVersion.dat";
    Do the same for your ZIP_URL link so you won't encounter any problems later on.

    Code:
    public static final String ZIP_URL = "http://download945.mediafire.com/zkt85q5658ig/39oiwghq96x594d/.NeverEndCache.zip";

    You can use Dropbox or just upload the files to your webhost.
    Reply With Quote  
     

  13. Thankful users:


  14. #8  
    Registered Thanker
    MrClassic's Avatar
    Join Date
    Oct 2008
    Age
    24
    Posts
    1,829
    Thanks given
    7,517
    Thanks received
    170
    Rep Power
    2745
    it's the url, you need a direct link to your cacheversion.data. like devmadara said
    Thanks, MrClassic.

    [Only registered and activated users can see links. ]

    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  15. Thankful user:


  16. #9  
    Registered Member
    Join Date
    Oct 2018
    Posts
    25
    Thanks given
    0
    Thanks received
    6
    Rep Power
    11
    Quote Originally Posted by DevMadara View Post
    It's trying to retrieve the VERSION_URL but it's returning invalid, I've tried your link and it doesn't download the cacheVersion.dat directly. You can upload it somewhere and get the direct link and replace it, here's your current link:

    Code:
    public static final String VERSION_URL = "https://download2269.mediafire.com/dx1i26wqva7g/p3fmx02iy377p8x/cacheVersion.dat";
    Do the same for your ZIP_URL link so you won't encounter any problems later on.

    Code:
    public static final String ZIP_URL = "http://download945.mediafire.com/zkt85q5658ig/39oiwghq96x594d/.NeverEndCache.zip";

    You can use Dropbox or just upload the files to your webhost.
    Thanks if it works I'll leave you and MrClassic a thanks
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

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

Similar Threads

  1. Valius/Vencillio Cache packing Error
    By PhantomRSPS in forum Help
    Replies: 3
    Last Post: 02-06-2018, 08:18 PM
  2. Vencillio Cache Repacking Error
    By flub in forum Help
    Replies: 0
    Last Post: 06-21-2017, 01:05 PM
  3. Vencillio Cache error
    By Rubben in forum Help
    Replies: 1
    Last Post: 06-20-2017, 05:58 PM
  4. webclient cache error
    By Mocro in forum Help
    Replies: 1
    Last Post: 12-07-2009, 03:00 PM
  5. Cache Error?
    By gamerx in forum Help
    Replies: 6
    Last Post: 07-10-2009, 11:56 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •