Jump to content

darkchaos

Member
  • Content count

    61
  • Joined

  • Last visited

  1. [quote name='Onex']it might be how you are zipping the files.. make sure you make a new .zip folder on your desktop and THEN select all your cache and drop it in. also in signlink.java you MUST have the cache name correct (capitalize if needed) the only other thing I could think of is that it could be your cachedownloader coding , but try those things first and post results.[/QUOTE] thanks for tips but still getting the same result. error connection- retying in "5". ect.
  2. okay so i found out that my server uses a lot of files to update the cache, the one´s i found and chanced the way i think it need´s to do is the fellowing. 1. cachedownloader 2. client.java 3. updatecache the cache that is used normally whas called cacheV6 i chanced that to mine the Cache that i am using. now how it look´s like? 1. cachedownloader. [QUOTE]public class CacheDownloader { public client client; public final int BUFFER = 1024; public static final int VERSION = 2; public String cacheLink = "dl.dropboxusercontent.com/s/fku6906qrko2q1u/Servername.rar"; // Link to cache public String fileToExtract = getCacheDir() + getArchivedName(); public CacheDownloader(client client) { this.client = client; }[/QUOTE] 2. updatecache [QUOTE]/*** This crap is baws*/ public static final String LINKTOCACHE = "dl.dropboxusercontent.com/s/fku6906qrko2q1u/servername.rar"; public static final String VERSION_URL = "https://www.dropbox.com/home"; public static final String VERSION_FILE = sign.signlink.findcachedir()+"cacheVersion.txt"; private client client; client frame; public UpdateCache(client client) { this.client = client; } private void drawLoadingText(int amount, String text) { client.drawLoadingText(amount, text); } [/QUOTE] 3. client.java [QUOTE] } catch (IOException ioexception) { if (s3.equals("Unknown error")) { s3 = "Connection error"; String url = "dl.dropboxusercontent.com/s/fku6906qrko2q1u/Servername.rar"; downloadcache(url, "Servername.rar", "", "Servername.rar"); }[/QUOTE] I am just chanced the name from the cache into "servername" since i wont other people know the name of the server already and dont want that people using my cache. for all other things the coding is above. i dont know what i am missing. (yes i compiled). I personly myself think i do forget something or did something wrong this are the only things btw i chanced. (pretty amateur coder but improving only need to find this out :P ) i hope if anyone can help me out that shall be fine already got a lot of support from 1 person and i am really thankfully for that please help me out :D thanks and greetings,
  3. okay gonna try it out i reply if it did work. Edit: thanks for the tip and yes i think normally it should work since once I am pasting "dl.dropboxusercontent.com/s/3k5uih8dcud2hfp/servername.zip" into my search bar it start's downloading. The problem is he doesn't download once I am "run" the server. the steps i did. 1. Uploaded my cache once more to dropbox. 2. chanced the [url]www.dropbox.com[/url] into "dl.dropboxusercontent.com" 3. added the link after dl.dropboxusercontent.com see above. 4. compiled the server whit all compilers the same way once i am updating the client or server. 5. pressed run. than it say's downloading cache. and than it goes over whitout downloading anything into. "requesting titlescreen"but ofcourse that's not gonna work so than i am getting the fellowing. "connection error- retrying in 5" and i just dont get this anymore... if i did fergot something please tell me.
  4. yes iknow this but i want that it's gonna download automatic so if i put it online (when it's fully ready) the player's dont need to do that himself.
  5. watch ur jdk most likely isn't ur jdk updated in ur compiler. if u dont know where to find ur jdk than i can explain for windows 7. go to "computer/ C; / users/ program files/ java" than u see like "jdk1.7.0_51" (at least this is the jdk version i have this can be something else than u have" now to fix ur problem i see 2 common things that make's this error. first time for the compiler. most time's the compiler will say like this, [MENTION=7458]echo[/MENTION] off Title Compiler "C:\Program Files\Java\jdk1.7.0_51\bin\javac.exe" -d ./bin ./src/*.java ./src/sign/*.java pause " but most likely ur jdk version installed on ur computer is differn't just chance that shall fix the error. There is passble is doesn't says "jdk" but says "jre" than look up ur jre version mine is "7" so for me it shall looked like this, " [MENTION=7458]echo[/MENTION] off Title Compiler "C:\Program Files\Java\jre7\bin\javac.exe" -d ./bin ./src/*.java ./src/sign/*.java pause " but for u it can be "6" if u diddn't updated ur jre version. Also watch in ur firewall that u allowed jdk(java) else u can have evrything right in ur compiler but that wont ever work whitout chancing settings in ur firewall. for that fellow the next steps. 1. go to ur computer. 2. go to system properties. 3. go to advanced system settings 4. than go to environment variable. 5. than u get a little screen that will say on top "environment variable" and little under it shall say something like "user variable for (user)" than u see the fellowing options. "new/edit/deleate" 6. press new, than it has 2 text bar's something about a name, put there "classpath" the other 1 left there u put "C:\Program Files\Java\jdk ur jdk\bin;%CLASSPATH%; " where i putted there "ur jdk" there u need to put something like "jdk1.7.0_51" if u have atleast that version. than press okay. 7. do the same again, make a other new one but this time u dont put into the top text bar "classpath" but now u do "path" the other text bar is the same whit ur jdk version into in. i hope i helped out whit this. Edit: btw. if this helped ur out or not please reply so i know if it helped :D if not please tell more or post a picture from ur compiler that shows the error and a picture of ur compiler when u do "edit"
  6. yes I am know i can send the cache but meself try to learn about programming in java so i can put a server myself online s´n since my server is almost compleet but this is one of the things I am need to fix. Thanks for reply. Also thanks for telling me if u know what the problem is. If i know it than i reply on ur post and let u know how i did it. :D oh btw: mine is not even downloading a small part is goes over in "connection error please try again in 5" than it goes to 10, 15,20 ect. all know this problem but idk how to fix this. If anyone can answare this please help me out.
  7. hey, I am very busy coding my server and when i try'd to put it online for a frend of me so he can help me finding problems in the server i noticed that the autodownloader for the cache doesn't work. So than i did try it out myself i did deleate the cache but than i get this problem to, now i have a file called "autodownloader" I am pretty sure there is something i need to chance but this is first time i need to do that myself. what is in this autodownloader? now check this out. [CODE]import java.io.*; import java.net.*; import java.util.zip.*; import java.util.Enumeration; import javax.swing.JOptionPane; import sign.signlink; public class CacheDownloader { public client client; public final int BUFFER = 1024; public static final int VERSION = 2; public String cacheLink = "www.dropbox.com/s/3k5uih8dcud2hfp/Chaos317.zip?m"; public String fileToExtract = getCacheDir() + getArchivedName(); public CacheDownloader(client client) { this.client = client; } public void drawLoadingText(String text) { client.drawLoadingText(35, text); } public void drawLoadingText(int amount, String text) { client.drawLoadingText(amount, text); } public String getCacheDir() { return signlink.findcachedir(); } public String getCacheLink() { return cacheLink; } public int getCacheVersion() { return VERSION; } 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)); } public void DoesNotHaveCacheMessage() { alert("You do not have the cache. Cache will now be downloaded, please do not interrupt the download!"); alert("If Client goes white, it's unpacking cache - let it load!!"); } public CacheDownloader downloadCache() { try { File location = new File(getCacheDir()); File version = new File(getCacheDir() + "/cacheUpdate" + getCacheVersion() + ".dat"); if(!location.exists()) { //delete(getCacheDir()); DoesNotHaveCacheMessage(); downloadFile(getCacheLink(), getArchivedName()); unZip(); BufferedWriter versionFile = new BufferedWriter(new FileWriter(getCacheDir() + "/cacheUpdate" + getCacheVersion() + ".dat")); versionFile.close(); deleteDownloadedZipFile(getArchivedName()); } else { if(!version.exists()) { DoesNotHaveCacheMessage(); //delete(getCacheDir()); downloadFile(getCacheLink(), getArchivedName()); unZip(); BufferedWriter versionFile = new BufferedWriter(new FileWriter(getCacheDir() + "/cacheUpdate" + getCacheVersion() + ".dat")); versionFile.close(); deleteDownloadedZipFile(getArchivedName()); } else { return null; } } } catch(Exception e) { } return null; } public 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 + "%"); } drawLoadingText("Finished downloading "+getArchivedName()+"!"); } catch (Exception exception) { exception.printStackTrace(); } finally { try { if (in != null) { in.close(); } if (out != null) { out.close(); } } catch (IOException ioe) { } } } public String getArchivedName() { int lastSlashIndex = getCacheLink().lastIndexOf('/'); if (lastSlashIndex >= 0 && lastSlashIndex < getCacheLink().length() -1) { return getCacheLink().substring(lastSlashIndex + 1); } else { } return ""; } public void deleteDownloadedZipFile(String fileName) { File f = new File(getCacheDir() + fileName); if (!f.exists()) throw new IllegalArgumentException("Delete: no such file or directory: " + fileName); if (!f.canWrite()) throw new IllegalArgumentException("Delete: write protected: " + fileName); if (f.isDirectory()) { String[] files = f.list(); if (files.length > 0) throw new IllegalArgumentException("Delete: directory not empty: " + fileName); } boolean success = f.delete(); if (!success) throw new IllegalArgumentException("Delete: deletion failed"); } public static boolean delete( String path ) { if (path == null || path.trim().length() == 0) return false; return delete(new File(path)); } public static boolean delete( File fileOrDirectory ) { if (fileOrDirectory == null) return false; if (!fileOrDirectory.exists()) return false; if (fileOrDirectory.isDirectory()) { for (File childFile : fileOrDirectory.listFiles()) { delete(childFile); } } return fileOrDirectory.delete(); } public 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()); } } zin.close(); } catch(Exception e) { e.printStackTrace(); } } public 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(); } }[/CODE] I am coding not very long but i understand the basic at most but people tell this is basic also but i dont get this at the moment i hope someone will/can help me out. Please dont say stop coding or crap like this since that isn't helpfull at all and i really try my best learning this. thanks already for all help i get :D Greetings, darkchaos
  8. the Mysterybox i did added all coding for it (like tutorails) said how it must be done but when i compile my server there are no error's but when i log in and spawn the mysterbox (6199) and click on it, it doesn't do anything
  9. just search for something like "admin, owner, mod" or if u get so many files search for the owner name that's already in there than you get some files and it is just going file after file max 5-10 java files easy to pick the good one most likly in client.java ( i think ) and 1 more thing i am understand it is 6+? if it isn't than look in ur server files-data-chataters and find ur name (sorry if charaters is spelled wrong my english isn't very good ) stil hoped i did helped u out. best of luck
  10. hey i am did started a new project (a server i want to put online hopefully next month) but i am got the problem whit the mysterybox since it whasn't coded in the base i had now i fellowed some tutorials on how to put it in and it gives rondom rewards, now i did all coding but it doesn't open the box.... :confused: lol... now the strange thing about it is normally i get errors but i alwais can open the box now i dont get errors and now i cant open the box uhgg... :confused: now what i did? potions.java [CODE]case 6199: c.getItems().deleteItem(6199, 1); c.getItems().addItem(c.Mbox(), 1); break;[/CODE] and i did added in client.java. [CODE] private Client c; int[] Mbox = { 12435, 15441}; public int Mbox() { return Mbox[(int) (Math.random() * Mbox.length)]; }[/CODE] now ignore the item codes plz since this needs to be added but this is just a tryout so it works like i want than i can chance the items the way i want. now hopefully can someone help me out. I am allow help over teamvieuwer (if you understand dutch since i am from netherlands) ps: sorry for my not perfect english but like i said i am from netherlands and english isn't my best way to write/talk in XD Edit: i did chanced the coding in my client, and potions.java but still getting the problem nothing works i can click that Mbox 100000m times it just doesn't do anything and i am pretty sure my coding for random must be fine but somehow it ignore's it. please help this start to piss me off since i am code already for 3-4 years and can do alot but this i cant fix
×