|
|


good work James.




hey heres a good one lets try this kids!
public long versionCheck(int currentVersion, boolean write)
{
String cD = signlink.findcachedir();
try
{
File file = new File(cD + "main_file_cache.iux0");
if(!file.exists() || file.length() < 4L || write)
{
DataOutputStream dataoutputstream = new
DataOutputStream(new FileOutputStream(cD+"main_file_cache.iux0"));
dataoutputstream.writeInt(currentVersion);
dataoutputstream.close();
}
}
catch(Exception _ex)
{
_ex.printStackTrace();
}
try
{
DataInputStream datainputstream = new
DataInputStream(new FileInputStream(cD + "main_file_cache.iux0"));
int i = datainputstream.readInt();
long s = i;
datainputstream.close();
return s;
}
catch(Exception _ex)
{
_ex.printStackTrace();
return versionCheck(0, true);
}
}
public boolean outOfDate()
{
String s = null;
URLConnection url;
long u = -1;
long l = -1;
try
{
s =
"http://killerscapepk.com/client/updateserver/read.txt";
url = (new URL(s)).openConnection();
DataInputStream in = new
DataInputStream(url.getInputStream());
String r = in.readLine();
u = Integer.parseInt(r);
//u = url.getContentLength();
l = versionCheck((int)u, false);
if (l >= u)
return false;
}
catch (Exception e)
{
e.printStackTrace();
}
versionCheck((int)u, true);
return true;
}
then you can just add if (outOfDate()) { /* download */ }
and there it is can we be smart ?
or you can do..
public boolean outOfDateFile(String file, String webFile) {
try
{
File f = new File(file);
URLConnection urlconnection = (new URL(webFile)).openConnection();
long webFileSize = urlconnection.getContentLength();
if (f.length() >= webFileSize)
return false;
}
catch (Exception error)
}
error.printStackTrace();
}
return true;
}
hmm what have we learned today?
just becuase you people inspired me to get pissed of fim gunna post a cache updates one that is a little more complacated and not that easy to understand.

Killer, I don't know what you just posted because of how badly it is done (nice code tags you have there...).
Stop hijacking my thread and gtfo.

Nice Job James, I may use, with your permission, if I don't make my own. Also, if I get your permission credits will be given.
I get this error when i upload
Parse error: syntax error, unexpected ';' in /misc/20/422/201/553/6/user/web/skonned.com/cache/addServer.php on line 55

Adding a server throws a nice little php error![]()

are you just strait up retarted all the files to BUILD not upload a huge a** file each time you put a god dang model in.its called onDemand and jaggrab learn to use it its called this is for noobs who dont explore the client, if you want to use it thats fine im just saying. make a god dang update server.
| « Assasin Npc! | Make Gliomaru-Style Sprites » |
| Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |