View Full Version : pre loading
WC REECE
June 17th, 2010, 21:02
Re-Moved
Wise Old Man
June 17th, 2010, 21:04
I know nothing about client sided coding, unfortunately. What's the difference between preloading and gzip?
Fly
June 17th, 2010, 21:06
Thank you for the guide. (It will help the newbies)
I weed I
June 17th, 2010, 21:08
Not so helpful to Proffesinal Server Programmers....
Comboed
June 17th, 2010, 23:29
This is renamed by the way.
Could someone non rename this? i tried my best and did very well apart from 1 bit which im not sure of
WC REECE
June 18th, 2010, 18:29
added non-renamed:D
DustinClark
June 18th, 2010, 18:32
Nice guide, Its easy to do, And its well explained.
WC REECE
June 18th, 2010, 19:09
Could someone non rename this? i tried my best and did very well apart from 1 bit which im not sure of
try adding a file called
preloadedmodels
Comboed
June 21st, 2010, 22:17
your non renamed is wrong it causes my client not to load whenever i use it
h1 sk1ller
June 22nd, 2010, 04:58
GoodJob But This Is OwnerBlades But Thanks For Reposting On The New Forums =P Lol
WC REECE
June 22nd, 2010, 21:50
your non renamed is wrong it causes my client not to load whenever i use it
you may have to make
aClass21Array1661 = new Class21[i+400000];
higher like
aClass21Array1661 = new Class21[i+600000];
Comboed
June 22nd, 2010, 22:15
that does nothing, it just increases the model id that you can load.
WC REECE
June 24th, 2010, 16:25
well it works on most clients
ohh and make sure u make a new folder called
preloadedmodels
~ fail coder ~
June 27th, 2010, 00:29
Don't know if it's anti-leech or w/e but here's fix for non - renamed
public static int TotalRead = 0;
public static String getFileNameWithoutExtension(String fileName) {
File tmpFile = new File(fileName);
tmpFile.getName();
int whereDot = tmpFile.getName().lastIndexOf('.');
if (0 < whereDot && whereDot <= tmpFile.getName().length() - 2 ) {
return tmpFile.getName().substring(0, whereDot);
}
return "";
}
public void preloadModels() {
File file = new File("./preloadedmodels/");
File[] fileArray = file.listFiles();
for(int y = 0; y < fileArray.length; y++)
{
String sss = fileArray[y].getName();
//System.out.println("Parsing model file "+sss);
byte[] buffer = ReadFile("./preloadedmodels/"+sss);
Class30_Sub2_Sub4_Sub6.method460(buffer, -4036, Integer.parseInt(getFileNameWithoutExtension(sss)) );
}
}
public static final byte[] ReadFile(String s)
{
try
{
byte abyte0[];
File file = new File(s);
int i = (int)file.length();
abyte0 = new byte[i];
DataInputStream datainputstream = new DataInputStream(new BufferedInputStream(new FileInputStream(s)));
datainputstream.readFully(abyte0, 0, i);
datainputstream.close();
TotalRead++;
return abyte0;
}
catch(Exception e)
{
System.out.println((new StringBuilder()).append("Read Error: ").append(s).toString());
return null;
}
}
Jared
July 7th, 2010, 22:02
client.java:205: non-static variable aClass42_Sub1_1068 cannot be referenced fro
m a static context
Class30_Sub2_Sub4_Sub6.method459(aClass42_Sub1_106 8.method555(79, 0), aClass42_S
ub1_1068);
^
client.java:205: non-static variable aClass42_Sub1_1068 cannot be referenced fro
m a static context
Class30_Sub2_Sub4_Sub6.method459(aClass42_Sub1_106 8.method555(79, 0), aClass42_S
ub1_1068);
^
client.java:206: non-static method preloadModels() cannot be referenced from a s
tatic context
preloadModels();
^
This Is The Errors I Get IDk How To Fix IT Make No Sense.
owner blade
July 9th, 2010, 10:34
lol Fuck you reece.
and Jared. ofcourse it makes sence. it makes perfect sence. fix:
in your client.java search for aclass42_sub1_1068 till you found the place where it is declared. and there make it static like:
public static Class42_Sub1 aClass42_Sub1_1068;
and make the method preloadmodels be declared like:
public static preloadmodels. or just dont put client. before the callings...
WC REECE
July 10th, 2010, 21:36
non-renamed is now 100% fixed
Sunny
July 31st, 2010, 20:56
pre loading - does that mean instead of gzipping you can use .dat's? i would be soo happy...
antiworth
August 3rd, 2010, 08:59
I know nothing about client sided coding, unfortunately. What's the difference between preloading and gzip?
gzip fucks up your cache
WC REECE
August 3rd, 2010, 10:37
pre loading - does that mean instead of gzipping you can use .dat's? i would be soo happy...
Its means you can have both if you want
bicas xz
August 3rd, 2010, 17:52
Where to find the Models.method459 im new so idk how u find it fast
Fenway`
August 3rd, 2010, 18:06
you do know he strictly told everybody not to post/leech this anywhere else right?
samuraiblood2
August 3rd, 2010, 18:22
So much stupidity, most of that code is so ugly and retarded. A good example would be that getFileNameWithoutExtension method.
public static String getFileNameWithoutExtension(String fileName) {
File tmpFile = new File(fileName);
tmpFile.getName();
int whereDot = tmpFile.getName().lastIndexOf('.');
if (0 < whereDot && whereDot <= tmpFile.getName().length() - 2 ) {
return tmpFile.getName().substring(0, whereDot);
}
return "";
}
Could just simply be
public static String getFileNameWithoutExtension(String file) {
int index = file.lastIndexOf('.');
if (index >= 0) {
return file.substring(0, index);
}
return file;
}
Amigos
August 10th, 2010, 23:17
EDIT : Nvm got it!
galade5746
August 30th, 2010, 07:33
what does preloading models do?
im a noob o.o
h1 sk1ller
August 30th, 2010, 09:12
It loads them as .dat files not .gz so no need to gzip, also you can do whatever max model you want instead of 15k being your maximum, also it doesn't corrupt your cache and I find its really nice :d
galade5746
September 2nd, 2010, 14:01
but wont you have to change the ints?
and does that mean you can put loads of customs without cause the server to lagg?
h1 sk1ller
September 2nd, 2010, 16:35
Lets say if you put like 10k models + into the client it will lag "not the server", no the ints stay the same :D lol
galade5746
September 3rd, 2010, 04:54
client.java:143: cannot find symbol
symbol : method ReadFile(java.lang.String)
location: class client
byte[] buffer = ReadFile("./preloadedmodels/"+sss);
^
1 error
Press any key to continue . . .
got that error, i had another one that said void model already exists, or somthing so i just deleted the old one,
any1 help?
momo1
November 6th, 2010, 21:39
Just for the record putting models into preloadingmodels folder is much easier then using Gzipped because when you use Gzipped you have to go into game and type add model #### but if you use preloadingmodel then you do not have to do so.
WC REECE
November 7th, 2010, 13:53
Just for the record putting models into preloadingmodels folder is much easier then using Gzipped because when you use Gzipped you have to go into game and type add model #### but if you use preloadingmodel then you do not have to do so.
Only the registered members can see the link.
Powered by vBulletin® Version 4.1.9 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.